|
@@ -156,11 +156,11 @@ class GoodsService
|
|
|
$categoryPath = SysCategory::where('category_id', $categoryId)->value('category_super_path');
|
|
|
$categoryPath .= '#' . $categoryId . '#';
|
|
|
$categoryIds = SysCategory::where('category_super_path', 'like', $categoryPath . '%')->pluck('category_id')->toArray();
|
|
|
- $categoryIds[] = $categoryId;
|
|
|
+ $categoryIds[] = intval($categoryId);
|
|
|
if (!empty($categoryIds)) {
|
|
|
$categoryId = $categoryIds;
|
|
|
} else {
|
|
|
- $categoryId = [$categoryId];
|
|
|
+ $categoryId = [intval($categoryId)];
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -191,7 +191,7 @@ class GoodsService
|
|
|
->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 if($classify != 'GOODS') {
|
|
|
+ } else if($classify != 'GOODS' && empty($categoryId)) {
|
|
|
$query->where('goods_classify', $classify);
|
|
|
}
|
|
|
})
|
|
@@ -213,7 +213,7 @@ class GoodsService
|
|
|
})->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 if($classify != 'GOODS') {
|
|
|
+ } else if($classify != 'GOODS' && empty($categoryId)) {
|
|
|
$query->where('goods_classify', $classify);
|
|
|
}
|
|
|
})
|