From 95596fea5b8ecc085c555db66d8de5cd85bfb9e9 Mon Sep 17 00:00:00 2001 From: hdm Date: Tue, 7 Feb 2023 11:42:56 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BB=BB=E5=8A=A1=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E5=A4=9A=E6=9D=A1=E4=BB=B6=E6=90=9C=E7=B4=A2=20or?= =?UTF-8?q?=E3=80=81=20and=20=E8=81=94=E5=90=88=E6=9F=A5=E8=AF=A2=E7=9A=84?= =?UTF-8?q?=E8=AF=AD=E6=B3=95=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/project/model/ProjectDocument.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/project/model/ProjectDocument.php b/app/project/model/ProjectDocument.php index 22a3417..3eb89c4 100644 --- a/app/project/model/ProjectDocument.php +++ b/app/project/model/ProjectDocument.php @@ -15,6 +15,7 @@ class ProjectDocument extends Model //列表 function list($param) { $where = array(); + $whereOr = array(); $map1 = []; $map2 = []; if (!empty($param['project_id'])) { @@ -23,13 +24,13 @@ class ProjectDocument extends Model $project_ids = Db::name('ProjectUser')->where(['uid' => $param['uid'], 'delete_time' => 0])->column('project_id'); $map1[] = ['admin_id', '=', $param['uid']]; $map2[] = ['project_id', 'in', $project_ids]; + $whereOr =[$map1,$map2]; } if (!empty($param['keywords'])) { $where[] = ['title|content', 'like', '%' . $param['keywords'] . '%']; } $where[] = ['delete_time', '=', 0]; - $whereOr =[$map1,$map2]; $rows = empty($param['limit']) ? get_config('app.page_size') : $param['limit']; $list = Db::name('ProjectDocument') ->where(function ($query) use ($whereOr) {