From 843dcfd2f10f45164f551437d7394ee4b825f992 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BD=AD=E6=A1=83?= <1098598843@qq.com> Date: Wed, 29 Mar 2023 15:50:36 +0800 Subject: [PATCH] 1 --- app/api/controller/Maintainentry.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/api/controller/Maintainentry.php b/app/api/controller/Maintainentry.php index b420424..fe9f977 100644 --- a/app/api/controller/Maintainentry.php +++ b/app/api/controller/Maintainentry.php @@ -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']); })