From 73db1cd0b7950bec2bfcbccd45e155ed9171601e Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Sat, 25 May 2024 17:57:06 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=90=9C=E7=B4=A2=E6=9D=A1?= =?UTF-8?q?=E4=BB=B6=EF=BC=8C=E5=A2=9E=E5=8A=A0=E5=AF=B9=E4=B8=89=E7=BA=A7?= =?UTF-8?q?=E7=B1=BB=E7=9B=AE=E7=9A=84=E6=90=9C=E7=B4=A2=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/lists/goods/GoodsclassLists.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/app/api/lists/goods/GoodsclassLists.php b/app/api/lists/goods/GoodsclassLists.php index 2f55d9f..d2c84d3 100644 --- a/app/api/lists/goods/GoodsclassLists.php +++ b/app/api/lists/goods/GoodsclassLists.php @@ -16,7 +16,7 @@ use app\Request; class GoodsclassLists extends BaseAdminDataLists implements ListsSearchInterface { - + protected $where; /** * @notes 设置搜索条件 * @return \string[][] @@ -52,7 +52,13 @@ class GoodsclassLists extends BaseAdminDataLists implements ListsSearchInterface ->order(['sort' => 'desc','id' => 'desc']) ->select()->toArray(); }else{ + $three=Request()->get('three',0); + if($three==0){ + $where[]=['children','<>','']; + $this->where=$where; + } $lists = Goodsclass::where($this->searchWhere) + ->where($this->where) ->field(['id', 'pid', 'name', 'data', 'pic', 'sort']) ->limit($this->limitOffset, $this->limitLength) ->order(['sort' => 'desc','id' => 'desc']) @@ -87,7 +93,7 @@ class GoodsclassLists extends BaseAdminDataLists implements ListsSearchInterface ->count(); }else{ return Goodsclass::where($this->searchWhere) - ->where('children','<>',null) + ->where($this->where) ->count(); }