Эх сурвалжийг харах

后端开单涉及,花材满减

shish 4 сар өмнө
parent
commit
fa3db2f1a8

+ 5 - 1
app-ghs/controllers/OrderController.php

@@ -1261,6 +1261,9 @@ class OrderController extends BaseController
                 }
             }
 
+            //后端开单,涉及花材满减,关键词 back_order_reach_discount_price
+            $post['reachDiscountPrice'] = 0;
+
             if (floatval($currentPrice) != floatval($systemPrice)) {
                 $diff[] = [
                     'name' => $name,
@@ -1268,7 +1271,7 @@ class OrderController extends BaseController
                     'kdPrice' => $currentPrice,
                 ];
             } else {
-                //后端开单,如果没有改价格,并且数量达到花材满减要求,则自动给减价格
+                //后端开单,如果没有改价格,并且数量达到花材满减要求,则自动给减价格,关键词 back_order_reach_discount_price
                 $bigNum = $currentProduct['bigNum'] ?? 0;
                 $reachNum = $systemInfo['reachNum'] ?? 0;
                 if ($reachNum > 0 && $bigNum >= $reachNum) {
@@ -1281,6 +1284,7 @@ class OrderController extends BaseController
                         if ($calcPrice > 0 && isset($post['modifyPrice']) && $post['modifyPrice'] > $calcPrice) {
                             //提交给后端的总金额也要减掉,否则会有问题
                             $post['modifyPrice'] = bcsub($post['modifyPrice'], $calcPrice, 2);
+                            $post['reachDiscountPrice'] = bcadd($post['reachDiscountPrice'], $calcPrice, 2);
                         }
                     }
                 }

+ 3 - 0
biz-ghs/order/services/OrderService.php

@@ -223,6 +223,8 @@ class OrderService extends BaseService
         $remark = $data['remark'] ?? '';
         $xj = $data['xj'] ?? '';
         $book = $data['book'] ?? 0;
+		//后端开单,涉及花材满减,关键词 back_order_reach_discount_price
+        $reachDiscountPrice = $data['reachDiscountPrice'] ?? 0;
         $wlName = $data['wlName'] ?? '';
         $cgMainId = $ghs['ownMainId'] ?? 0;
         $purchaseData = [
@@ -255,6 +257,7 @@ class OrderService extends BaseService
             'wlName' => $wlName,
             'localOrder' => $localOrder,
             'transType' => $transType,
+            'reachDiscountPrice' => $reachDiscountPrice,
         ];
         if (isset($data['deadline']) && !empty($data['deadline'])) {
             $purchaseData['deadline'] = $data['deadline'];