소스 검색

美团确认订单

shish 4 년 전
부모
커밋
bc809c1ed6
1개의 변경된 파일25개의 추가작업 그리고 2개의 파일을 삭제
  1. 25 2
      app-hd/controllers/MtController.php

+ 25 - 2
app-hd/controllers/MtController.php

@@ -166,13 +166,36 @@ class MtController extends PublicController
                 }
                 $productList = array_merge($goods, $productList);
             }
+            $poi_receive_detail_yuan = $data['poi_receive_detail_yuan'] ?? '';
+            if (empty($poi_receive_detail_yuan)) {
+                noticeUtil::push("美团确认订单报错,订单金额有问题,美团订单id:{$orderId}", '15280215347');
+                util::stop();
+            }
+            $poi_receive_detail_yuan_data = json_decode($poi_receive_detail_yuan, true);
+            if (is_array($poi_receive_detail_yuan_data) == false) {
+                noticeUtil::push("美团确认订单报错,订单金额有问题哦,美团订单id:{$orderId}", '15280215347');
+                util::stop();
+            }
+            $onlinePayment = $poi_receive_detail_yuan_data['onlinePayment'] ?? 0;
+            if ($onlinePayment == 0) {
+                noticeUtil::push("美团确认订单报错,订单金额有问题!美团订单id:{$orderId}", '15280215347');
+                util::stop();
+            }
+
+            //运费
             $sendCost = $data['shipping_fee'] ?? 0;
-            $modifyPrice = $data[''];
+            //打包费
+            $labourCost = $data['package_bag_money_yuan'] ?? 0;
+            $modifyPrice = $onlinePayment;
             $orderData = [
                 'product' => $productList,
                 'fromType' => dict::getDict('fromType', 'mt'),
+                'labourCost' => $labourCost,
+                'sendCost' => $sendCost,
+                'shopId' => $shopId,
+                'mainId' => $mainId,
+                'sjId' => $sjId,
             ];
-
             $hasPay = dict::getDict('hasPay', 'payed');
             OrderService::createFinishOrder($orderData, $custom, $hasPay);
             $transaction->commit();