shish 1 год назад
Родитель
Сommit
080ae26901
1 измененных файлов с 13 добавлено и 5 удалено
  1. 13 5
      app-ghs/controllers/OrderController.php

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

@@ -671,20 +671,32 @@ class OrderController extends BaseController
             $msg = '没有找到采购单';
             util::success(['returnStatus' => 'FAILURE'], $msg);
         }
+
+        $shop = $this->shop;
+        $sj = $shop->merchantName;
+        $shopName = $shop->shopName;
+        $name = $shopName == '首店' ? $sj : $sj . '-' . $shopName;
+
         //付款码
         $authCode = (string)$get['authCode'] ?? '';
         $authCode = trim($authCode);
         if (empty($authCode)) {
             $msg = '没有付款码';
+            $remind = $msg . "(付款码:{$authCode})" . '(' . $name . ')';
+            noticeUtil::push($remind . ' 编号007', '15280215347');
             util::success(['returnStatus' => 'FAILURE'], $msg);
         }
         if (!is_numeric($authCode)) {
             $msg = '付款码不是数字';
+            $remind = $msg . "(付款码:{$authCode})" . '(' . $name . ')';
+            noticeUtil::push($remind . ' 编号007', '15280215347');
             util::success(['returnStatus' => 'FAILURE'], $msg);
         }
         $codeNum = strlen($authCode);
         if ($codeNum < 16 || $codeNum > 30) {
-            $msg = '付款码有问题呢';
+            $msg = '付款码长度有问题呢';
+            $remind = $msg . "(付款码:{$authCode})" . '(' . $name . ')';
+            noticeUtil::push($remind . ' 编号007', '15280215347');
             util::success(['returnStatus' => 'FAILURE'], $msg);
         }
 
@@ -701,7 +713,6 @@ class OrderController extends BaseController
         try {
             $subject = '购买花材';
             $capitalType = dict::getDict('capitalType', 'xhPurchase', 'id');
-            $shop = $this->shop;
             $merchantPrivateKeyPath = Yii::getAlias("@vendor/lakala") . '/production/api_private_key.pem';
             $lklCertificatePath = Yii::getAlias("@vendor/lakala") . '/production/lkl-apigw-v1.cer';
             $params = [
@@ -789,9 +800,6 @@ class OrderController extends BaseController
             } else {
                 $msg = $response['msg'] ?? '';
                 $retCode = $response['code'] ?? '';
-                $sj = $shop->merchantName;
-                $shopName = $shop->shopName;
-                $name = $shopName == '首店' ? $sj : $sj . '-' . $shopName;
                 $msg = $msg . "(付款码:{$authCode})" . '(' . $name . ')';
                 noticeUtil::push($msg . ' ' . $retCode . ' 编号007', '15280215347');
                 util::success(['returnStatus' => 'FAILURE'], $msg);