修改商品改价

This commit is contained in:
lewis 2025-03-17 11:00:45 +08:00
parent a8acf3ae67
commit 8bfe65cea9
3 changed files with 12 additions and 10 deletions

View File

@ -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();

View File

@ -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 = [

View File

@ -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;