Просмотр исходного кода

跨境商品支付回调增加预警信息

kevin_zhangl 2 лет назад
Родитель
Сommit
e00eb45a89
2 измененных файлов с 3 добавлено и 15 удалено
  1. 2 14
      common/helpers/Alarm.php
  2. 1 1
      common/models/forms/ApproachOrderForm.php

+ 2 - 14
common/helpers/Alarm.php

@@ -35,15 +35,8 @@ class Alarm
 
         // 业务环境过滤
         if ($reportAlarmOpen /**&& (count($allowPlatform) == 0 || in_array($_SERVER['HTTP_HOST'], $allowPlatform))*/) {
-            $result = self::curl(json_encode($message));
-            if ($result['code'] != 200) {
-                // 重新推送一次,如果失败,写错误日志
-                $result = self::curl(json_encode($message));
-                if ($result['code'] != 200) {
-                    LoggerTool::error(['预警信息上报平台失败. traceId【' . $message['trace-id'] . '】', $result]);
-                    return false;
-                }
-            }
+            self::curl(json_encode($message));
+
             LoggerTool::notice(['信息推送预警平台成功.',  'platformID: .' . $message['platform-id'], 'traceID: . ' . $message['trace-id']]);
         } else {
             $reason = '';
@@ -72,11 +65,6 @@ class Alarm
         $response = curl_exec($ch);
         curl_close($ch);
 
-        if (curl_errno($ch)) {
-            // 请求失败,返回错误信息
-            return ['code' => 500, 'message' => curl_error($ch)];
-        }
-
         return ['code' => 200, 'message' => json_decode($response, true)];
     }
 }

+ 1 - 1
common/models/forms/ApproachOrderForm.php

@@ -148,7 +148,7 @@ class ApproachOrderForm extends Model
         if ($this->sn) {
             $this->_model = ApproachOrder::findOne(['SN' => $this->sn]);
             if (!$this->_model){
-                $this->addError('sn', '订单不存在');
+                $this->addError('sn', '订单不存在. ' . json_encode($this->_model->toArray()));
                 return false;
             }
         }