修改后台商品查询的缺失代码

This commit is contained in:
liu 2024-06-27 10:32:49 +08:00
parent a40041e2df
commit c644ff5a62

View File

@ -61,7 +61,9 @@ class StoreBranchProductLists extends BaseAdminDataLists implements ListsSearchI
//2或者1
$where[]=['cate_id','=',$class_all];
}
$this->searchWhere[]=$where;
if($where){
$this->searchWhere[]=$where;
}
return StoreBranchProduct::where($this->searchWhere)
->field(['id','store_id','product_id', 'image', 'store_name', 'cate_id', 'price', 'sales', 'stock', 'unit', 'cost','purchase', 'status','batch','vip_price','manufacturer_information'])
->when(!empty($this->adminInfo['store_id']), function ($query) {
@ -99,6 +101,7 @@ class StoreBranchProductLists extends BaseAdminDataLists implements ListsSearchI
*/
public function count(): int
{
$status = $this->params['status'] ?? '';
return StoreBranchProduct::where($this->searchWhere)
->when(!empty($this->adminInfo['store_id']), function ($query) {
$query->where('store_id', $this->adminInfo['store_id']);