|
@@ -178,10 +178,10 @@ class GoodsService
|
|
|
})->when($goodsCategory != null, function ($query) use ($goodsCategory) {
|
|
|
$query->where('goods_category', $goodsCategory);
|
|
|
})
|
|
|
- ->when($classify != '', function ($query) use ($classify) {
|
|
|
- if ($classify == 'GOODS') {
|
|
|
+ ->when($classify != '', function ($query) use ($classify,$categoryId) {
|
|
|
+ if ($classify == 'GOODS' && empty($categoryId)) {
|
|
|
$query->whereIn('join_goods_category_id', ['6', '7', '8', '9', '10', '11', '12', '30']);
|
|
|
- } else {
|
|
|
+ } else if($classify != 'GOODS') {
|
|
|
$query->where('goods_classify', $classify);
|
|
|
}
|
|
|
})
|
|
@@ -200,10 +200,10 @@ class GoodsService
|
|
|
$query->whereIn('join_goods_category_id', $categoryId);
|
|
|
})->when($goodsCategory != null, function ($query) use ($goodsCategory) {
|
|
|
$query->where('goods_category', $goodsCategory);
|
|
|
- })->when($classify != '', function ($query) use ($classify) {
|
|
|
- if ($classify == 'GOODS') {
|
|
|
+ })->when($classify != '', function ($query) use ($classify,$categoryId) {
|
|
|
+ if ($classify == 'GOODS' && empty($categoryId)) {
|
|
|
$query->whereIn('join_goods_category_id', ['6', '7', '8', '9', '10', '11', '12', '30']);
|
|
|
- } else {
|
|
|
+ } else if($classify != 'GOODS') {
|
|
|
$query->where('goods_classify', $classify);
|
|
|
}
|
|
|
})
|