修复搜索条件,增加对三级类目的搜索支持
This commit is contained in:
parent
575280f495
commit
73db1cd0b7
@ -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();
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user