Commit 3764f365 authored by 刘小敏's avatar 刘小敏

生成订单时增加成本价到order_item表

parent 9b164bb3
......@@ -1289,6 +1289,7 @@ class OrderCreate
$orderItem->goods_price = $current_sku_price->price;
$orderItem->goods_num = $buyInfo['goods_num'] ?? 1;
$orderItem->goods_weight = $current_sku_price->weight;
$orderItem->cost_price = isset($current_sku_price['cost_price']) ? $current_sku_price['cost_price'] : 0;
$orderItem->discount_fee = bcadd(bcadd($buyInfo['promo_discount_fee'], $buyInfo['coupon_discount_fee'], 2), $buyInfo['dispatch_discount_fee'], 2); // 当前商品所享受的折扣 (promo_discount_fee + coupon_discount_fee + dispatch_discount_fee)
$pay_fee = bcsub($buyInfo['goods_amount'], bcadd($buyInfo['promo_discount_fee'], $buyInfo['coupon_discount_fee'], 2), 2); // 商品总金额(不算运费),减去(活动优惠(不包含包邮优惠) + 优惠券优惠)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment