修复搜索条件,增加对三级类目的搜索支持
This commit is contained in:
parent
575280f495
commit
73db1cd0b7
@ -16,7 +16,7 @@ use app\Request;
|
|||||||
class GoodsclassLists extends BaseAdminDataLists implements ListsSearchInterface
|
class GoodsclassLists extends BaseAdminDataLists implements ListsSearchInterface
|
||||||
{
|
{
|
||||||
|
|
||||||
|
protected $where;
|
||||||
/**
|
/**
|
||||||
* @notes 设置搜索条件
|
* @notes 设置搜索条件
|
||||||
* @return \string[][]
|
* @return \string[][]
|
||||||
@ -52,7 +52,13 @@ class GoodsclassLists extends BaseAdminDataLists implements ListsSearchInterface
|
|||||||
->order(['sort' => 'desc','id' => 'desc'])
|
->order(['sort' => 'desc','id' => 'desc'])
|
||||||
->select()->toArray();
|
->select()->toArray();
|
||||||
}else{
|
}else{
|
||||||
|
$three=Request()->get('three',0);
|
||||||
|
if($three==0){
|
||||||
|
$where[]=['children','<>',''];
|
||||||
|
$this->where=$where;
|
||||||
|
}
|
||||||
$lists = Goodsclass::where($this->searchWhere)
|
$lists = Goodsclass::where($this->searchWhere)
|
||||||
|
->where($this->where)
|
||||||
->field(['id', 'pid', 'name', 'data', 'pic', 'sort'])
|
->field(['id', 'pid', 'name', 'data', 'pic', 'sort'])
|
||||||
->limit($this->limitOffset, $this->limitLength)
|
->limit($this->limitOffset, $this->limitLength)
|
||||||
->order(['sort' => 'desc','id' => 'desc'])
|
->order(['sort' => 'desc','id' => 'desc'])
|
||||||
@ -87,7 +93,7 @@ class GoodsclassLists extends BaseAdminDataLists implements ListsSearchInterface
|
|||||||
->count();
|
->count();
|
||||||
}else{
|
}else{
|
||||||
return Goodsclass::where($this->searchWhere)
|
return Goodsclass::where($this->searchWhere)
|
||||||
->where('children','<>',null)
|
->where($this->where)
|
||||||
->count();
|
->count();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user