|
@@ -20,14 +20,13 @@ class GoodsService
|
|
|
**/
|
|
|
public static function get_list($category_id, $search)
|
|
|
{
|
|
|
- if (!$category_id || !!empty($search)) {
|
|
|
+ if (!$category_id && empty($search)) {
|
|
|
return [];
|
|
|
}
|
|
|
|
|
|
$list = Goods::field('status,is_deleted,create_at', true)
|
|
|
->where('status', CommonConstant::IS_WHO_1)
|
|
|
->where('is_deleted', CommonConstant::IS_DELETED_0)
|
|
|
- ->where('goods_category_id', $category_id)
|
|
|
->when($category_id > 0, function ($query) use ($category_id) {
|
|
|
$query->where('goods_category_id', $category_id);
|
|
|
})
|