diff --git a/app/admin/lists/store_product_group_price/StoreProductGroupPriceLists.php b/app/admin/lists/store_product_group_price/StoreProductGroupPriceLists.php index db95f69cf..f8c56c0ce 100644 --- a/app/admin/lists/store_product_group_price/StoreProductGroupPriceLists.php +++ b/app/admin/lists/store_product_group_price/StoreProductGroupPriceLists.php @@ -43,7 +43,11 @@ class StoreProductGroupPriceLists extends BaseAdminDataLists implements ListsSea */ public function lists(): array { - return StoreProduct::where($this->searchWhere)->limit($this->limitOffset, $this->limitLength) + $query = StoreProduct::field('id,store_name,purchase,cost,vip_price,price,unit'); + if ($this->params['product_id']) { + $query->where('id|store_name', $this->params['product_id']); + } + return $query->limit($this->limitOffset, $this->limitLength) ->field('id,store_name,purchase,cost,vip_price,price,unit') ->order(['id' => 'desc']) ->select()->each(function ($item) { @@ -64,7 +68,11 @@ class StoreProductGroupPriceLists extends BaseAdminDataLists implements ListsSea */ public function count(): int { - return StoreProduct::where($this->searchWhere)->count(); + $query = StoreProduct::field('id,store_name,purchase,cost,vip_price,price,unit'); + if ($this->params['product_id']) { + $query->where('id|store_name', $this->params['product_id']); + } + return $query->count(); } } \ No newline at end of file