|
@@ -108,6 +108,7 @@ class OrderCreate
|
|
|
'goods_old_amount' => '0',
|
|
|
'goods_amount' => '0',
|
|
|
'goods_bean_amount' => '0',
|
|
|
+ 'goods_back_amount' => '0',
|
|
|
'coupon_discount_fee' => '0',
|
|
|
'promo_discount_fee' => 0,
|
|
|
'total_discount_fee' => 0,
|
|
@@ -322,6 +323,12 @@ class OrderCreate
|
|
|
$current_goods_bean_amount = bcdiv(bcmul($current_goods_amount,$bean_rate,2),100,2);
|
|
|
$this->orderData['goods_bean_amount'] = bcadd($this->orderData['goods_bean_amount'],$current_goods_bean_amount,2);
|
|
|
|
|
|
+
|
|
|
+ $back_rate = floatval($goods->back_rate) > 0 ? $goods->back_rate : 0;
|
|
|
+
|
|
|
+ $current_goods_back_amount = bcdiv(bcmul($current_goods_amount,$back_rate,2),100,2);
|
|
|
+ $this->orderData['goods_back_amount'] = bcadd($this->orderData['goods_back_amount'],$current_goods_back_amount,2);
|
|
|
+
|
|
|
|
|
|
$current_goods_old_amount = $current_goods_amount;
|
|
|
if ($this->activity['activity']) {
|
|
@@ -344,6 +351,7 @@ class OrderCreate
|
|
|
$buyInfo['goods_original_amount'] = $current_goods_original_amount;
|
|
|
$buyInfo['goods_amount'] = $current_goods_amount;
|
|
|
$buyInfo['goods_bean_amount'] = $current_goods_bean_amount;
|
|
|
+ $buyInfo['goods_back_amount'] = $current_goods_back_amount;
|
|
|
$buyInfo['score_amount'] = $current_score_amount;
|
|
|
$buyInfo['weight'] = $current_weight;
|
|
|
$buyInfo['original_dispatch_amount'] = 0;
|
|
@@ -987,6 +995,7 @@ class OrderCreate
|
|
|
'goods_amount' => $this->orderData['goods_amount'],
|
|
|
|
|
|
'goods_bean_amount' => $this->orderData['goods_bean_amount'],
|
|
|
+ 'goods_back_amount' => $this->orderData['goods_back_amount'],
|
|
|
'user_bean_amount' => $user_bean,
|
|
|
'min_bean_amount' => config('site.shopro_min_bean_amount'),
|
|
|
|
|
@@ -1130,6 +1139,7 @@ class OrderCreate
|
|
|
$orderData['goods_original_amount'] = $result['goods_original_amount'];
|
|
|
$orderData['goods_amount'] = $result['goods_amount'];
|
|
|
$orderData['goods_bean_amount'] = $result['goods_bean_amount'];
|
|
|
+ $orderData['goods_back_amount'] = $result['goods_back_amount'];
|
|
|
$orderData['dispatch_amount'] = $result['dispatch_amount'];
|
|
|
$orderData['remark'] = $this->remark;
|
|
|
$orderData['order_amount'] = $result['order_amount'];
|
|
@@ -1220,6 +1230,7 @@ class OrderCreate
|
|
|
|
|
|
foreach ($result['goods_list'] as $key => $buyInfo) {
|
|
|
$goods = $buyInfo['goods'];
|
|
|
+
|
|
|
$current_sku_price = $buyInfo['current_sku_price'];
|
|
|
|
|
|
$orderItem = new OrderItem();
|
|
@@ -1254,6 +1265,9 @@ class OrderCreate
|
|
|
$orderItem->comment_status = 0;
|
|
|
$orderItem->refund_status = 0;
|
|
|
|
|
|
+ $orderItem->back_rate = floatval($goods->back_rate) > 0 ? $goods->back_rate : 0;
|
|
|
+ $orderItem->goods_back_amount = $buyInfo['goods_back_amount'];
|
|
|
+
|
|
|
$orderItem->room_id = $orderData['room_id'];
|
|
|
$orderItem->room_log_id = $orderData['room_log_id'];
|
|
|
|
|
@@ -1276,6 +1290,7 @@ class OrderCreate
|
|
|
'goods_image' => $orderItem->goods_image,
|
|
|
'goods_price' => $orderItem->goods_price,
|
|
|
'goods_num' => $orderItem->goods_num,
|
|
|
+ 'goods_sku_text' => $orderItem->goods_sku_text,
|
|
|
];
|
|
|
|
|
|
$orderItem->ext = $ext;
|
|
@@ -1303,7 +1318,6 @@ class OrderCreate
|
|
|
|
|
|
$num_sum = array_sum(array_column($bill_args,'goods_num'));
|
|
|
|
|
|
- $shopro_back_rate = config('site.shopro_back_rate');
|
|
|
$bill = [
|
|
|
'user_id' => $orderData['user_id'],
|
|
|
'order_no' => $orderData['order_sn'],
|
|
@@ -1316,8 +1330,8 @@ class OrderCreate
|
|
|
'shop_logo' => '',
|
|
|
'args' => json_encode($bill_args,JSON_UNESCAPED_UNICODE),
|
|
|
'total_amount' => $orderData['order_amount'],
|
|
|
- 'back_rate' => $shopro_back_rate,
|
|
|
- 'back_amount' => bcdiv(bcmul($orderData['order_amount'],$shopro_back_rate,4),100,2),
|
|
|
+
|
|
|
+ 'back_amount' => $orderData['goods_back_amount'],
|
|
|
'createtime' => time(),
|
|
|
];
|
|
|
|