Merge pull request 'feat: 修改分类列表API逻辑' (#27) from dev into main
Reviewed-on: #27
This commit is contained in:
commit
7e5fdb9d22
@ -83,21 +83,17 @@ class CateLists extends BaseAdminDataLists implements ListsSearchInterface
|
||||
{
|
||||
$level = Request()->get('level', 1);
|
||||
$pid = $this->request->get('pid',0);
|
||||
if($pid == 0 && $level ==1){
|
||||
$cate_arr = StoreBranchProduct::where($this->searchWhere)->distinct()
|
||||
->column('top_cate_id');
|
||||
}
|
||||
|
||||
if($pid && $level ==2){
|
||||
$this->searchWhere[] = ['top_cate_id','=',$pid];
|
||||
$cate_arr = StoreBranchProduct::where($this->searchWhere)->distinct()
|
||||
->column('two_cate_id');
|
||||
}
|
||||
|
||||
if($pid && $level ==3){
|
||||
}elseif($pid && $level ==3){
|
||||
$this->searchWhere[] = ['two_cate_id','=',$pid];
|
||||
$cate_arr = StoreBranchProduct::where($this->searchWhere)->distinct()
|
||||
->column('cate_id');
|
||||
}else{
|
||||
$cate_arr = StoreBranchProduct::where($this->searchWhere)->distinct()
|
||||
->column('top_cate_id');
|
||||
}
|
||||
return Cate::where('id', 'in', $cate_arr)->count();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user