diff --git a/app/admin/lists/store_product/StoreProductLists.php b/app/admin/lists/store_product/StoreProductLists.php index c864e6e1..26c664a0 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 bdb51a29..e734e5ed 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 5b5e1e52..375817de 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 a8220b24..f8463409 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 9d39c227..c35a3b14 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 1372813d..74dc53c3 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()); }