diff --git a/app/admin/lists/store_product/StoreProductLists.php b/app/admin/lists/store_product/StoreProductLists.php index 062022027..05f5972aa 100644 --- a/app/admin/lists/store_product/StoreProductLists.php +++ b/app/admin/lists/store_product/StoreProductLists.php @@ -71,7 +71,9 @@ class StoreProductLists extends BaseAdminDataLists implements ListsSearchInterfa $query = StoreProduct::where($this->searchWhere); if (isset($this->params['type_filter'])) { if ($this->params['type_filter'] == 0) { - $query->where('product_type', 6)->where('is_show', 0); + $query->where(function ($query) { + $query->where('product_type', 6)->whereOr('is_show', 0); + }); } else { $query->where('is_show', 1); } @@ -156,7 +158,17 @@ class StoreProductLists extends BaseAdminDataLists implements ListsSearchInterfa } } } - return StoreProduct::where($this->searchWhere)->count(); + $query = StoreProduct::where($this->searchWhere); + if (isset($this->params['type_filter'])) { + if ($this->params['type_filter'] == 0) { + $query->where(function ($query) { + $query->where('product_type', 6)->whereOr('is_show', 0); + }); + } else { + $query->where('is_show', 1); + } + } + return $query->count(); } /**