Ver código fonte

结帐优化

shish 2 meses atrás
pai
commit
1d7fcbe1b1

+ 6 - 4
app-hd/controllers/NoticeController.php

@@ -222,7 +222,7 @@ class NoticeController extends PublicController
 
                                 if (getenv('YII_ENV') == 'production') {
                                     //福州我要花、花路鲜花批发、小齐鲜花、花镜打二次小票,有多处要修改搜索关键词tow_print
-                                    $needTwoPrint = [7538, 36707,76796];
+                                    $needTwoPrint = [7538, 36707, 76796];
                                 } else {
                                     $needTwoPrint = [644];
                                 }
@@ -310,11 +310,11 @@ class NoticeController extends PublicController
             noticeUtil::push('支付回调失败了,没有找到capitalType,orderSn:' . $orderSn . ' remark:' . $remarkString, '15280215347');
             util::end();
         }
+        $currentPayWay = null;
 
         $connection = Yii::$app->db;
         $transaction = $connection->beginTransaction();
         try {
-            $currentPayWay = null;
             if ($account_type == 'WECHAT') {
                 $currentPayWay = dict::getDict('payWay', 'wxPay');
             } elseif ($account_type == 'ALIPAY') {
@@ -443,7 +443,7 @@ class NoticeController extends PublicController
 
                                 if (getenv('YII_ENV') == 'production') {
                                     //福州我要花、花路鲜花批发、花镜打二次小票,有多处要修改搜索关键词tow_print
-                                    $needTwoPrint = [7538, 36707,76796];
+                                    $needTwoPrint = [7538, 36707, 76796];
                                 } else {
                                     $needTwoPrint = [];
                                 }
@@ -508,7 +508,9 @@ class NoticeController extends PublicController
             exit();
         } catch (\Exception $e) {
             $transaction->rollBack();
-            Yii::error("失败原因:" . $e->getMessage());
+            $msg = $e->getMessage();
+            noticeUtil::push(" PayCallback 报错了 " . $currentPayWay . " capitalType:" . $capitalType . " orderSn:" . $orderSn . " totalFee:" . $totalFee . " 第三方id:" . $transactionId . " 原因:" . $msg, '15280215347');
+            Yii::error("失败原因:" . $msg);
         }
 
     }

+ 6 - 2
biz-hd/purchase/classes/PurchaseClearClass.php

@@ -142,7 +142,11 @@ class PurchaseClearClass extends BaseClass
                 util::stop("SUCCESS");
             }
         }
-        if (isset($order->status) == false || $order->status != self::STATUS_AWAIT_PAY) {
+        if (!isset($order->status) || $order->status != self::STATUS_AWAIT_PAY) {
+            $ghsName = $order->ghsName ?? '';
+            $customName = $order->customName ?? '';
+            $orderSn = $order->orderSn ?? '';
+            noticeUtil::push("花店线上付款结账,但结账单不是待付款状态。供货商:{$ghsName},客户:{$customName},订单编号:{$orderSn}", '15280215347');
             util::fail('订单不是待付款状态');
         }
         $order->status = self::STATUS_HAS_PAY;
@@ -176,7 +180,7 @@ class PurchaseClearClass extends BaseClass
         $mainId = $shop->mainId ?? 0;
         $main = MainClass::getLockById($mainId);
         if (empty($main)) {
-            util::fail('没有main信息11');
+            util::fail('没有main数据呢');
         }
         if ($order->onlinePay == dict::getDict('onlinePay', 'yes')) {
             //供货商门店余额增加