From 17cc47ffc9bc68d1b2748b9949c50dc91cb638f4 Mon Sep 17 00:00:00 2001 From: lewis <604446095@qq.com> Date: Thu, 23 Jan 2025 15:26:14 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=A2=84=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=E5=BD=95=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/lists/store_product/StoreProductLists.php | 6 +++--- app/admin/logic/store_product/StoreProductLogic.php | 2 +- .../StoreProductGroupPrice.php | 8 ++++---- app/store/controller/ConfigController.php | 10 ++++++++++ .../beforehand_order/BeforehandOrderController.php | 4 ++++ .../store_product/StoreProductController.php | 3 +++ 6 files changed, 25 insertions(+), 8 deletions(-) diff --git a/app/admin/lists/store_product/StoreProductLists.php b/app/admin/lists/store_product/StoreProductLists.php index c864e6e15..26c664a0b 100644 --- a/app/admin/lists/store_product/StoreProductLists.php +++ b/app/admin/lists/store_product/StoreProductLists.php @@ -154,9 +154,9 @@ class StoreProductLists extends BaseAdminDataLists implements ListsSearchInterfa return $item; })?->toArray(); - // if ($userShip > 0 && $userShip != 4) { - // $list = StoreProductGroupPrice::resetProductsPrice($list, $userShip); - // } + if ($userShip > 0 && $userShip != 4) { + $list = StoreProductGroupPrice::resetStoreProductsPrice($list, $userShip, $this->params['store_id'] ?? 0); + } return $list; } diff --git a/app/admin/logic/store_product/StoreProductLogic.php b/app/admin/logic/store_product/StoreProductLogic.php index bdb51a290..e734e5ed6 100644 --- a/app/admin/logic/store_product/StoreProductLogic.php +++ b/app/admin/logic/store_product/StoreProductLogic.php @@ -330,7 +330,7 @@ class StoreProductLogic extends BaseLogic if ($userShip == 4) { $data['price'] = $data['cost']; } else { - $data = StoreProductGroupPrice::resetProductPrice($data, $userShip); + $data = StoreProductGroupPrice::resetStoreProductPrice($data, $userShip, $params['store_id'] ?? 0); } } if($data['is_show']==1){ diff --git a/app/common/model/store_product_group_price/StoreProductGroupPrice.php b/app/common/model/store_product_group_price/StoreProductGroupPrice.php index 5b5e1e524..375817deb 100644 --- a/app/common/model/store_product_group_price/StoreProductGroupPrice.php +++ b/app/common/model/store_product_group_price/StoreProductGroupPrice.php @@ -42,9 +42,9 @@ class StoreProductGroupPrice extends BaseModel return $product; } - public static function resetStoreProductsPrice($productList, $userShip, $shopId) + public static function resetStoreProductsPrice($productList, $userShip, $storeId) { - if ($shopId > 0 && SystemStore::isSelfOperate($shopId) && $userShip > 0) { + if ($storeId > 0 && SystemStore::isSelfOperate($storeId) && $userShip > 0) { foreach ($productList as &$item) { $item['price'] = $item['vip_price'] > 0 ? $item['vip_price'] : $item['price']; } @@ -54,9 +54,9 @@ class StoreProductGroupPrice extends BaseModel } } - public static function resetStoreProductPrice($product, $userShip, $shopId) + public static function resetStoreProductPrice($product, $userShip, $storeId) { - if ($shopId > 0 && SystemStore::isSelfOperate($shopId) && $userShip > 0) { + if ($storeId > 0 && SystemStore::isSelfOperate($storeId) && $userShip > 0) { $product['price'] = $product['vip_price'] > 0 ? $product['vip_price'] : $product['price']; return $product; } else { diff --git a/app/store/controller/ConfigController.php b/app/store/controller/ConfigController.php index a8220b243..f84634091 100644 --- a/app/store/controller/ConfigController.php +++ b/app/store/controller/ConfigController.php @@ -150,4 +150,14 @@ class ConfigController extends BaseAdminController return $this->success('ok', $list); } + /** + * @notes 根据类型获取字典数据 + */ + public function dict() + { + $type = $this->request->get('type', ''); + $data = ConfigLogic::getDictByType($type); + return $this->data($data); + } + } diff --git a/app/store/controller/beforehand_order/BeforehandOrderController.php b/app/store/controller/beforehand_order/BeforehandOrderController.php index 9d39c2276..c35a3b140 100644 --- a/app/store/controller/beforehand_order/BeforehandOrderController.php +++ b/app/store/controller/beforehand_order/BeforehandOrderController.php @@ -315,12 +315,16 @@ class BeforehandOrderController extends BaseAdminController public function productLists() { + $params = $this->request->get(); + $params['store_id'] = $this->request->adminInfo['store_id'] ?? 0; + $this->request->setGet($params); return $this->dataLists(new StoreProductLists()); } public function productDetail() { $params = (new StoreProductValidate())->goCheck('detail'); + $params['store_id'] = $this->request->adminInfo['store_id'] ?? 0; $result = StoreProductLogic::detail($params); return $this->data($result); } diff --git a/app/store/controller/store_product/StoreProductController.php b/app/store/controller/store_product/StoreProductController.php index 1372813d0..74dc53c3f 100644 --- a/app/store/controller/store_product/StoreProductController.php +++ b/app/store/controller/store_product/StoreProductController.php @@ -146,6 +146,9 @@ class StoreProductController extends BaseAdminController */ public function adminLists() { + $params = $this->request->get(); + $params['store_id'] = $this->request->adminInfo['store_id'] ?? 0; + $this->request->setGet($params); return $this->dataLists(new StoreProductLists()); }