This commit is contained in:
彭桃 2023-03-29 15:50:36 +08:00
parent 70108bfe30
commit 843dcfd2f1

View File

@ -2058,13 +2058,13 @@ class Maintainentry extends BaseController
if (empty($type)) {
$this->apiError('缺少参数');
} else {
$ids = Db::table('cms_planting_type')->where('pid',$type)->column('id') ;
$where['user_id'] = $this->request->uid;
$where['type_id'] = $type;
$page = get_params('page')??1;
$limit = get_params('limit')??10;
$order = get_params('order')??'id';
$result = Db::table('cms_planting_information')->where($where)->page($page,$limit)->order($order. ' desc')
$result = Db::table('cms_planting_information')->where($where)->whereIn('type_id',$ids)->page($page,$limit)->order($order. ' desc')
->withAttr('createtime', function ($val,$data) {
return date('Y-m-d H:i:s',$data['createtime']);
})