feat(admin): 仓库产品列表增加分类搜索功能

- 添加了根据分类 ID 进行搜索的功能
- 如果请求中包含 'class_all' 参数,则在查询中加入相应的条件
- 通过 StoreProduct 模型获取符合条件的产品 ID 列表
- 如果没有符合条件的产品,则返回空数组
This commit is contained in:
mkm 2025-04-18 13:47:42 +08:00
parent bb039fcf5e
commit 3976af97f1

View File

@ -88,6 +88,16 @@ class WarehouseProductStoregeLists extends BaseAdminDataLists implements ListsSe
return [];
}
}
if($this->request->get('class_all')){
$where[] = ['top_cate_id', 'in', $this->request->get('class_all')];
}
$ids = StoreProduct::where($where)->column('id');
if ($ids) {
$this->searchWhere[] = ['product_id', 'in', $ids];
$this->ids = $ids;
} else {
return [];
}
return WarehouseProductStorege::where($this->searchWhere)
->field(['id','is_verify','warehouse_id', 'product_id', 'nums', 'price', 'total_price', 'status'])
->limit($this->limitOffset, $this->limitLength)