瀏覽代碼

美团报错带上编号

shish 4 年之前
父節點
當前提交
371a7e36a7
共有 1 個文件被更改,包括 14 次插入14 次删除
  1. 14 14
      app-hd/controllers/MtController.php

+ 14 - 14
app-hd/controllers/MtController.php

@@ -31,12 +31,13 @@ class MtController extends PublicController
     {
         $post = Yii::$app->request->post();
         $mtOrderId = $post['order_id'] ?? 0;
+        $thirdSn = $post['day_seq'] ?? 0;
 
         //4秒内不允许第三方重复通知
         $cacheKey = 'mt_confirm_order_' . $mtOrderId;
         $has = Yii::$app->redis->executeCommand('GET', [$cacheKey]);
         if (!empty($has)) {
-            Yii::info("美团已确认订单通知,出现重复通知,orderId:{$mtOrderId}");
+            Yii::info("美团已确认订单通知,出现重复通知,美团订单id:{$mtOrderId} 美团编号:{$thirdSn}");
             return Json::encode(['data' => 'ok']);
         }
         Yii::$app->redis->executeCommand('SETEX', [$cacheKey, 4, 'has']);
@@ -54,24 +55,24 @@ class MtController extends PublicController
             $shopId = $post['app_poi_code'] ?? '';
             $shop = ShopClass::getById($shopId, true);
             if (empty($shop)) {
-                noticeUtil::push("美团确认订单报错,没有找到门店,美团订单id:{$mtOrderId}", '15280215347');
+                noticeUtil::push("美团确认订单报错,没有找到门店,美团订单id:{$mtOrderId} 美团编号:{$thirdSn}", '15280215347');
                 return Json::encode(['data' => 'ok']);
             }
             $shopExt = ShopExtClass::getByCondition(['shopId' => $shopId], true);
             if (empty($shopExt)) {
-                noticeUtil::push("美团确认订单报错,没有找到门店拓展信息,美团订单id:{$mtOrderId}", '15280215347');
+                noticeUtil::push("美团确认订单报错,没有找到门店拓展信息,美团订单id:{$mtOrderId} 美团编号:{$thirdSn}", '15280215347');
                 return Json::encode(['data' => 'ok']);
             }
             $mainId = $shop->mainId ?? 0;
             $sjId = $shop->sjId ?? 0;
             $customId = $shop->defaultCustomId ?? 0;
             if (empty($customId)) {
-                noticeUtil::push("美团确认订单报错,没有找到客户哦,美团订单id:{$mtOrderId}", '15280215347');
+                noticeUtil::push("美团确认订单报错,没有找到客户哦,美团订单id:{$mtOrderId} 美团编号:{$thirdSn}", '15280215347');
                 return Json::encode(['data' => 'ok']);
             }
             $custom = CustomClass::getById($customId);
             if (empty($custom)) {
-                noticeUtil::push("美团确认订单报错,没有找到客户,美团订单id:{$mtOrderId}", '15280215347');
+                noticeUtil::push("美团确认订单报错,没有找到客户,美团订单id:{$mtOrderId} 美团编号:{$thirdSn}", '15280215347');
                 return Json::encode(['data' => 'ok']);
             }
 
@@ -82,12 +83,12 @@ class MtController extends PublicController
 
             $detail = $post['detail'] ?? '';
             if (empty($detail)) {
-                noticeUtil::push("美团确认订单报错,没有找到商品,美团订单id:{$mtOrderId}", '15280215347');
+                noticeUtil::push("美团确认订单报错,没有找到商品,美团订单id:{$mtOrderId} 美团编号:{$thirdSn}", '15280215347');
                 return Json::encode(['data' => 'ok']);
             }
             $mtGoodsData = json_decode($detail, true);
             if (empty($mtGoodsData)) {
-                noticeUtil::push("美团确认订单报错,没有找到商品哦,美团订单id:{$mtOrderId}", '15280215347');
+                noticeUtil::push("美团确认订单报错,没有找到商品哦,美团订单id:{$mtOrderId} 美团编号:{$thirdSn}", '15280215347');
                 return Json::encode(['data' => 'ok']);
             }
 
@@ -101,7 +102,7 @@ class MtController extends PublicController
             }
             $catId = $mtCategory->id ?? 0;
             if (empty($catId)) {
-                noticeUtil::push("美团确认订单报错,美团默认分类没有找到,美团订单id:{$mtOrderId}", '15280215347');
+                noticeUtil::push("美团确认订单报错,美团默认分类没有找到,美团订单id:{$mtOrderId} 美团编号:{$thirdSn}", '15280215347');
                 return Json::encode(['data' => 'ok']);
             }
 
@@ -129,7 +130,7 @@ class MtController extends PublicController
                 $goodsNum = bcadd($num, $goodsNum);
                 $currentGoods = GoodsClass::getByCondition(['spu' => $mtGoodsSpu], true);
                 if (empty($currentGoods)) {
-                    noticeUtil::push("美团确认订单报错,数据库没有相应商品,美团订单id:{$mtOrderId}", '15280215347');
+                    noticeUtil::push("美团确认订单报错,数据库没有相应商品,美团订单id:{$mtOrderId} 美团编号:{$thirdSn}", '15280215347');
                     return Json::encode(['data' => 'ok']);
                 }
                 $id = $currentGoods->id ?? 0;
@@ -140,17 +141,17 @@ class MtController extends PublicController
             }
             $poi_receive_detail_yuan = $post['poi_receive_detail_yuan'] ?? '';
             if (empty($poi_receive_detail_yuan)) {
-                noticeUtil::push("美团确认订单报错,订单金额有问题,美团订单id:{$mtOrderId}", '15280215347');
+                noticeUtil::push("美团确认订单报错,订单金额有问题,美团订单id:{$mtOrderId} 美团编号:{$thirdSn}", '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:{$mtOrderId}", '15280215347');
+                noticeUtil::push("美团确认订单报错,订单金额有问题哦,美团订单id:{$mtOrderId} 美团编号:{$thirdSn}", '15280215347');
                 util::stop();
             }
             $onlinePayment = $poi_receive_detail_yuan_data['onlinePayment'] ?? 0;
             if ($onlinePayment == 0) {
-                noticeUtil::push("美团确认订单报错,订单金额有问题!美团订单id:{$mtOrderId}", '15280215347');
+                noticeUtil::push("美团确认订单报错,订单金额有问题!美团订单id:{$mtOrderId} 美团编号:{$thirdSn}", '15280215347');
                 util::stop();
             }
             $modifyPrice = $onlinePayment;
@@ -169,7 +170,6 @@ class MtController extends PublicController
             $labourCost = $post['package_bag_money_yuan'] ?? 0;
             //服务费和手续费
             $serviceFee = bcadd($foodShareFeeChargeByPoi, $performanceServiceFee, 2);
-            $thirdSn = $post['day_seq'] ?? 0;
 
             $estimate_arrival_time = $post['estimate_arrival_time'] ?? 0;
             $reachPeriod = date("H:i", $estimate_arrival_time);
@@ -211,7 +211,7 @@ class MtController extends PublicController
         } catch (\Exception $e) {
             $transaction->rollBack();
             $msg = $e->getMessage();
-            noticeUtil::push("确认订单报错了,错误信息:{$msg} 美团订单id:{$mtOrderId}", '15280215347');
+            noticeUtil::push("确认订单报错了,错误信息:{$msg} 美团订单id:{$mtOrderId} 美团编号:{$thirdSn}", '15280215347');
         }
     }