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/beforehand_order_cart_info/BeforehandOrderCartInfoLogic.php b/app/admin/logic/beforehand_order_cart_info/BeforehandOrderCartInfoLogic.php index 89580cb29..79616754a 100644 --- a/app/admin/logic/beforehand_order_cart_info/BeforehandOrderCartInfoLogic.php +++ b/app/admin/logic/beforehand_order_cart_info/BeforehandOrderCartInfoLogic.php @@ -413,9 +413,7 @@ class BeforehandOrderCartInfoLogic extends BaseLogic if (!$offerResult) { throw new BusinessException('入库失败,采购信息更新出错'); } - $putInCount = PurchaseProductOffer::where('order_id', $purchaseProductOffer['order_id'])->where('is_storage', 1)->count(); - $offerCount = PurchaseProductOffer::where('order_id', $purchaseProductOffer['order_id'])->count(); - if ($putInCount == $offerCount) { + if ($beforehandOrder['is_warehousing'] == 0) { $attrs = ['warehousing_id' => $warehouseOrder['id'], 'is_warehousing' => 1]; if ($beforehandOrder['order_type'] == 7) { $attrs['is_buying'] = 1; 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()); }