浏览代码

Merge branch 'rmaster' of 39.97.239.116:gyfl/xyzshop into rmaster

ayHaru 3 年之前
父节点
当前提交
a3f8ce0d91

+ 1 - 1
core/framework/libraries/log.php

@@ -54,7 +54,7 @@ class Log
         $this->mAppFile = false;
         $this->mAppFileName = '';
 
-        $this->mOpenAll = true;
+        $this->mOpenAll = false;
         $this->mAllFile = false;
         $this->mAllFileName = '';
 

+ 2 - 2
data/config/dev/base.ini.php

@@ -46,8 +46,8 @@ $config['gip'] 		= 0;
 $config['dbdriver'] = 'mysqli';
 $config['tablepre']	= 'lrlz_';
 
-define('SSH_TUNEL_PROD','local');
-//define('SSH_TUNEL_PROD','xyz');
+//define('SSH_TUNEL_PROD','local');
+define('SSH_TUNEL_PROD','xyz');
 //define('SSH_TUNEL_PROD','lingzh');
 
 if(SSH_TUNEL_PROD ==='local') {

+ 3 - 0
helper/refill/LZRefillFactory.php

@@ -10,7 +10,10 @@ require_once(BASE_HELPER_PATH . '/refill/policy/lingzh/policy.php');
 require_once(BASE_HELPER_PATH . '/refill/policy/chctl.php');
 require_once(BASE_HELPER_PATH . '/refill/policy/ctl_item.php');
 require_once(BASE_HELPER_PATH . '/refill/policy/mchctl.php');
+require_once(BASE_HELPER_PATH . '/refill/policy/mchoilctl.php');
+require_once(BASE_HELPER_PATH . '/refill/policy/times_caller.php');
 require_once(BASE_HELPER_PATH . '/refill/policy/quaility.php');
+
 require_once(BASE_HELPER_PATH . '/refill/policy/merchant_price.php');
 require_once(BASE_HELPER_PATH . '/refill/policy/mgroup.php');
 require_once(BASE_HELPER_PATH . '/refill/policy/lingzh/quality_ploy.php');

+ 9 - 1
helper/refill/RefillBase.php

@@ -105,6 +105,7 @@ class RefillBase
             $spec = intval($refill_info['refill_amount']);
             $mchid = intval($refill_info['mchid']);
             $org_quality = intval($refill_info['org_quality']);
+            $mch_order = $refill_info['mch_order'];
 
             if ($success) {
                 util::incr_notify($chname, $card_type, $spec, $quality, true);
@@ -115,6 +116,7 @@ class RefillBase
             {
                 if(!empty($refill_info))
                 {
+                    util::add_exclude_channel($mchid,$mch_order,$card_type,$chname);
                     util::incr_notify($chname, $card_type, $spec, $quality, false);
                     util::incr_amount_lock($mchid,$card_type,$spec);
 
@@ -145,6 +147,7 @@ class RefillBase
 
         $mod_refill->edit($order_id, ['notify_time' => time(), 'notify_state' => 1]);
         QueueClient::push("NotifyMerchantComplete", ['order_id' => $order_id,'manual' => false]);
+        util::del_exclude_channel($mchid,$mch_order,$card_type);
 
         return true;
     }
@@ -299,11 +302,15 @@ class RefillBase
 
         $refill_state = false;
         $order_success = false;
+        $exclude_channels = util::get_exclude_channel($mchid,$mch_order,$card_type);
 
         foreach ($providers as $provider)
         {
             $channel_name = $provider->name();
-            Log::record("select channel name = {$channel_name}",Log::DEBUG);
+            if(in_array($channel_name,$exclude_channels)) {
+                Log::record("{$channel_name} channel in exclude",Log::DEBUG);
+                continue;
+            }
 
             //通道价格大于客户价格,换通道.
             [$goods_id, $price] = $provider->goods($quality,$amount,$card_type,$third_params);
@@ -424,6 +431,7 @@ class RefillBase
                 //提交失败
                 util::incr_commit($channel_name,$card_type,$amount,$quality,false);
                 util::incr_amount_lock($mchid,$card_type,$amount);
+                util::add_exclude_channel($mchid,$mch_order,$card_type,$channel_name);
 
                 Log::record("channel:{$channel_name} err:{$errmsg}");
                 $logic_vr_order = Logic("vr_order");

+ 2 - 0
helper/refill/XYZRefillFactory.php

@@ -12,6 +12,8 @@ require_once(BASE_HELPER_PATH . '/refill/policy/xyz/policy.php');
 require_once(BASE_HELPER_PATH . '/refill/policy/chctl.php');
 require_once(BASE_HELPER_PATH . '/refill/policy/ctl_item.php');
 require_once(BASE_HELPER_PATH . '/refill/policy/mchctl.php');
+require_once(BASE_HELPER_PATH . '/refill/policy/mchoilctl.php');
+require_once(BASE_HELPER_PATH . '/refill/policy/times_caller.php');
 require_once(BASE_HELPER_PATH . '/refill/policy/quaility.php');
 require_once(BASE_HELPER_PATH . '/refill/policy/merchant_price.php');
 require_once(BASE_HELPER_PATH . '/refill/policy/rlock.php');

+ 5 - 7
helper/refill/api/xyz/afand/RefillCallBack.php

@@ -42,13 +42,11 @@ class RefillCallBack implements refill\IRefillCallBack
 
         if ($status === 1) {
             Model('refill_order')->edit($order_id, $data);
-            return [$order_id, true, false,true];
-        }
-        elseif ($status === 0) {
-            return [$order_id, false, true,true];
-        }
-        else {
-            return [$order_id, false, false,false];
+            return [$order_id, true, false, true];
+        } elseif ($status === 0) {
+            return [$order_id, false, true, true];
+        } else {
+            return [$order_id, false, false, false];
         }
     }
 }

+ 5 - 7
helper/refill/api/xyz/afandeng/RefillCallBack.php

@@ -39,13 +39,11 @@ class RefillCallBack implements refill\IRefillCallBack
 
         if ($status === 1) {
             Model('refill_order')->edit($order_id, $data);
-            return [$order_id, true, false,true];
-        }
-        elseif ($status === 2) {
-            return [$order_id, false, true,true];
-        }
-        else {
-            return [$order_id, false, false,false];
+            return [$order_id, true, false, true];
+        } elseif ($status === 2) {
+            return [$order_id, false, true, true];
+        } else {
+            return [$order_id, false, false, false];
         }
     }
 }

+ 6 - 8
helper/refill/api/xyz/afandfs/RefillCallBack.php

@@ -32,18 +32,16 @@ class RefillCallBack implements refill\IRefillCallBack
         if (empty($order_info)) {
             return [false, false, false,false];
         }
-        $order_id = $order_info['order_id'];
 
+        $order_id = $order_info['order_id'];
         if ($status === 1) {
             $data['official_sn'] = strtolower($params['official_order_id']) == 'null' ? '' : $params['official_order_id'];
             Model('refill_order')->edit($order_id, $data);
-            return [$order_id, true, false,true];
-        }
-        elseif ($status === 0) {
-            return [$order_id, false, true,true];
-        }
-        else {
-            return [$order_id, false, false,false];
+            return [$order_id, true, false, true];
+        } elseif ($status === 0) {
+            return [$order_id, false, true, true];
+        } else {
+            return [$order_id, false, false, false];
         }
     }
 }

+ 5 - 7
helper/refill/api/xyz/afd/RefillCallBack.php

@@ -40,13 +40,11 @@ class RefillCallBack implements refill\IRefillCallBack
         if ($status === 99) {
             $data['official_sn'] = strtolower($params['orderid']) == 'null' ? '' : $params['orderid'];
             Model('refill_order')->edit($order_id, $data);
-            return [$order_id, true, false,true];
-        }
-        elseif ($status === 3) {
-            return [$order_id, false, true,true];
-        }
-        else {
-            return [$order_id, false, false,false];
+            return [$order_id, true, false, true];
+        } elseif ($status === 3) {
+            return [$order_id, false, true, true];
+        } else {
+            return [$order_id, false, false, false];
         }
     }
 }

+ 8 - 11
helper/refill/api/xyz/gftd/RefillCallBack.php

@@ -81,17 +81,14 @@ class RefillCallBack implements refill\IRefillCallBack
 
         //[$order_id, 成功失败, 是否能重试,接下来是否需要处理]
         if ($status === 101) {
-            return [$order_id, true, false,true];
-        }
-        elseif ($status === 109) {
-            $this->onError($params['message'],$order_id);
-            return [$order_id, false, false,true];
-        }
-        elseif ($status === 120) {
-            return [$order_id, false, false,false];
-        }
-        else {
-            return [$order_id, false, false,false];
+            return [$order_id, true, false, true];
+        } elseif ($status === 109) {
+            $this->onError($params['message'], $order_id);
+            return [$order_id, false, true, true];
+        } elseif ($status === 120) {
+            return [$order_id, false, false, false];
+        } else {
+            return [$order_id, false, false, false];
         }
     }
 

+ 8 - 11
helper/refill/api/xyz/gftdsinop/RefillCallBack.php

@@ -81,17 +81,14 @@ class RefillCallBack implements refill\IRefillCallBack
 
         //[$order_id, 成功失败, 是否能重试,接下来是否需要处理]
         if ($status === 101) {
-            return [$order_id, true, false,true];
-        }
-        elseif ($status === 109) {
-            $this->onError($params['message'],$order_id);
-            return [$order_id, false, false,true];
-        }
-        elseif ($status === 120) {
-            return [$order_id, false, false,false];
-        }
-        else {
-            return [$order_id, false, false,false];
+            return [$order_id, true, false, true];
+        } elseif ($status === 109) {
+            $this->onError($params['message'], $order_id);
+            return [$order_id, false, true, true];
+        } elseif ($status === 120) {
+            return [$order_id, false, false, false];
+        } else {
+            return [$order_id, false, false, false];
         }
     }
 

+ 1 - 1
helper/refill/api/xyz/lingzhoil/RefillCallBack.php

@@ -46,7 +46,7 @@ class RefillCallBack implements refill\IRefillCallBack
             return [$order_id, false, true,true];
         }
         else {
-            return [$order_id, false, false,false];
+            return [$order_id, false, true,false];
         }
     }
 }

+ 5 - 7
helper/refill/api/xyz/yichangt/RefillCallBack.php

@@ -49,13 +49,11 @@ class RefillCallBack implements refill\IRefillCallBack
         if ($status === 2) {
             $data['official_sn'] = strtolower($params['s_nubmer']) == 'null' ? '' : $params['s_nubmer'];
             Model('refill_order')->edit($order_id, $data);
-            return [$order_id, true, false,true];
-        }
-        elseif ($status === 3) {
-            return [$order_id, false, false,true];
-        }
-        else {
-            return [$order_id, false, false,false];
+            return [$order_id, true, false, true];
+        } elseif ($status === 3) {
+            return [$order_id, false, true, true];
+        } else {
+            return [$order_id, false, false, false];
         }
     }
 }

+ 5 - 7
helper/refill/api/xyz/yunling/RefillCallBack.php

@@ -51,13 +51,11 @@ class RefillCallBack implements refill\IRefillCallBack
 
         if ($status === 1) {
             Model('refill_order')->edit($order_id, $data);
-            return [$order_id, true, false,true];
-        }
-        elseif ($status === 9) {
-            return [$order_id, false, true,true];
-        }
-        else {
-            return [$order_id, false, false,false];
+            return [$order_id, true, false, true];
+        } elseif ($status === 9) {
+            return [$order_id, false, true, true];
+        } else {
+            return [$order_id, false, false, false];
         }
     }
 }

+ 5 - 7
helper/refill/api/xyz/yunlingfs/RefillCallBack.php

@@ -43,13 +43,11 @@ class RefillCallBack implements refill\IRefillCallBack
         if ($status === 1) {
             $data['official_sn'] = strtolower($params['supnumber']) == 'null' ? '' : $params['supnumber'];
             Model('refill_order')->edit($order_id, $data);
-            return [$order_id, true, false,true];
-        }
-        elseif ($status === 9) {
-            return [$order_id, false, true,true];
-        }
-        else {
-            return [$order_id, false, false,false];
+            return [$order_id, true, false, true];
+        } elseif ($status === 9) {
+            return [$order_id, false, true, true];
+        } else {
+            return [$order_id, false, false, false];
         }
     }
 }

+ 5 - 8
helper/refill/api/xyz/zeheng/RefillCallBack.php

@@ -23,7 +23,6 @@ class RefillCallBack implements refill\IRefillCallBack
         return md5($content);
     }
 
-
     public function notify($params)
     {
         $status = intval($params['state']);
@@ -37,13 +36,11 @@ class RefillCallBack implements refill\IRefillCallBack
         if ($status === 4) {
             $data['ch_trade_no'] = strtolower($params['orderId']) == 'null' ? '' : $params['orderId'];
             Model('refill_order')->edit($order_id, $data);
-            return [$order_id, true, false,true];
-        }
-        elseif ($status === 5) {
-            return [$order_id, false, false,true];
-        }
-        else {
-            return [$order_id, false, false,false];
+            return [$order_id, true, false, true];
+        } elseif ($status === 5) {
+            return [$order_id, false, true, true];
+        } else {
+            return [$order_id, false, false, false];
         }
     }
 }

+ 1 - 2
helper/refill/policy/chctl.php

@@ -53,7 +53,7 @@ class chctl
                     $speed = $item['speed'];
 
                     $key = $this->prefix($name,$amount,$card_type,$quality);
-                    Log::record("Load: key={$key} quality={$quality} name={$name} amount={$amount} type={$card_type} opened={$opened} sort={$sort} speed={$speed}",Log::DEBUG);
+//                    Log::record("Load: key={$key} quality={$quality} name={$name} amount={$amount} type={$card_type} opened={$opened} sort={$sort} speed={$speed}",Log::DEBUG);
                     $this->mSpeedtable[$key] = new ctl_item($name,$card_type,$amount,$speed,$sort,0,$opened,$quality);
                 }
             }
