Browse Source

fix bug: 计算运费的价格参数没选正确

shizhongqi 7 months ago
parent
commit
36c02c9135

+ 0 - 1
app-hd/controllers/PurchaseController.php

@@ -15,7 +15,6 @@ use bizHd\purchase\services\PurchaseService;
 use bizGhs\product\classes\ProductClass;
 use bizHd\wx\classes\WxOpenClass;
 use common\components\dateUtil;
-use common\components\delivery\services\DispatchService;
 use common\components\delivery\util\DeliveryQuoteUtil;
 use common\components\dict;
 use common\components\imgUtil;

+ 4 - 4
app-mall/controllers/OrderController.php

@@ -388,7 +388,6 @@ class OrderController extends BaseController
 
                 // 这儿要调用跑腿接口计算运费和距离
                 try {
-
                     if (empty($post['deliveryPlatform'])) {
                         util::fail('请选择跑腿');
                     }
@@ -402,7 +401,7 @@ class OrderController extends BaseController
                         'order' => [
                             'orderSn' => $orderSn,
                             'goodsType' => 1, //商品类型:0花束 1花材
-                            'itemTotalAmount' => $totalNum,
+                            'itemTotalAmount' => $modifyPrice,
                             'remark' => $post['remark'] ?? '',
                         ],
                         'mainId' => $this->mainId,
@@ -417,7 +416,7 @@ class OrderController extends BaseController
 
                 $post['sendCost'] = $sendCost;
                 $post['sendDistance'] = $distance;
-                noticeUtil::push("零售订单,获取运费:{$sendCost} 重量:{$totalWeight} 距离:{$distance}m 姓名:{$customName} 手机号 {$customMobile} 经纬 {$originalLng} {$originalLat} 金额:{$modifyPrice} 数量:{$totalNum}", '15280215347');
+                noticeUtil::push("零售订单(花材),获取运费:{$sendCost} 重量:{$totalWeight} 距离:{$distance}m 姓名:{$customName} 手机号 {$customMobile}  金额:{$modifyPrice} 数量:{$totalNum}", '15280215347');
                 $modifyPrice = bcadd($modifyPrice, $sendCost, 2);
             }
 
@@ -679,7 +678,7 @@ class OrderController extends BaseController
                         'order' => [
                             'orderSn' => $orderSn,
                             'goodsType' => 0, //商品类型:0花束 1花材
-                            'itemTotalAmount' => $post['itemTotalAmount'] ?? 0,
+                            'itemTotalAmount' => $goodsPrice,
                             'remark' => $post['remark'] ?? '',
                             'freightType' => $goodsInfo->freightType,
                         ],
@@ -689,6 +688,7 @@ class OrderController extends BaseController
 
                     $sendCost = $quoteResult['sendCost'];
                     $sendDistance = $quoteResult['sendDistance'];
+                    noticeUtil::push("零售订单(花束),获取运费:{$sendCost} 重量:{$goodsInfo->weight} 距离:{$sendDistance}m 姓名:{$customName}  金额:{$goodsPrice} 数量:{$goodsNum}");
                 } catch (\Exception $e) {
                     util::fail($e->getMessage());
                 }