feat: 修改产品列表API,增加分类ID参数
This commit is contained in:
parent
6f23c4ffde
commit
c487fe3cc0
@ -76,6 +76,7 @@ class ProductLists extends BaseAdminDataLists implements ListsSearchInterface
|
|||||||
public function lists(): array
|
public function lists(): array
|
||||||
{
|
{
|
||||||
$class_all=$this->request->get('class_all');
|
$class_all=$this->request->get('class_all');
|
||||||
|
$cate_id=$this->request->get('class');
|
||||||
$name = $this->request->get('name','');
|
$name = $this->request->get('name','');
|
||||||
$order_param = $this->request->get('order');
|
$order_param = $this->request->get('order');
|
||||||
$store_id = $this->request->get('store_id',2);
|
$store_id = $this->request->get('store_id',2);
|
||||||
@ -88,9 +89,9 @@ class ProductLists extends BaseAdminDataLists implements ListsSearchInterface
|
|||||||
if($arr){
|
if($arr){
|
||||||
$arr2=Cate::where('pid','in',$arr)->column('id');
|
$arr2=Cate::where('pid','in',$arr)->column('id');
|
||||||
$where[]=['cate_id','in',array_merge($arr,$arr2)];
|
$where[]=['cate_id','in',array_merge($arr,$arr2)];
|
||||||
}else{
|
|
||||||
$where[]=['cate_id','=',$class_all];
|
|
||||||
}
|
}
|
||||||
|
}else{
|
||||||
|
$where[]=['cate_id','=',$cate_id];
|
||||||
|
|
||||||
}
|
}
|
||||||
if(!empty($order_param)){
|
if(!empty($order_param)){
|
||||||
@ -117,7 +118,6 @@ class ProductLists extends BaseAdminDataLists implements ListsSearchInterface
|
|||||||
}else{
|
}else{
|
||||||
$where[]=['store_id','=',2];
|
$where[]=['store_id','=',2];
|
||||||
}
|
}
|
||||||
|
|
||||||
$M_store_id=$this->request->__get('store_id');
|
$M_store_id=$this->request->__get('store_id');
|
||||||
if($M_store_id){
|
if($M_store_id){
|
||||||
$where[]=['store_id','=',$M_store_id];
|
$where[]=['store_id','=',$M_store_id];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user