|
@@ -154,6 +154,8 @@ class GoodsService
|
|
$goodsName = $request->get('goods_name', '');
|
|
$goodsName = $request->get('goods_name', '');
|
|
$categoryId = $request->get('join_goods_category_id', null);
|
|
$categoryId = $request->get('join_goods_category_id', null);
|
|
$goodsCategory = $request->get('goods_category', null);
|
|
$goodsCategory = $request->get('goods_category', null);
|
|
|
|
+ $goodsSupplierId = $request->get('join_goods_supplier_id', null);
|
|
|
|
+ $goodsStatus = $request->get('goods_status', null);
|
|
$type = $request->get('type','');
|
|
$type = $request->get('type','');
|
|
if ($categoryId != null) {
|
|
if ($categoryId != null) {
|
|
$categoryPath = SysCategory::where('category_id', $categoryId)->value('category_super_path');
|
|
$categoryPath = SysCategory::where('category_id', $categoryId)->value('category_super_path');
|
|
@@ -202,6 +204,10 @@ class GoodsService
|
|
if ($type == 'storageWarning'){
|
|
if ($type == 'storageWarning'){
|
|
$query->where('goods_running.goods_running_storage','<=',2);
|
|
$query->where('goods_running.goods_running_storage','<=',2);
|
|
}
|
|
}
|
|
|
|
+ })->when(!empty($goodsSupplierId),function($query) use ($goodsSupplierId){
|
|
|
|
+ $query->where('join_goods_supplier_id', $goodsSupplierId);
|
|
|
|
+ })->when(!empty($goodsStatus),function($query) use ($goodsStatus){
|
|
|
|
+ $query->where('goods_status', $goodsStatus);
|
|
})
|
|
})
|
|
->orderBy('goods_sort', 'DESC')
|
|
->orderBy('goods_sort', 'DESC')
|
|
->orderBy('goods_addtimes', 'DESC')
|
|
->orderBy('goods_addtimes', 'DESC')
|