From 850f361b63a812b2f7ea321dce6ee2c1c9de7387 Mon Sep 17 00:00:00 2001 From: "DESKTOP-GMUNQ1B\\Administrator" <604446095@qq.com> Date: Wed, 4 Dec 2024 17:30:49 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=95=86=E5=93=81=E5=88=86?= =?UTF-8?q?=E7=BB=84=E6=8A=A5=E4=BB=B7=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../StoreProductGroupPriceLists.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) 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