浏览代码

fix:对排除的店铺,依然做空流水号检测,导致成功订单状态没被修改.

stanley-king 1 年之前
父节点
当前提交
2884a3141e
共有 1 个文件被更改,包括 21 次插入2 次删除
  1. 21 2
      helper/refill/RefillBase.php

+ 21 - 2
helper/refill/RefillBase.php

@@ -90,11 +90,30 @@ class RefillBase
         return true;
     }
 
-    private function risksn_check($refill_info,$org_official_sn)
+    private function risksn_check($refill_info, $order_info, $org_official_sn)
     {
+        $in_exclude = function ($store_id)
+        {
+            $store_id = intval($store_id);
+            if($store_id <= 0) {
+                return false;
+            }
+
+            global $config;
+            $risk_official_sn = $config['risk_official_sn'] ?? [];
+            $exclude_stores = $risk_official_sn['exclude_stores'] ?? [];
+
+            return in_array($store_id,$exclude_stores);
+        };
+
         $card_type = intval($refill_info['card_type']);
         $chk_types = [mtopcard\ChinaMobileCard , mtopcard\ChinaUnicomCard , mtopcard\ChinaTelecomCard];
 
+        $store_id = intval($order_info['store_id']);
+        if($in_exclude($store_id)) {
+            return false;
+        }
+
         if(!in_array($card_type,$chk_types)) {
             return false;
         }
@@ -191,7 +210,7 @@ class RefillBase
                     'order_id' => $refill_info['order_id'],
                     'official_sn' => $refill_info['official_sn']];
 
-                if ($this->risksn_check($refill_info, $official_sn)) {
+                if ($this->risksn_check($refill_info, $order_info, $official_sn)) {
                     $tran->commit();
                     QueueClient::async_push("OnRiskSN", $params, 1);
                     return false;