From 8bfe65cea9eec4b1f596d40c3b7479051f2c2906 Mon Sep 17 00:00:00 2001 From: lewis <604446095@qq.com> Date: Mon, 17 Mar 2025 11:00:45 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=95=86=E5=93=81=E6=94=B9?= =?UTF-8?q?=E4=BB=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BeforehandOrderCartInfoLogic.php | 2 +- .../PurchaseProductOfferLogic.php | 6 +++--- .../store_product_price/StoreProductPriceLogic.php | 14 ++++++++------ 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/app/admin/logic/beforehand_order_cart_info/BeforehandOrderCartInfoLogic.php b/app/admin/logic/beforehand_order_cart_info/BeforehandOrderCartInfoLogic.php index 83fece73..061bcbdb 100644 --- a/app/admin/logic/beforehand_order_cart_info/BeforehandOrderCartInfoLogic.php +++ b/app/admin/logic/beforehand_order_cart_info/BeforehandOrderCartInfoLogic.php @@ -459,7 +459,7 @@ class BeforehandOrderCartInfoLogic extends BaseLogic $product = StoreProduct::where('id', $purchaseProductOffer['product_id'])->withTrashed()->field('id,store_name,top_cate_id,two_cate_id,cate_id')->find(); if (!in_array($beforehandOrder['order_type'], [6, 9])) { - PurchaseProductOfferLogic::setProductGroupPrice($purchaseProductOffer, $product, $params['warehouse_id']); + PurchaseProductOfferLogic::setProductPrice($purchaseProductOffer, $product, $params['warehouse_id']); } Db::commit(); diff --git a/app/admin/logic/purchase_product_offer/PurchaseProductOfferLogic.php b/app/admin/logic/purchase_product_offer/PurchaseProductOfferLogic.php index e5f83859..c1f5a574 100644 --- a/app/admin/logic/purchase_product_offer/PurchaseProductOfferLogic.php +++ b/app/admin/logic/purchase_product_offer/PurchaseProductOfferLogic.php @@ -324,7 +324,7 @@ class PurchaseProductOfferLogic extends BaseLogic BeforehandOrder::where('id', $offer['bhoid'])->update(['pay_price' => $pay_price]); $product = StoreProduct::where('id', $offer['product_id'])->withTrashed()->field('id,store_name,top_cate_id,two_cate_id,cate_id')->find(); $offer['purchase']=$price; - self::setProductGroupPrice($offer, $product); + self::setProductPrice($offer, $product); Db::commit(); return true; } catch (\Throwable $e) { @@ -380,7 +380,7 @@ class PurchaseProductOfferLogic extends BaseLogic } /** - * 设置商品分组价格 + * 设置商品价格 * @param $params * @param $product * @return void @@ -388,7 +388,7 @@ class PurchaseProductOfferLogic extends BaseLogic * @throws \think\db\exception\DbException * @throws \think\db\exception\ModelNotFoundException */ - public static function setProductGroupPrice($params, $product, $warehouseId = 0) + public static function setProductPrice($params, $product, $warehouseId = 0) { $priceConfig = []; $data = [ diff --git a/app/admin/logic/store_product_price/StoreProductPriceLogic.php b/app/admin/logic/store_product_price/StoreProductPriceLogic.php index e3d850d0..6d54fedc 100644 --- a/app/admin/logic/store_product_price/StoreProductPriceLogic.php +++ b/app/admin/logic/store_product_price/StoreProductPriceLogic.php @@ -99,15 +99,16 @@ class StoreProductPriceLogic extends BaseLogic 'purchase' => $find['purchase'], 'cost' => $find['cost'], 'vip_price' => $find['vip_price'], - 'price' => $find['price'] + 'price' => $find['vip_price'], + 'ot_price' => $find['price'] ]); StoreBranchProduct::where('product_id', $find['product_id'])->update([ 'purchase' => $find['purchase'], 'cost' => $find['cost'], 'vip_price' => $find['vip_price'], - 'price' => $find['price'] + 'price' => $find['vip_price'], + 'ot_price' => $find['price'] ]); -// self::setProductGroupPrice($find); } Db::commit(); return true; @@ -172,15 +173,16 @@ class StoreProductPriceLogic extends BaseLogic 'purchase' => $find['purchase'] ?? 0, 'cost' => $find['cost'] ?? 0, 'vip_price' => $find['vip_price'] ?? 0, - 'price' => $find['price'] ?? 0 + 'price' => $find['vip_price'] ?? 0, + 'ot_price' => $find['price'] ?? 0, ]); StoreBranchProduct::where('product_id', $find['product_id'])->update([ 'purchase' => $find['purchase'] ?? 0, 'cost' => $find['cost'] ?? 0, 'vip_price' => $find['vip_price'] ?? 0, - 'price' => $find['price'] ?? 0 + 'price' => $find['vip_price'] ?? 0, + 'ot_price' => $find['price'] ?? 0, ]); -// self::setProductGroupPrice($find); } Db::commit(); return true;