feat: 调整分类列表API逻辑
This commit is contained in:
parent
4f029d5967
commit
004ad3ccca
@ -48,20 +48,17 @@ class CateLists extends BaseAdminDataLists implements ListsSearchInterface
|
|||||||
$pid = $this->request->get('pid',0);
|
$pid = $this->request->get('pid',0);
|
||||||
$this->searchWhere[] = ['stock', '>', 0];
|
$this->searchWhere[] = ['stock', '>', 0];
|
||||||
$this->searchWhere[] = ['status', '=', 1];
|
$this->searchWhere[] = ['status', '=', 1];
|
||||||
if($pid == 0 && $level ==1){
|
|
||||||
$cate_arr = StoreBranchProduct::where($this->searchWhere)->distinct()
|
|
||||||
->column('top_cate_id');
|
|
||||||
}
|
|
||||||
if($pid && $level ==2){
|
if($pid && $level ==2){
|
||||||
$this->searchWhere[] = ['top_cate_id','=',$pid];
|
$this->searchWhere[] = ['top_cate_id','=',$pid];
|
||||||
$cate_arr = StoreBranchProduct::where($this->searchWhere)->distinct()
|
$cate_arr = StoreBranchProduct::where($this->searchWhere)->distinct()
|
||||||
->column('two_cate_id');
|
->column('two_cate_id');
|
||||||
}
|
}elseif($pid && $level ==3){
|
||||||
|
|
||||||
if($pid && $level ==3){
|
|
||||||
$this->searchWhere[] = ['two_cate_id','=',$pid];
|
$this->searchWhere[] = ['two_cate_id','=',$pid];
|
||||||
$cate_arr = StoreBranchProduct::where($this->searchWhere)->distinct()
|
$cate_arr = StoreBranchProduct::where($this->searchWhere)->distinct()
|
||||||
->column('cate_id');
|
->column('cate_id');
|
||||||
|
}else{
|
||||||
|
$cate_arr = StoreBranchProduct::where($this->searchWhere)->distinct()
|
||||||
|
->column('top_cate_id');
|
||||||
}
|
}
|
||||||
$lists = [];
|
$lists = [];
|
||||||
if ($cate_arr) {
|
if ($cate_arr) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user