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(); }