@@ -75,7 +75,6 @@ class chctl
         foreach ($names as $name)
         {
             $key = $this->prefix($name,$spec,$card_type,$quality);
-            Log::record("chctl::match key={$key}",Log::DEBUG);
             if(array_key_exists($key,$this->mSpeedtable)) {
                 $ctl_items[] = $this->mSpeedtable[$key];
             }

+ 56 - 0
helper/refill/policy/mchoilctl.php

@@ -0,0 +1,56 @@
+<?php
+
+
+namespace refill;
+
+class mchoilctl
+{
+    private $mMchidMapCtls;
+    public function __construct()
+    {
+        $this->load();
+    }
+
+    public function load()
+    {
+        $this->update_ctl();
+    }
+
+    private function update_ctl()
+    {
+        $this->mMchidMapCtls = [];
+        $mod_merchant = Model('merchant');
+        $merchants = $mod_merchant->getMerchantList(['merchant.mchid' => ['gt', 0]]);
+
+        foreach ($merchants as $item) {
+            $mchid = $item['mchid'];
+            $quality = intval($item['oil_quality']);
+            $time_out = $item['time_out'];
+
+            if($quality == Quality::SlowNormal || $quality == Quality::ThirdNormal || $quality == Quality::DefSuccess) {
+
+            }
+            elseif ($quality >= Quality::LowestQuality && $quality <= Quality::HighestQuality) {
+
+            }
+            else {
+                $quality = Quality::Normal;
+            }
+
+            $this->mMchidMapCtls[$mchid] = ['quality' => $quality,'time_out' => $time_out];
+        }
+    }
+
+    public function getCtls($mchid)
+    {
+        if(array_key_exists($mchid,$this->mMchidMapCtls)) {
+            $quality = $this->mMchidMapCtls[$mchid]['quality'];
+//            $time_out = $this->mMchidMapCtls[$mchid]['time_out'];
+
+            return [true,$quality];
+        }
+        else {
+            return [false,0,0];
+        }
+    }
+}

+ 65 - 10
helper/refill/policy/quaility.php

@@ -23,41 +23,96 @@ class Quality
     const DefSuccess = 13;   // 4 -> 3 -> 1 -> 2
     const NormalQuick = 14;
 
-    protected $mMchctl;
+    protected $mMchPhonectl;
+    protected $mMchoilctl;
     protected $mSpeeds;
     protected $mQualities;
 
     public function __construct()
     {
-        $this->mMchctl = new mchctl();
+        $this->mMchPhonectl = new mchctl();
+        $this->mMchoilctl = new mchoilctl();
     }
 
     public function load()
     {
-        $this->mMchctl->load();
+        $this->mMchPhonectl->load();
+        $this->mMchoilctl->load();
     }
 
-    public function find_quality($mchid,$card_type,$quality,$times,$used_time): array
+    public function find_quality($mchid, $card_type, $quality, $times, $used_time, $caller): array
     {
         if($card_type == mtopcard\ChinaMobileCard || $card_type == mtopcard\ChinaUnicomCard || $card_type == mtopcard\ChinaTelecomCard) {
             return $this->mobile_quality($mchid, $quality, $times, $used_time);
         }
         elseif($card_type == mtopcard\PetroChinaCard || $card_type == mtopcard\SinopecCard) {
-            return [1, [1]];
+            return $this->oil_quality($mchid, $quality, $times,$caller);
         }
         else {
             return [0, []];
         }
     }
 
+    private function oil_quality($mchid, $quality, $times, $caller): array
+    {
+        if($quality == 0)
+        {
+            [$success,$setting_quality,$time_out] = $this->mMchoilctl->getCtls($mchid);
+            if($success)
+            {
+                if(array_key_exists($setting_quality,$this->mQualities)) {
+                    $org = $setting_quality;
+                    $qualities = $this->mQualities[$setting_quality];
+                }
+                else {
+                    $org = $setting_quality;
+                    $qualities = [$setting_quality];
+                }
+            }
+            else {
+                $org = self::ThirdNormal;
+                $qualities = $this->mQualities[$org];
+            }
+        }
+        elseif(array_key_exists($quality,$this->mQualities)) {
+            $org = $quality;
+            $qualities = $this->mQualities[$quality];
+        }
+        else {
+            Log::record("find_quality: cannot find any quality",Log::DEBUG);
+            return [0,[]];
+        }
+
+        $qualities = $this->calc_oil_quality($qualities,$times,$caller);
+
+        return [$org,$qualities];
+    }
+
+    //通过每种类型通道耗时,倒推当前可用通道,并优先走推荐通道.
+    private function calc_oil_quality($qualities, $times, $caller)
+    {
+        $result = [];
+        $total_times = 0;
+        foreach ($qualities as $quality)
+        {
+            $total_times += $caller->calc_times($quality);
+
+            if($total_times > $times) {
+                $result[] = $quality;
+            }
+        }
+
+        Log::record("calc_oil_quality result = " . implode($result),Log::DEBUG);
+        return $result;
+    }
 
 
     private function mobile_quality($mchid,$quality,$times,$used_time): array
     {
         if($quality == 0)
         {
-            [$sucdess,$setting_quality,$time_out] = $this->mMchctl->getCtls($mchid);
-            if($sucdess)
+            [$success,$setting_quality,$time_out] = $this->mMchPhonectl->getCtls($mchid);
+            if($success)
             {
                 if(array_key_exists($setting_quality,$this->mQualities)) {
                     $org = $setting_quality;
@@ -77,7 +132,7 @@ class Quality
         elseif(array_key_exists($quality,$this->mQualities)) {
             $org = $quality;
             $qualities = $this->mQualities[$quality];
-            [$sucdess, $setting_quality, $time_out] = $this->mMchctl->getCtls($mchid);
+            [$success, $setting_quality, $time_out] = $this->mMchPhonectl->getCtls($mchid);
         }
         else {
             Log::record("find_quality: cannot find any quality",Log::DEBUG);
@@ -89,13 +144,13 @@ class Quality
         }
 
         $max_times = $this->mSpeeds[$org]['retry_times'];
-        $qualities = $this->calc_quality($qualities,$times,$used_time,$time_out,$max_times);
+        $qualities = $this->calc_phone_quality($qualities,$times,$used_time,$time_out,$max_times);
 
         return [$org,$qualities];
     }
 
     //通过每种类型通道耗时,倒推当前可用通道,并优先走推荐通道.
-    private function calc_quality($qualities, $times, $used_time, $time_out, $max_times)
+    private function calc_phone_quality($qualities, $times, $used_time, $time_out, $max_times)
     {
         $left_time = $time_out - $used_time;
         if($left_time <= 0 || $max_times <= $times) return [];

+ 32 - 0
helper/refill/policy/times_caller.php

@@ -0,0 +1,32 @@
+<?php
+
+
+namespace refill;
+
+
+class times_caller
+{
+    private $mMchid;
+    private $mSpec;
+    private $mCardType;
+    private $mReginNo;
+    private $mCaller;
+    public function __construct($mchid,$spec,$card_type,$regin_no,$caller)
+    {
+        $this->mMchid = $mchid;
+        $this->mSpec = $spec;
+        $this->mCardType = $card_type;
+        $this->mReginNo = $regin_no;
+
+        $this->mCaller = $caller;
+    }
+    public function __destruct()
+    {
+        $this->mCaller = null;
+    }
+
+    public function calc_times($quality)
+    {
+        return $this->mCaller->channeles($this->mMchid, $this->mSpec, $this->mCardType, $quality, $this->mReginNo);
+    }
+}

+ 13 - 2
helper/refill/policy/xyz/policy.php

@@ -86,7 +86,7 @@ class policy extends ProviderManager implements IPolicy
         $result = [];
         foreach ($name_overloads as $name => $overload)
         {
-            Log::record("channel {$name} has overloaded {$overload}",Log::DEBUG);
+            Log::record("channel {$name} has overloaded = {$overload}",Log::DEBUG);
             if(!isset($first)) {
                 $first = $overload;
             }
@@ -112,9 +112,20 @@ class policy extends ProviderManager implements IPolicy
         return $this->mPrices->price($mchid,$card_type,$spec,$quality,$pcode);
     }
 
+    public function channeles(int $mchid, int $spec, int $card_type, int $quality, $regin_no)
+    {
+        $providers = parent::find_providers($mchid, $spec, $card_type, $quality, $regin_no);
+        return count($providers);
+    }
+
     public function find_quality($mchid,$spec,$card_type,$org_quality,$times,$used_time,$pcode): array
     {
-        [$org_quality,$qualities] = $this->mQuality->find_quality($mchid,$card_type,$org_quality,$times,$used_time);
+        if($card_type == mtopcard\SinopecCard || $card_type == mtopcard\PetroChinaCard) {
+            $caller = new times_caller($mchid,$spec,$card_type,-1,$this);
+        } else {
+            $caller = null;
+        }
+        [$org_quality,$qualities] = $this->mQuality->find_quality($mchid,$card_type,$org_quality,$times,$used_time,$caller);
         if(empty($qualities)) {
             return [$org_quality,0];
         }

+ 56 - 0
helper/refill/util.php

@@ -408,6 +408,62 @@ class util
         }
     }
 
+    public static function add_exclude_channel($mchid,$mchorder,$card_type,$chname)
+    {
+        if($card_type == mtopcard\SinopecCard || $card_type == mtopcard\PetroChinaCard)
+        {
+            $ins = Cache::getInstance('cacheredis');
+            $name = 'oil_exclude_channels';
+            $key = "{$mchid}-{$mchorder}";
+
+            $chnames = $ins->hget($name, '', $key);
+            $chnames = unserialize($chnames);
+            if(empty($chnames)) {
+                $chnames = [];
+            }
+
+
+            if(!in_array($chname,$chnames)) {
+                $chnames[] = $chname;
+                $ins->hset($name,'',[$key => serialize($chnames)]);
+            }
+        }
+    }
+
+    public static function get_exclude_channel($mchid,$mchorder,$card_type)
+    {
+        if($card_type == mtopcard\SinopecCard || $card_type == mtopcard\PetroChinaCard)
+        {
+            $ins = Cache::getInstance('cacheredis');
+            $name = 'oil_exclude_channels';
+            $key = "{$mchid}-{$mchorder}";
+
+            $chnames = $ins->hget($name, '', $key);
+            $chnames = unserialize($chnames);
+
+            if(is_array($chnames)) {
+                return $chnames;
+            } else {
+                return [];
+            }
+        }
+        else {
+            return [];
+        }
+    }
+
+    public static function del_exclude_channel($mchid,$mchorder,$card_type)
+    {
+        if($card_type == mtopcard\SinopecCard || $card_type == mtopcard\PetroChinaCard)
+        {
+            $ins = Cache::getInstance('cacheredis');
+            $name = 'oil_exclude_channels';
+            $key = "{$mchid}-{$mchorder}";
+
+            $ins->hdel($name, '', $key);
+        }
+    }
+
     ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
     public static function push_queue($mchid,$mch_order,$val)
     {

+ 0 - 1
plot/thdf5.py

@@ -117,7 +117,6 @@ class DataTest(unittest.TestCase):
         print(paths)
 
     def test_mchplot(self):
-    # buf = dataCenter.draw_plot(start_time=1619654400, interval=900, chname='yunling', card_type=5, amount=200)
         time_stamp = int(time.time())
         buf = mchDataCenter.draw_plot(start_time=time_stamp, interval=900)
         img = Image.open(buf)

+ 4 - 0
rdispatcher/proxy.php

@@ -5,6 +5,7 @@ require_once (BASE_ROOT_PATH . '/helper/model_helper.php');
 use mtopcard;
 use refill;
 use refill\errcode;
+use refill\util;
 
 class proxy
 {
@@ -64,6 +65,7 @@ class proxy
                     $mch_order, $idcard, $card_name, $notify_url, $quality, $org_quality, $order_time, $commit_times,
                     "无效的手机号");
                 QueueClient::push("NotifyMerchantComplete", ['order_id' => $order_id, 'manual' => false]);
+                util::del_exclude_channel($mchid,$mch_order,$card_type);
                 return;
             }
         }
@@ -115,6 +117,7 @@ class proxy
                 }
 
                 QueueClient::push("NotifyMerchantComplete", ['order_id' => $order_id,'manual' => false]);
+                util::del_exclude_channel($mchid,$mch_order,$card_type);
             }
         }
     }
@@ -207,6 +210,7 @@ class proxy
             }
 
             QueueClient::push("NotifyMerchantComplete", ['order_id' => $order_id,'manual' => false]);
+            util::del_exclude_channel($mchid,$mch_order,$card_type);
         }
     }
 }

文件差异内容过多而无法显示
+ 4 - 2
test/TestRedis.php