haru haru 3 年之前
父节点
当前提交
5f650e05a0
共有 100 个文件被更改,包括 4205 次插入2120 次删除
  1. 77 65
      admin/control/merchant.php
  2. 135 84
      admin/control/ordersendlist.php
  3. 119 0
      admin/control/orderstats.php
  4. 2 3
      admin/control/provider_ctl.php
  5. 21 3
      admin/control/provider_price.php
  6. 6 2
      admin/control/refill_order.php
  7. 1 1
      admin/include/menu.php
  8. 467 0
      admin/templates/default/merchant.ctl.php
  9. 0 40
      admin/templates/default/merchant.edit.php
  10. 19 16
      admin/templates/default/merchant.index.php
  11. 0 66
      admin/templates/default/merchant.intercept.php
  12. 2 0
      admin/templates/default/merchant.order.stats.php
  13. 111 85
      admin/templates/default/merchant.ratios.php
  14. 4 4
      admin/templates/default/merchant.refill.evidence_list.php
  15. 0 152
      admin/templates/default/merchant.retry.times.php
  16. 2 0
      admin/templates/default/provider.order.stats.php
  17. 173 299
      admin/templates/default/provider.price.php
  18. 77 57
      admin/templates/default/refill.order.search.php
  19. 380 0
      admin/templates/default/refill.task.php
  20. 18 15
      admin/templates/default/system.order.stats.php
  21. 180 2
      crontab/control/minutes.php
  22. 0 5
      data/config/dev/refill.ini.php
  23. 233 110
      data/config/win/refill.ini.php
  24. 233 110
      data/config/xyz/refill.ini.php
  25. 233 110
      data/config/xyzadm/refill.ini.php
  26. 75 0
      data/model/refill_task.model.php
  27. 1 1
      docker/conf/crontab/debug-root
  28. 1 0
      global.php
  29. 1 1
      helper/bonus/BonusAmount.php
  30. 6 1
      helper/mtopcard/mtopcard.php
  31. 4 4
      helper/refill/CalcMerchantPrice.php
  32. 2 0
      helper/refill/LZRefillFactory.php
  33. 6 1
      helper/refill/RefillBase.php
  34. 2 0
      helper/refill/XYZRefillFactory.php
  35. 5 2
      helper/refill/api/test/qianqian/RefillPhone.php
  36. 140 140
      helper/refill/api/xyz/bingdht/RefillPhone.php
  37. 1 1
      helper/refill/api/xyz/cangbukami/RefillCallBack.php
  38. 14 16
      helper/refill/api/xyz/chizeng/RefillCallBack.php
  39. 154 140
      helper/refill/api/xyz/chizeng/RefillPhone.php
  40. 0 20
      helper/refill/api/xyz/chizeng/api.txt
  41. 11 11
      helper/refill/api/xyz/chizeng/config.php
  42. 19 0
      helper/refill/api/xyz/chizeng/对接文档-yezi.txt
  43. 1 1
      helper/refill/api/xyz/dashang/RefillPhone.php
  44. 1 1
      helper/refill/api/xyz/dianchong/RefillPhone.php
  45. 14 2
      helper/refill/api/xyz/dinghui/RefillPhone.php
  46. 1 1
      helper/refill/api/xyz/dingxin/RefillPhone.php
  47. 47 0
      helper/refill/api/xyz/fangxing/RefillCallBack.php
  48. 132 0
      helper/refill/api/xyz/fangxing/RefillPhone.php
  49. 15 0
      helper/refill/api/xyz/fangxing/config.php
  50. 二进制
      helper/refill/api/xyz/fangxing/开发接口文档V1.2.4.pdf
  51. 12 0
      helper/refill/api/xyz/fangxing/账号.txt
  52. 二进制
      helper/refill/api/xyz/guochuang/20211022黑龙江移动.png
  53. 二进制
      helper/refill/api/xyz/guochuang/20211025辽宁移动.png
  54. 二进制
      helper/refill/api/xyz/guochuang/20211027内蒙古调价函.png
  55. 二进制
      helper/refill/api/xyz/guochuang/20211029辽宁移动.png
  56. 二进制
      helper/refill/api/xyz/guochuang/20211101福建移动调价函.png
  57. 二进制
      helper/refill/api/xyz/guochuang/20211101重庆移动调价.png
  58. 206 196
      helper/refill/api/xyz/guochuang/RefillPhone.php
  59. 5 5
      helper/refill/api/xyz/guochuang/config.php
  60. 二进制
      helper/refill/api/xyz/guochuang_nation/20211028电信5-9调价.png
  61. 二进制
      helper/refill/api/xyz/guochuang_nation/20211102电信.png
  62. 二进制
      helper/refill/api/xyz/guochuang_nation/20211102移动30,50.png
  63. 187 182
      helper/refill/api/xyz/guochuang_nation/RefillPhone.php
  64. 1 1
      helper/refill/api/xyz/hongxudagy/RefillPhone.php
  65. 1 1
      helper/refill/api/xyz/hongxudagy996/RefillPhone.php
  66. 1 1
      helper/refill/api/xyz/hongxudayz/RefillPhone.php
  67. 1 1
      helper/refill/api/xyz/hongxudayz996/RefillPhone.php
  68. 5 5
      helper/refill/api/xyz/huafutong/RefillPhone.php
  69. 46 0
      helper/refill/api/xyz/huafutongman/RefillCallBack.php
  70. 126 0
      helper/refill/api/xyz/huafutongman/RefillPhone.php
  71. 25 0
      helper/refill/api/xyz/huafutongman/config.php
  72. 6 0
      helper/refill/api/xyz/huafutongman/商户信息.txt
  73. 二进制
      helper/refill/api/xyz/huafutongman/对接文档new.docx
  74. 2 2
      helper/refill/api/xyz/jinfeng/RefillPhone.php
  75. 1 1
      helper/refill/api/xyz/jinxin/RefillPhone.php
  76. 12 0
      helper/refill/api/xyz/jumithird/RefillPhone.php
  77. 2 2
      helper/refill/api/xyz/kachong/RefillPhone.php
  78. 1 1
      helper/refill/api/xyz/kangkai/RefillPhone.php
  79. 1 1
      helper/refill/api/xyz/lechong/RefillPhone.php
  80. 2 2
      helper/refill/api/xyz/lingzhman/RefillPhone.php
  81. 2 2
      helper/refill/api/xyz/lingzhman48/RefillPhone.php
  82. 34 0
      helper/refill/api/xyz/linzhu/RefillCallBack.php
  83. 146 0
      helper/refill/api/xyz/linzhu/RefillPhone.php
  84. 36 0
      helper/refill/api/xyz/linzhu/config.php
  85. 32 0
      helper/refill/api/xyz/linzhu/椰子.txt
  86. 3 0
      helper/refill/api/xyz/linzhu/话费充值接口v1.1.doc
  87. 1 1
      helper/refill/api/xyz/menggu/RefillOil.php
  88. 1 1
      helper/refill/api/xyz/menggu_hf/RefillPhone.php
  89. 2 2
      helper/refill/api/xyz/miaoxt/RefillPhone.php
  90. 2 2
      helper/refill/api/xyz/miaoxt_fs/RefillPhone.php
  91. 1 1
      helper/refill/api/xyz/qianqian/RefillCallBack.php
  92. 1 1
      helper/refill/api/xyz/qianqian/RefillPhone.php
  93. 2 2
      helper/refill/api/xyz/qijutang/RefillPhone.php
  94. 1 1
      helper/refill/api/xyz/shimier/RefillPhone.php
  95. 143 128
      helper/refill/api/xyz/shuoruan/RefillPhone.php
  96. 1 1
      helper/refill/api/xyz/shuoruan/config.php
  97. 4 1
      helper/refill/api/xyz/shuoruan/北京椰子.txt
  98. 2 2
      helper/refill/api/xyz/sialan/RefillPhone.php
  99. 2 2
      helper/refill/api/xyz/sialan_tax/RefillPhone.php
  100. 0 0
      helper/refill/api/xyz/suyuan/RefillPhone.php

+ 77 - 65
admin/control/merchant.php

@@ -193,8 +193,6 @@ class merchantControl extends SystemControl
                 $update['time_out'] = intval($_POST['night_timeout']);
             }
 
-            $update['quality'] = intval($_POST['quality']);
-            $update['oil_quality'] = intval($_POST['oil_quality']);
             $member_id = $merchant['admin_id'];
             $model_merchant = Model('merchant');
             $trans = new trans_wapper($model_merchant, __METHOD__);
@@ -1073,7 +1071,7 @@ class merchantControl extends SystemControl
         }
     }
 
-    public function merchant_interceptOp()
+    public function merchant_ctlOp()
     {
         $mchid = $_GET['mchid'] ?? $_POST['mchid'];
         $model_merchant = Model('merchant');
@@ -1081,82 +1079,96 @@ class merchantControl extends SystemControl
         if (empty($merchant)) {
             showMessage('机构信息有误');
         }
-        if (chksubmit()) {
-            $intercept_cfg['is_transfer'] = $_POST['is_transfer'];
-            if (!empty($_POST['card_states'])) {
-                $intercept_cfg['card_states'] = $_POST['card_states'];
-            }
-            $intercept_cfg = serialize($intercept_cfg);
-            $resp = $model_merchant->editMerchant(['intercept_cfg' => $intercept_cfg], ['mchid' => $mchid]);
+        $qualitys = [
+            refill\Quality::Normal, refill\Quality::Quick, refill\Quality::CardKey, refill\Quality::ThirdShop,
+            refill\Quality::SlowTwentyFour, refill\Quality::SlowSix, refill\Quality::SlowTwo, refill\Quality::SlowFortyEight,
+            refill\Quality::SlowSeventyTwo, refill\Quality::Fastest
+        ];
+        if(chksubmit())
+        {
+            $intercept_data = function (){
+                $intercept_cfg['is_transfer'] = intval($_POST['is_transfer']) === 1;
+                if (!empty($_POST['card_states'])) {
+                    foreach ($_POST['card_states'] as $card_state)
+                    {
+                        $card_states[] = intval($card_state);
+                    }
+                    $intercept_cfg['card_states'] = $card_states;
+                }
+                if (!empty($_POST['card_types'])) {
+                    foreach ($_POST['card_types'] as $card_type)
+                    {
+                        $card_types[] = intval($card_type);
+                    }
+                    $intercept_cfg['card_types'] = $card_types;
+                }
+                return serialize($intercept_cfg);
+            };
+
+            $retry_times_data = function ($qualitys){
+                $qualities = [];
+                foreach ($qualitys as $quality) {
+                    $quality = intval($quality);
+                    $day_secs_key = "{$quality}-day_secs";
+                    $night_secs_key = "{$quality}-night_secs";
+                    $times_key = "{$quality}-times";
+                    if(!empty($_POST[$day_secs_key]) && !empty($_POST[$night_secs_key]) && !empty($_POST[$times_key])) {
+                        $qualities[$quality] = ['day_secs' => intval($_POST[$day_secs_key]), 'night_secs' => intval($_POST[$night_secs_key]), 'times' => intval($_POST[$times_key])];
+                    }
+                }
+                $retry_times_cfg['qualities'] = $qualities;
+                $ratio = floatval($_POST['ratio']) ?? 0;
+                $period = intval($_POST['period']) ?? 0;
+                $profit_ratio = floatval($_POST['profit_ratio']) ?? 0;
+                $retry_times_cfg['lower_ratio'] = ['ratio' => $ratio, 'period' => $period];
+                $retry_times_cfg['profit_ratio'] = $profit_ratio;
+                return serialize($retry_times_cfg);
+            };
+
+            $update['quality'] = intval($_POST['quality']);
+            $update['oil_quality'] = intval($_POST['oil_quality']);
+            $update['intercept_cfg'] = $intercept_data();
+            $update['retry_times_cfg'] = $retry_times_data($qualitys);
+            $resp = $model_merchant->editMerchant($update, ['mchid' => $mchid]);
             if ($resp) {
                 showMessage('操作成功', 'index.php?act=merchant&op=merchant');
             } else {
                 showMessage('操作失败');
             }
-        } else {
-            $intercept_cfg = $merchant['intercept_cfg'];
-            if (empty($intercept_cfg)) {
-                $intercept_cfg = ['card_states' => [], 'is_transfer' => 0];
-            } else {
-                $intercept_cfg = unserialize($intercept_cfg);
+        }
+        else
+        {
+            foreach ($qualitys as $value) {
+                $quality[$value] = $this->quality_format($value,mtopcard\ChinaMobileCard);
             }
+            Tpl::output('intercept', $this->merchant_intercept($merchant));
+            Tpl::output('retry_times', $this->merchant_retry_times($merchant));
             Tpl::output('merchant', $merchant);
+            Tpl::output('quality', $quality);
             Tpl::output('card_state', mtopcard\CardState);
-            Tpl::output('intercept', $intercept_cfg);
-            Tpl::showpage('merchant.intercept');
+            Tpl::showpage('merchant.ctl');
         }
     }
 
-    public function merchant_retry_timesOp()
+    private function merchant_intercept($merchant)
     {
-        $mchid = $_GET['mchid'] ?? $_POST['mchid'];
-        $model_merchant = Model('merchant');
-        $merchant = $model_merchant->getMerchantInfo(['mchid' => $mchid], '*', true);
-        if (empty($merchant)) {
-            showMessage('机构信息有误');
-        }
-        $qualitys = [
-            refill\Quality::Normal,refill\Quality::Quick,refill\Quality::CardKey,refill\Quality::ThirdShop,
-            refill\Quality::SlowTwentyFour,refill\Quality::SlowSix,refill\Quality::SlowTwo,refill\Quality::SlowFortyEight,
-            refill\Quality::SlowSeventyTwo,refill\Quality::Fastest
-        ];
-        if (chksubmit()) {
-            $qualities = $retry_times_cfg = [];
-            foreach ($qualitys as $quality) {
-                $secs_key = "{$quality}-secs";
-                $times_key = "{$quality}-times";
-                if(!empty($_POST[$secs_key]) && !empty($_POST[$times_key])) {
-                    $qualities[$quality] = ['secs' => $_POST[$secs_key], 'times' => $_POST[$times_key]];
-                }
-            }
-            $retry_times_cfg['qualities'] = $qualities;
-            $ratio = $_POST['ratio'] ?? 0;
-            $period = $_POST['period'] ?? 0;
-            $retry_times_cfg['lower_ratio'] = ['ratio' => $ratio, 'period' => $period];
-            $retry_times_cfg['opened'] = $_POST['opened'];
-
-            $retry_times_cfg = serialize($retry_times_cfg);
-            $resp = $model_merchant->editMerchant(['retry_times_cfg' => $retry_times_cfg], ['mchid' => $mchid]);
-            if ($resp) {
-                showMessage('操作成功', 'index.php?act=merchant&op=merchant');
-            } else {
-                showMessage('操作失败');
-            }
+        $intercept_cfg = $merchant['intercept_cfg'];
+        if (empty($intercept_cfg)) {
+            $intercept_cfg = ['card_states' => [], 'is_transfer' => 0];
         } else {
-            foreach ($qualitys as $value) {
-                $quality[$value] = $this->quality_format($value,mtopcard\ChinaMobileCard);
-            }
-            $retry_times_cfg = $merchant['retry_times_cfg'];
-            if (empty($retry_times_cfg)) {
-                $retry_times_cfg = [];
-            } else {
-                $retry_times_cfg = unserialize($retry_times_cfg);
-            }
+            $intercept_cfg = unserialize($intercept_cfg);
+        }
+        return $intercept_cfg;
+    }
 
-            Tpl::output('merchant', $merchant);
-            Tpl::output('quality', $quality);
-            Tpl::output('retry_times', $retry_times_cfg);
-            Tpl::showpage('merchant.retry.times');
+    private function merchant_retry_times($merchant)
+    {
+        $retry_times_cfg = $merchant['retry_times_cfg'];
+        if (empty($retry_times_cfg)) {
+            $retry_times_cfg = [];
+        } else {
+            $retry_times_cfg = unserialize($retry_times_cfg);
         }
+        return $retry_times_cfg;
     }
 }

+ 135 - 84
admin/control/ordersendlist.php

@@ -5,114 +5,134 @@ use refill\util;
 
 class ordersendlistControl extends SystemControl
 {
+    private $mTimeouts;
     public function __construct()
     {
+        $this->mTimeouts = [3 => 180, 4 => 300, 5 => 600, 6 => 900, 7 => 7200];
         parent::__construct();
     }
 
-    public function indexOp()
+    private function time_cond($timeout_type,$card_type,$cur_time)
     {
-        $model_refill_order = Model('refill_order');
-        $condition['refill_order.inner_status'] = 0;
-        $condition['vr_order.order_state'] = ORDER_STATE_SEND;
-//        if(empty($_GET['quality'])) {
-//            //默认普充
-//            $_GET['quality'] = 2;
-//        }
-        //提前20s
-        $time = time() + 20;
-        $condition['refill_order.order_time'] = ['exp', "refill_order.order_time < ({$time} - merchant.time_out)"];
-//        $condition['refill_order.order_time'] = ['lt',time()-300];
-        if (!empty($_GET['mchid'])) {
-            $condition['refill_order.mchid'] = $_GET['mchid'];
-        }
-        if (!empty($_GET['store_id'])) {
-            $condition['vr_order.store_id'] = $_GET['store_id'];
-        }
-        $time_cond = [
-            ['between', [(time() - 3600), (time() - 1800)]],
-            ['lt', (time() - 3600)]];
-        if ($_GET['time'] == 1) {
-            $condition['refill_order.order_time'] = ['between', [(time() - 3600), (time() - 1800)]];
-        }
-        if ($_GET['time'] == 2) {
-            $condition['refill_order.order_time'] = ['lt', (time() - 3600)];
-        }
-        $time_out_order = function ($time_out, $condition) {
+        $mchid_filter = function ($time_out) {
             $mchids = Model('')->table('merchant')->where(['time_out' => ['elt', $time_out]])->field('mchid')->select();
             $mchids = array_column($mchids, 'mchid');
             $mchids = implode(',', $mchids);
-
-            $condition['refill_order.order_time'] = ['lt', (time() - $time_out)];
-            $condition['refill_order.mchid'] = ['in', $mchids];
-            return $condition;
+            return $mchids;
         };
-        if ($_GET['time'] == 3) {
-            $condition = $time_out_order(180, $condition);
-            $time_cond[] = ['lt', (time() - 180)];
-            $_GET['card_type'] = 'phone';
-        }
-        if ($_GET['time'] == 4) {
-            $condition = $time_out_order(300, $condition);
-            $time_cond[] = ['lt', (time() - 300)];
-            $_GET['card_type'] = 'phone';
+
+        $period = 20;
+        $start_day = strtotime("-5 days",$cur_time);
+
+        $time_cond = [];
+        $mch_cond = [];
+
+        if ($timeout_type > 0)
+        {
+            if (in_array($timeout_type, [1, 2]))
+            {
+                if ($timeout_type === 1) {
+                    $time_cond['refill_order.order_time'] = ['between', [$cur_time - 3600, $cur_time - 1800]];
+                    $time_cond['vr_order.add_time'] = ['between', [$cur_time - 3600, $cur_time - 1800]];
+                }
+                if ($timeout_type === 2) {
+                    $time_cond['refill_order.order_time'] = ['between', [$start_day, $cur_time - 3600]];
+                    $time_cond['vr_order.add_time'] = ['between', [$start_day, $cur_time - 3600]];
+                }
+            }
+            elseif (in_array($timeout_type, [3, 4, 5, 6, 7])) {
+                $time_out = $this->mTimeouts[$timeout_type];
+                $mchids = $mchid_filter($time_out);
+
+                $time_cond['vr_order.add_time&vr_order.add_time'] = ['_multi' => true, ['egt', $start_day], ['lt', $cur_time - $time_out]];
+                $time_cond['refill_order.order_time&refill_order.order_time'] = ['_multi' => true, ['egt', $start_day], ['lt', $cur_time - $time_out]];
+
+                $mch_cond['refill_order.mchid'] = ['in', $mchids];
+
+                $card_type = 'phone';
+            }
+            else {
+                $time_cond = [];
+            }
         }
-        if ($_GET['time'] == 5) {
-            $condition = $time_out_order(600, $condition);
-            $time_cond[] = ['lt', (time() - 600)];
-            $_GET['card_type'] = 'phone';
+        else
+        {
+            $time_cond['vr_order.add_time&vr_order.add_time'] = ['_multi' => true,
+                ['egt', $start_day],
+                ['lt', $cur_time]];
+            $time_cond['refill_order.order_time&refill_order.order_time&refill_order.order_time'] = ['_multi' => true,
+                ['egt', $start_day],
+                ['lt', $cur_time],
+                ['exp', "refill_order.order_time < {$cur_time} - merchant.time_out + {$period}"]];
         }
-        if ($_GET['time'] == 6) {
-            $condition = $time_out_order(900, $condition);
-            $time_cond[] = ['lt', (time() - 900)];
-            $_GET['card_type'] = 'phone';
+
+        return [$time_cond, $mch_cond, $card_type];
+    }
+
+    public function indexOp()
+    {
+        $model_refill_order = Model('refill_order');
+
+        $base_cond['refill_order.inner_status'] = 0;
+        $base_cond['vr_order.order_state'] = ORDER_STATE_SEND;
+
+        $timeout_type = intval($_GET['time']);
+        $card_type = $_GET['card_type'];
+
+        if (!empty($_GET['store_id'])) {
+            $base_cond['vr_order.store_id'] = $_GET['store_id'];
         }
-        if ($_GET['time'] == 7) {
-            $condition = $time_out_order(7200, $condition);
-            $time_cond[] = ['lt', (time() - 7200)];
-            $_GET['card_type'] = 'phone';
+
+        $cur_time = time();
+        [$time_cond,$mch_cond,$card_type] = $this->time_cond($timeout_type,$card_type,$cur_time);
+
+        if (!empty($_GET['mchid'])) {
+            $base_cond['refill_order.mchid'] = $_GET['mchid'];
+        } elseif(!empty($mch_cond)) {
+            $base_cond = array_merge($base_cond,$mch_cond);
         }
 
-        if (!empty($_GET['card_type'])) {
-            if (in_array($_GET['card_type'], ['1', '2', '4', '5', '6', '7'])) {
-                $condition['refill_order.card_type'] = $_GET['card_type'];
+        if (!empty($card_type))
+        {
+            if (in_array($card_type, ['1', '2', '4', '5', '6', '7'])) {
+                $base_cond['refill_order.card_type'] = $card_type;
             }
-            if ($_GET['card_type'] == 'oil') {
-                $condition['refill_order.card_type'] = ['in', ['1', '2']];
+            if ($card_type == 'oil') {
+                $base_cond['refill_order.card_type'] = ['in', ['1', '2']];
             }
-            if ($_GET['card_type'] == 'phone') {
-                $condition['refill_order.card_type'] = ['in', ['4', '5', '6']];
+            if ($card_type == 'phone') {
+                $base_cond['refill_order.card_type'] = ['in', ['4', '5', '6']];
             }
         }
+
         if (!empty($_GET['quality'])) {
-            $condition['refill_order.quality'] = $_GET['quality'];
+            $base_cond['refill_order.quality'] = $_GET['quality'];
         }
+
+        $orders_cond = array_merge($base_cond,$time_cond);
         if (!empty($_GET['order_query'])) {
-            $this->updateOrderSend($condition);
-            exit;
+            $this->updateOrderSend($orders_cond);
+            return;
         }
 
-        $order_list = $model_refill_order->getMerchantTimeOut($condition, 200, 'refill_order.*,vr_order.order_state', 'refill_order.quality asc,refill_order.order_time asc');
-//        $order_list = $model_refill_order->getMerchantOrderList($condition, 50, 'refill_order.*,vr_order.order_state', 'refill_order.order_time asc');
-
-        $stat = Model('')->table('refill_order,vr_order,merchant')->join('inner,inner')
+        $fields = 'refill_order.*,vr_order.order_state';
+        $order_by = 'refill_order.quality asc,refill_order.order_time asc';
+        $order_list = $model_refill_order->getMerchantTimeOut($orders_cond, 200, $fields, $order_by);
+        $order_stat = Model('')->table('refill_order,vr_order,merchant')
+            ->join('inner,inner')
             ->on('refill_order.order_id=vr_order.order_id,refill_order.mchid=merchant.mchid')
             ->field('count(*) as order_count ,sum(refill_amount) as refill_amounts, sum(channel_amount) as channel_amounts, sum(mch_amount) as mch_amounts')
-            ->where($condition)->find();
-//        $stat = Model('')->table('refill_order,vr_order')->join('inner')
-//            ->on('refill_order.order_id=vr_order.order_id')
-//            ->field('count(*) as order_count ,sum(refill_amount) as refill_amounts, sum(channel_amount) as channel_amounts, sum(mch_amount) as mch_amounts')
-//            ->where($condition)->find();
-        $count = $this->refill_stats($condition, $time_cond);
+            ->where($orders_cond)->find();
 
+        $special_stat = $this->extra_stats($base_cond, $timeout_type,$cur_time);
         $merchant_list = $this->merchants();
 
         if(!empty($order_list)) {
             $order_list = $this->orderFormat($order_list, $merchant_list);
         }
         $provider_list = $this->providers();
-        Tpl::output('stat', $stat);
-        Tpl::output('count', $count);
+        Tpl::output('stat', $order_stat);
+        Tpl::output('count', $special_stat);
         Tpl::output('order_list', $order_list);
         Tpl::output('merchant_list', $merchant_list);
         Tpl::output('provider_list', $provider_list);
@@ -120,22 +140,46 @@ class ordersendlistControl extends SystemControl
         Tpl::showpage('refill.order.send.index');
     }
 
-    private function refill_stats($condition, $times): array
+    private function extra_stats($base_cond, $timeout_type,$cur_time): array
     {
-        $stat_order = function ($condition) {
+        $stat_order = function ($cond)
+        {
             $stat = Model('')->table('refill_order,vr_order')->join('inner')
                 ->on('refill_order.order_id=vr_order.order_id')
                 ->field('count(*) as order_count ')
-                ->where($condition)->find();
+                ->where($cond)->find();
 
             return $stat['order_count'];
         };
+
         $result = [];
-        $condition['order_state'] = ORDER_STATE_SEND;
-        foreach ($times as $time) {
-            $condition['refill_order.order_time'] = $time;
-            $result[] = $stat_order($condition);
+
+        $start_day = strtotime("-5 days",$cur_time);
+        $extra_conds = [
+            ['between', [$cur_time - 3600, $cur_time - 1800]],
+            [$start_day, $cur_time - 3600]
+        ];
+
+        if (array_key_exists($timeout_type, $this->mTimeouts)) {
+            $time_out = $this->mTimeouts[$timeout_type];
+            $extra_conds[] = ['_multi' => true,
+                ['egt', $start_day],
+                ['lt', $cur_time - $time_out]];
+        }
+
+        foreach ($extra_conds as $stat_cond)
+        {
+            if(!empty($time_out)){
+                $base_cond['vr_order.add_time&vr_order.add_time'] = $stat_cond;
+                $base_cond['refill_order.order_time&refill_order.order_time'] = $stat_cond;
+            }else{
+                $base_cond['refill_order.order_time'] = $stat_cond;
+                $base_cond['vr_order.add_time'] = $stat_cond;
+            }
+
+            $result[] = $stat_order($base_cond);
         }
+
         return $result;
     }
 
@@ -266,11 +310,18 @@ class ordersendlistControl extends SystemControl
         if (empty($_GET['notify_time'])) {
             $_GET['notify_time'] = 180;
         }
+        $cur_time = time();
         $time = $_GET['time'] * 3600;
-        $condition['refill_order.order_time'] = ['gt', (time() - $time)];
+        $condition['refill_order.order_time'] = [['gt', ($cur_time - $time)], ['lt', $cur_time], 'and'];
+        $condition['vr_order.add_time'] = [['gt', ($cur_time - $time)], ['lt', $cur_time], 'and'];
 
         $notify_time = $_GET['notify_time'];
-        $condition['refill_order.notify_time'] = ['lt', (time() - $notify_time)];
+        if($notify_time > 0) {
+            $start_day = strtotime("-5 days",$cur_time);
+            $condition['refill_order.notify_time'] = ['lt', (time() - $notify_time)];
+            $condition['refill_order.notify_time'] = [['gt', $start_day], ['lt', ($cur_time - $notify_time)], 'and'];
+        }
+
 
 
         $order_list = $model_refill_order->getMerchantOrderList($condition, '', 'refill_order.*,vr_order.order_state', 'refill_order.notify_time asc', 1000);

+ 119 - 0
admin/control/orderstats.php

@@ -3,6 +3,24 @@
 
 class orderstatsControl extends SystemControl
 {
+    private $task_type = [
+        'order_export' => '订单导出'
+    ];
+    private $type = [
+        'merchant' => '机构',
+        'provider' => '通道'
+    ];
+    private $order_time_type = [
+        'notify_time' => '回调时间',
+        'order_time' => '下单时间'
+    ];
+    private $task_state = [
+        1   => '待处理',
+        2   => '处理中',
+        3   => '已处理',
+        4   => '处理错误'
+    ];
+
     public function __construct()
     {
         parent::__construct();
@@ -121,4 +139,105 @@ class orderstatsControl extends SystemControl
         }
         return $result;
     }
+    public function refill_taskOp()
+    {
+        $model = Model('refill_task');
+        $condition['is_del'] = 0;
+        if(!empty($_GET['type'])) {
+            $condition['type'] = $_GET['type'];
+        }
+        if(!empty($_GET['cid'])) {
+            $condition['cid'] = $_GET['cid'];
+        }
+        $task_list = $model->getList($condition, 50);
+        foreach ($task_list as $key => $value) {
+            $task_list[$key]['condition'] = unserialize($value['task_condition']);
+        }
+
+        Tpl::output('list', $task_list);
+        Tpl::output('provider_list', $this->providers());
+        Tpl::output('merchant_list', $this->merchants());
+        Tpl::output('task_type', $this->task_type);
+        Tpl::output('type', $this->type);
+        Tpl::output('task_state', $this->task_state);
+        Tpl::output('order_time_type', $this->order_time_type);
+        Tpl::showpage('refill.task');
+    }
+
+    public function task_addOp()
+    {
+        if(chksubmit())
+        {
+            $obj_validate = new Validator();
+            $obj_validate->validateparam = [
+                ["input" => $_POST["task_type"], "require" => "true", "message" => '请选择任务类型'],
+                ["input" => $_POST["type"], "require" => "true", "message" => '请选择主体类型'],
+                ["input" => $_POST["body"], "require" => "true", "message" => '请选择统计主体'],
+                ["input" => $_POST["order_time_type"], "require" => "true", "message" => '请选择日期类型'],
+                ["input" => $_POST["query_start_time"], "require" => "true", "message" => '请选择统计日期'],
+            ];
+            $error = $obj_validate->validate();
+            if ($error != '') {
+                showMessage($error, '', '', 'error');
+            }
+            $body = explode('-', $_POST['body']);
+            $insert['task_type'] = $_POST['task_type'];
+            $insert['type'] = $_POST['type'];
+            $insert['cid'] = $body[0];
+            $insert['cname'] = $body[1];
+            $insert['add_time'] = time();
+
+            $order_time_type = $_POST['order_time_type'];
+            $condition['start_unixtime'] = intval(strtotime($_POST['query_start_time']));
+            $condition['end_unixtime'] = intval(strtotime($_POST['query_end_time']));
+            $condition['order_time_type'] = $order_time_type;
+            $condition['order_state'] = $_POST['order_state'] ?? '';
+
+            $hash = $this->task_hash_check($condition, $insert['task_type'], $insert['type']);
+            if($hash === false) {
+                showMessage('此任务已存在,如需重新执行,请删除已存在的任务');
+            }
+            $insert['task_hash'] = $hash;
+            $insert['task_condition'] = serialize($condition);
+
+            $model = Model('refill_task');
+            $resp = $model->insert($insert);
+            if($resp) {
+                showMessage('录入成功', 'index.php?act=OrderStats&&op=refill_task');
+            }else{
+                showMessage('任务添加失败');
+            }
+        }
+        else
+        {
+            Tpl::output('task_type', $this->task_type);
+            Tpl::output('type', $this->type);
+            Tpl::output('order_time_type', $this->order_time_type);
+            Tpl::showpage('refill.task.add');
+        }
+    }
+
+    private function task_hash_check($condition, $task_type, $type)
+    {
+        $model = Model('refill_task');
+        $hash = md5(serialize($condition) . $task_type . $type);
+        $check = $model->HashCheck($hash);
+        if($check) {
+            return $hash;
+        }else{
+            return false;
+        }
+    }
+
+    public function task_delOp()
+    {
+        $task_id = $_GET['task_id'];
+        $model = Model('refill_task');
+        $resp = $model->Del($task_id);
+        if($resp) {
+            showMessage('删除成功', 'index.php?act=OrderStats&&op=refill_task');
+        }else{
+            showMessage('任务删除失败');
+        }
+    }
 }

+ 2 - 3
admin/control/provider_ctl.php

@@ -49,8 +49,7 @@ class provider_ctlControl extends SystemControl
                 $index = "{$data['type']}-{$data['amount']}";
                 $result[$index][] = $data;
             }
-//            var_dump($result);die;
-//            Log::record("provider amount data:".json_encode($result),Log::DEBUG);
+
             wcache($rkey, ['data' => serialize($result)], 'provider-');
             showMessage('编辑成功');
         } else {
@@ -93,7 +92,7 @@ class provider_ctlControl extends SystemControl
                 }
             }
 
-            $ProviderManager = new \refill\ProviderManager();
+            $ProviderManager = new refill\ProviderManager();
             $ProviderManager->load();
             $QPTA = $ProviderManager->getQPTA();
             $QPTA = $QPTA[$quality[$form]];

+ 21 - 3
admin/control/provider_price.php

@@ -24,8 +24,16 @@ class provider_priceControl extends SystemControl
             showMessage('卡类型有误');
             exit;
         }
-
-        $providers = $this->providers(['type' => $card_type]);
+        $condition['type'] = $card_type;
+        $condition['opened'] = 1;
+        $all_providers = $this->providers($condition);
+        if(!empty($_GET['provider_id'])) {
+            $condition['provider_id'] = $_GET['provider_id'];
+        }
+        if(!empty($_GET['quality'])) {
+            $condition['qualitys'] = ['like', '%' . $_GET['quality'] . '%'];
+        }
+        $providers = $this->providers($condition);
 
         $data = [];
         foreach ($providers as $provider) {
@@ -38,12 +46,22 @@ class provider_priceControl extends SystemControl
             foreach ($card_types as $card_type) {
                 foreach ($specs as $spec) {
                     $key = "{$name}-{$card_type}-{$spec}";
-                    $price[$key] = $configs[$name][$key] ?? '/';
+                    if (!empty($configs[$name][$key]) && array_key_exists($key, $configs[$name])) {
+                        $price[$key] = $configs[$name][$key];
+                    } else {
+                        $price[$key] = '/';
+                    }
                 }
             }
             $data[$provider_id]['price'] = $price;
         }
+
+        $card_type_texts = [mtopcard\PetroChinaCard => '中石油', mtopcard\SinopecCard => '中石化', mtopcard\ChinaMobileCard => '中国移动', mtopcard\ChinaUnicomCard => '中国联通', mtopcard\ChinaTelecomCard => '中国电信'];
+        Tpl::output('provider_list', $all_providers);
+        Tpl::output('card_types', $card_types);
+        Tpl::output('card_type_text', $card_type_texts);
         Tpl::output('data', $data);
+        Tpl::output('specs', $specs);
         Tpl::showpage('provider.price');
     }
 

+ 6 - 2
admin/control/refill_order.php

@@ -86,12 +86,16 @@ class refill_orderControl extends SystemControl
         $start_unixtime = intval(strtotime($_GET['query_start_time']));
         $end_unixtime = intval(strtotime($_GET['query_end_time']));
 
+        if($end_unixtime <= 0) {
+            $end_unixtime = time();
+        }
+
         if ($start_unixtime > 0 && $end_unixtime > $start_unixtime) {
             $condition['refill_order.order_time'] = [['egt', $start_unixtime], ['lt', $end_unixtime], 'and'];
-            $condition['vr_order.add_time'] = ['egt', $start_unixtime-1];
+            $condition['vr_order.add_time'] = [['egt', $start_unixtime],['lt', $end_unixtime], 'and'];
         } elseif ($start_unixtime > 0) {
             $condition['refill_order.order_time'] = ['egt', $start_unixtime];
-            $condition['vr_order.add_time'] = ['egt', $start_unixtime-1];
+            $condition['vr_order.add_time'] = ['egt', $start_unixtime];
         } elseif ($end_unixtime > 0) {
             $condition['refill_order.order_time'] = ['lt', $end_unixtime];
         } else {

+ 1 - 1
admin/include/menu.php

@@ -113,7 +113,7 @@ $arr = array(
 					array('args'=>'index,refill_refund,merchant',			'text'=>'退款信息管理'),
 					array('args'=>'index,order_search,merchant',			'text'=>'客服订单查询'),
 					array('args'=>'index,refill_detail,merchant',			'text'=>'接单查询'),
-					array('args'=>'index,provider_price,merchant',			'text'=>'通道价格明细'),
+					array('args'=>'index,provider_price&card_type=2,merchant',			'text'=>'通道价格明细'),
 				)
 			),
 			4 => array(

+ 467 - 0
admin/templates/default/merchant.ctl.php

@@ -0,0 +1,467 @@
+<style>
+    .mleft {
+        margin-left: 45px;
+    }
+
+    hr {
+        border: none;
+        border-top: 1px solid #cbe9f3;
+        margin-bottom: 10px;
+        margin-top: 10px;
+    }
+    .page .fixed-bar .item-title h3 {
+        margin-top:18px !important;
+        margin-bottom:10px !important;
+        font-weight:700 !important;
+    }
+    .tab-base li span {
+        font-size:12px !important;
+    }
+</style>
+<?php defined('InShopNC') or exit('Access Invalid!'); ?>
+
+<div class="page">
+    <div class="fixed-bar">
+        <div class="item-title">
+            <h3><?php echo $lang['nc_merchant'] ?></h3>
+            <ul class="tab-base">
+                <li><a href="index.php?act=merchant&op=merchant"><span><?php echo $lang['nc_manage'] ?></span></a></li>
+                <li><a href="JavaScript:void(0);" class="current"><span>充值设置</span></a></li>
+            </ul>
+        </div>
+    </div>
+    <div class="fixed-empty"></div>
+    <form id="user_form" enctype="multipart/form-data" method="post">
+        <input type="hidden" name="form_submit" value="ok"/>
+        <input type="hidden" name="mchid" value="<?php echo $output['merchant']['mchid']; ?>"/>
+        <table class="table tb-type2">
+            <tbody>
+            <tr class="noborder">
+                <td colspan="2" class="required"><label class="validation">机构名称:</label></td>
+            </tr>
+            <tr class="noborder">
+                <td class="mleft"
+                    style="display: block"><?php echo "{$output['merchant']['mchid']} :{$output['merchant']['company_name']}"; ?></td>
+            </tr>
+
+            <tr class="noborder">
+                <td colspan="2" class="required"><label class="validation">拦截设置:</label></td>
+            </tr>
+            <tr class="noborder">
+                <td colspan="2" class="required mleft"><label style="display: inline-block;width: 46px;" class="mleft" for="name">转网:</label>
+                    <label>
+                        <input type="radio" name="is_transfer"
+                               value="1" <?php if ($output['intercept']['is_transfer'] === true) {
+                            echo 'checked';
+                        } ?>>
+                    </label>是
+                    <label>
+                        <input type="radio" name="is_transfer"
+                               value="0" <?php if ($output['intercept']['is_transfer'] === false) {
+                            echo 'checked';
+                        } ?>>
+                    </label>否
+                </td>
+            </tr>
+            <tr class="noborder">
+                <td colspan="2" class="required"><label class="mleft" for="name">状态码:</label>
+                    <?php foreach ($output['card_state'] as $key => $value) { ?>
+                        <?php if (!in_array($value, ['空号', '实号', '风险号']) && !in_array($key, [0, 1, 5])) { ?>
+                            <label>
+                            <input type="checkbox" name="card_states[]" value="<?php echo $key; ?>"
+                                <?php if (!empty($output['intercept']['card_states']) && in_array($key, $output['intercept']['card_states'])) {
+                                    echo 'checked';
+                                } ?>
+                            >
+                            </label><?php echo $value; ?>
+                        <?php } ?>
+                    <?php } ?>
+                </td>
+            </tr>
+
+            <tr class="noborder">
+                <td colspan="2" class="required"><label class="mleft" style="margin-right: 12px;" for="name">三网:</label>
+                    <label>
+                        <input type="checkbox" name="card_types[]" value="<?php echo mtopcard\ChinaMobileCard; ?>"
+                            <?php if (!empty($output['intercept']['card_types']) && in_array(mtopcard\ChinaMobileCard, $output['intercept']['card_types'])) {
+                                echo 'checked';
+                            } ?>>
+                    </label>移动
+                    <label>
+                        <input type="checkbox" name="card_types[]" value="<?php echo mtopcard\ChinaUnicomCard; ?>"
+                            <?php if (!empty($output['intercept']['card_types']) && in_array(mtopcard\ChinaUnicomCard, $output['intercept']['card_types'])) {
+                                echo 'checked';
+                            } ?>>
+                    </label>联通
+                    <label>
+                        <input type="checkbox" name="card_types[]" value="<?php echo mtopcard\ChinaTelecomCard; ?>"
+                            <?php if (!empty($output['intercept']['card_types']) && in_array(mtopcard\ChinaTelecomCard, $output['intercept']['card_types'])) {
+                                echo 'checked';
+                            } ?>>
+                    </label>电信
+                </td>
+            </tr>
+
+            <tr class="noborder">
+                <td>
+                    <hr>
+                </td>
+            </tr>
+
+            <tr class="noborder">
+                <td colspan="2" class="required"><label class="validation">高价补充条件:</label></td>
+            </tr>
+            <tr class="noborder">
+                <td colspan="2" class="required"><label style="margin-left: 45px; " for="name">成功率不低于:</label>
+                    <label for="success"></label><input id="success" type="text" name="ratio"
+                                                        value="<?php echo $output['retry_times']['lower_ratio']['ratio'] ?? 0; ?>" id="success">
+
+                    <label style="margin-left: 15px;" for="name">检测时间:</label>
+                    <label>
+                        <select name="period">
+                            <option value="3600" <?php if ($output['retry_times']['lower_ratio']['period'] == 3600) {
+                                echo 'selected';
+                            } ?>>3600
+                            </option>
+                            <option value="1800" <?php if ($output['retry_times']['lower_ratio']['period'] == 1800) {
+                                echo 'selected';
+                            } ?>>1800
+                            </option>
+                            <option value="900" <?php if ($output['retry_times']['lower_ratio']['period'] == 900) {
+                                echo 'selected';
+                            } ?>>900
+                            </option>
+                        </select>
+                    </label>
+                    <label for="name">( 秒 )</label>
+                </td>
+            </tr>
+
+            <tr class="noborder">
+                <td colspan="2" class="required"><label style="margin-left: 45px;display: inline-block;width: 84px" for="name">利润率低于:</label>
+                    <label>
+                        <input id="profit_ratio" type="text" name="profit_ratio"
+                               value="<?php echo $output['retry_times']['profit_ratio'] ?? 0;?>"
+                        >
+                    </label>
+                    <label style="margin-left: 15px;" for="name">时自动不补充</label>
+                </td>
+            </tr>
+
+            <tr class="noborder">
+                <td>
+                    <hr>
+                </td>
+            </tr>
+
+            <tr class="noborder">
+                <td colspan="2" class="required"><label class="validation">充值时间和次数设置:</label>
+                    <div style="margin-left:149px;">
+                        <label style="display: inline-block;">白天秒数</label>
+                        <label style="display: inline-block; margin: 0 145px 0 148px;">黑天秒数</label>
+                        <label style="display: inline-block;">重试次数</label>
+                    </div>
+                </td>
+            </tr>
+
+            <?php foreach ($output['quality'] as $key => $value) { ?>
+                <tr class="noborder">
+                    <td colspan="2" class="required judge">
+                        <label class="seconds"
+                               style="margin-left: 48px;display:inline-block;  margin-right: 16px; min-width: 38px"
+                               for="name"><?php echo $value; ?>:</label>
+                        <label>
+                            <input  class="day_secs" type="text" name="<?php echo "$key-day_secs"; ?>"
+                                    value="<?php echo $output['retry_times']['qualities'][$key]['day_secs'] ?? 0; ?>">
+                        </label>
+                        <label>
+                            <input  class="night_secs" style="margin: 0 30px;" type="text" name="<?php echo "$key-night_secs"; ?>"
+                                    value="<?php echo $output['retry_times']['qualities'][$key]['night_secs'] ?? 0; ?>">
+                        </label>
+                        <label>
+                            <input  class="times" type="text" name="<?php echo "$key-times"; ?>"
+                                    value="<?php echo $output['retry_times']['qualities'][$key]['times'] ?? 0; ?>">
+                        </label>
+                    </td>
+                </tr>
+            <?php } ?>
+
+            <tr>
+                <td colspan="2" class="required"><label class="validation" for="oil_quality">油卡通道质量:</label></td>
+            </tr>
+            <tr class="noborder">
+                <td class="vatop" style="display: block; margin-left: 43px;">
+                    <label>
+                        <input name="oil_quality" <?php if ($output['merchant']['oil_quality'] == refill\Quality::Normal) {
+                            echo 'checked';
+                        } ?> value="<?php echo refill\Quality::Normal; ?>" type="radio">
+                    </label>无流水
+                    <label>
+                        <input name="oil_quality" <?php if ($output['merchant']['oil_quality'] == refill\Quality::SlowTwentyFour) {
+                            echo 'checked';
+                        } ?> value="<?php echo refill\Quality::SlowTwentyFour; ?>" type="radio">
+                    </label>有流水
+                    <label>
+                        <input name="oil_quality" <?php if ($output['merchant']['oil_quality'] == refill\Quality::CardKey) {
+                            echo 'checked';
+                        } ?> value="<?php echo refill\Quality::CardKey; ?>" type="radio">
+                    </label>卡密
+                    <label>
+                        <input name="oil_quality" <?php if ($output['merchant']['oil_quality'] == refill\Quality::Quick) {
+                            echo 'checked';
+                        } ?> value="<?php echo refill\Quality::Quick; ?>" type="radio">
+                    </label>快充
+                    <label>
+                        <input name="oil_quality" <?php if ($output['merchant']['oil_quality'] == refill\Quality::OilSN_NONE_HAS) {
+                            echo 'checked';
+                        } ?> value="<?php echo refill\Quality::OilSN_NONE_HAS; ?>" type="radio">
+                    </label>无流水+有流水
+                    <label>
+                        <input name="oil_quality" <?php if ($output['merchant']['oil_quality'] == refill\Quality::OilSN_HAS_NONE) {
+                            echo 'checked';
+                        } ?> value="<?php echo refill\Quality::OilSN_HAS_NONE; ?>" type="radio">
+                    </label>有流水+无流水
+                    <label>
+                        <input name="oil_quality" <?php if ($output['merchant']['oil_quality'] == refill\Quality::OIL_SN_CARDKEY) {
+                            echo 'checked';
+                        } ?> value="<?php echo refill\Quality::OIL_SN_CARDKEY; ?>" type="radio">
+                    </label>有流水+卡密
+                    <label>
+                        <input name="oil_quality" <?php if ($output['merchant']['oil_quality'] == refill\Quality::OIL_SNNONE_CARDKEY) {
+                            echo 'checked';
+                        } ?> value="<?php echo refill\Quality::OIL_SNNONE_CARDKEY; ?>" type="radio">
+                    </label>无流水+卡密
+                    <label>
+                        <input name="oil_quality" <?php if ($output['merchant']['oil_quality'] == refill\Quality::OIL_SN_SNNONE_CARDKEY) {
+                            echo 'checked';
+                        } ?> value="<?php echo refill\Quality::OIL_SN_SNNONE_CARDKEY; ?>" type="radio">
+                    </label>有流水+无流水+卡密
+                    <label>
+                        <input name="oil_quality" <?php if ($output['merchant']['oil_quality'] == refill\Quality::OIL_SNNONE_SN_CARDKEY) {
+                            echo 'checked';
+                        } ?> value="<?php echo refill\Quality::OIL_SNNONE_SN_CARDKEY; ?>" type="radio">
+                    </label>无流水+有流水+卡密
+                    <label>
+                        <input name="oil_quality" <?php if ($output['merchant']['oil_quality'] == refill\Quality::OIL_SNNONE_SN_CARDKEY_QUICK) {
+                            echo 'checked';
+                        } ?> value="<?php echo refill\Quality::OIL_SNNONE_SN_CARDKEY_QUICK; ?>" type="radio">
+                    </label>无流水+有流水+卡密+快充
+                </td>
+            </tr>
+            <tr>
+                <td colspan="2" class="required"><label class="validation" for="quality">话费通道质量:</label></td>
+            </tr>
+            <tr class="noborder">
+                <td class="vatop" style="display: block; margin-left: 43px;">
+                    <label>
+                        <input name="quality" <?php if ($output['merchant']['quality'] == refill\Quality::Normal) {
+                            echo 'checked';
+                        } ?> value="<?php echo refill\Quality::Normal; ?>" type="radio">
+                    </label>普通
+                    <label>
+                        <input name="quality" <?php if ($output['merchant']['quality'] == refill\Quality::Quick) {
+                            echo 'checked';
+                        } ?> value="<?php echo refill\Quality::Quick; ?>" type="radio">
+                    </label>快速
+                    <label>
+                        <input name="quality" <?php if ($output['merchant']['quality'] == refill\Quality::CardKey) {
+                            echo 'checked';
+                        } ?> value="<?php echo refill\Quality::CardKey; ?>" type="radio">
+                    </label>卡密
+                    <label>
+                        <input name="quality" <?php if ($output['merchant']['quality'] == refill\Quality::ThirdShop) {
+                            echo 'checked';
+                        } ?> value="<?php echo refill\Quality::ThirdShop; ?>" type="radio">
+                    </label>三方
+                    <label>
+                        <input name="quality" <?php if ($output['merchant']['quality'] == refill\Quality::SlowTwentyFour) {
+                            echo 'checked';
+                        } ?> value="<?php echo refill\Quality::SlowTwentyFour; ?>" type="radio">
+                    </label>慢24
+                    <label>
+                        <input name="quality" <?php if ($output['merchant']['quality'] == refill\Quality::SlowSix) {
+                            echo 'checked';
+                        } ?> value="<?php echo refill\Quality::SlowSix; ?>" type="radio">
+                    </label>慢6
+                    <label>
+                        <input name="quality" <?php if ($output['merchant']['quality'] == refill\Quality::SlowTwo) {
+                            echo 'checked';
+                        } ?> value="<?php echo refill\Quality::SlowTwo; ?>" type="radio">
+                    </label>慢2
+                    <label>
+                        <input name="quality" <?php if ($output['merchant']['quality'] == refill\Quality::SlowFortyEight) {
+                            echo 'checked';
+                        } ?> value="<?php echo refill\Quality::SlowFortyEight; ?>" type="radio">
+                    </label>慢48
+                    <label>
+                        <input name="quality" <?php if ($output['merchant']['quality'] == refill\Quality::SlowSeventyTwo) {
+                            echo 'checked';
+                        } ?> value="<?php echo refill\Quality::SlowSeventyTwo; ?>" type="radio">
+                    </label>慢72
+                    <label>
+                        <input name="quality" <?php if ($output['merchant']['quality'] == refill\Quality::Fastest) {
+                            echo 'checked';
+                        } ?> value="<?php echo refill\Quality::Fastest; ?>" type="radio">
+                    </label>速充
+                    <label>
+                        <input name="quality" <?php if ($output['merchant']['quality'] == refill\Quality::SlowNormal) {
+                            echo 'checked';
+                        } ?> value="<?php echo refill\Quality::SlowNormal; ?>" type="radio">
+                    </label>慢充一次+普充
+                    <label>
+                        <input name="quality" <?php if ($output['merchant']['quality'] == refill\Quality::ThirdNormal) {
+                            echo 'checked';
+                        } ?> value="<?php echo refill\Quality::ThirdNormal; ?>" type="radio">
+                    </label>三方一次+普充
+                    <label>
+                        <input name="quality" <?php if ($output['merchant']['quality'] == refill\Quality::DefSuccess) {
+                            echo 'checked';
+                        } ?> value="<?php echo refill\Quality::DefSuccess; ?>" type="radio">
+                    </label>普充+卡密+快充
+                    <label>
+                        <input name="quality" <?php if ($output['merchant']['quality'] == refill\Quality::NormalQuick) {
+                            echo 'checked';
+                        } ?> value="<?php echo refill\Quality::NormalQuick; ?>" type="radio">
+                    </label>普充+快充
+                    <label>
+                        <input name="quality" <?php if ($output['merchant']['quality'] == refill\Quality::SlowSixNormal) {
+                            echo 'checked';
+                        } ?> value="<?php echo refill\Quality::SlowSixNormal; ?>" type="radio">
+                    </label>慢充6+普充
+                </td>
+            </tr>
+            </tbody>
+            <tfoot>
+            <tr class="tfoot">
+                <td colspan="15"><a href="JavaScript:void(0);" class="btn"
+                                    id="submitBtn"><span><?php echo $lang['nc_submit']; ?></span></a></td>
+            </tr>
+            </tfoot>
+        </table>
+    </form>
+</div>
+<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/js/dialog/dialog.js" id="dialog_js"
+        charset="utf-8"></script>
+<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/js/jquery-ui/jquery.ui.js"></script>
+<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/js/ajaxfileupload/ajaxfileupload.js"></script>
+<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/js/jquery.Jcrop/jquery.Jcrop.js"></script>
+<script type="text/javascript" src="<?php echo ADMIN_TEMPLATES_URL;?>/layui/layui.js"></script>
+<link rel="stylesheet" type="text/css" href="<?php echo ADMIN_TEMPLATES_URL; ?>/layui/css/layui.css"/>
+<link href="<?php echo RESOURCE_SITE_URL; ?>/js/jquery.Jcrop/jquery.Jcrop.min.css" rel="stylesheet" type="text/css"
+      id="cssfile2"/>
+<script type="text/javascript">
+    $(function () {
+        //按钮先执行验证再提交表单
+        let day
+        let nights
+        let times
+        $("#submitBtn").click(function () {
+            if (day == 0 || nights == 0 || times == 0) {
+                layer.msg('白天秒数,黑天秒数,重试次数(三者都需设置)');
+            } else {
+                $("#user_form").submit();
+            }
+        })
+        $('.required .day_secs').each(function(index, item) {
+            $(item).change(function() {
+                const day_secs = $(this).val()
+                const zero = day_secs.replace(/^[0]+/,'')
+                const zero_day = day_secs.substr(0, 1)
+                const zero_length = day_secs.substr(day_secs.length -1)
+                if (zero_day == 0) {
+                    $(this).val(zero_day);
+                }
+                if (zero_length != 0){
+                    console.log(zero, 123);
+                    $(item).val(zero);
+                }
+                if ((!/^\d+$/.test(day_secs)) || isNaN(day_secs)) {
+                    layer.msg('白天秒数只能设置大于0的整数');
+                    $(item).val("0");
+                }
+            })
+        })
+        $('.required .night_secs').each(function(index, item) {
+            $(item).change(function() {
+                const night_secs = $(this).val()
+                const zero = night_secs.replace(/^[0]+/,'')
+                const zero_day = night_secs.substr(0, 1)
+                const zero_length = night_secs.substr(night_secs.length -1)
+                if (zero_day == 0) {
+                    $(this).val(zero_day);
+                }
+                if (zero_length != 0){
+                    $(item).val(zero);
+                }
+                if ((!/^\d+$/.test(night_secs)) || isNaN(night_secs)) {
+                    layer.msg('黑天秒数只能设置大于0的整数');
+                    $(item).val("0");
+                }
+            })
+        })
+        $('.required .times').each(function(index, item) {
+            $(item).change(function() {
+                const times = $(this).val()
+                const zero = times.replace(/^[0]+/,'')
+                const zero_day = times.substr(0, 1)
+                const zero_length = times.substr(times.length -1)
+                if (zero_day == 0) {
+                    $(this).val(zero_day);
+                }
+                if (zero_length != 0){
+                    $(item).val(zero);
+                }
+                if ((!/^\d+$/.test(times)) || isNaN(times)) {
+                    layer.msg('重试次数只能设置大于0的整数');
+                    $(item).val("0");
+                }
+            })
+        })
+        $('#success').change(function(index, item) {
+            const success = $(this).val()
+            const intercept = success.substring(success.length, success.length-1)
+            if(intercept == '.') {
+                layer.msg('成功率只能设置浮点数');
+                $(this).val("0.00");
+                return
+            }
+            const zero = success.replace(/^0+\./g, '0.')
+            $(this).val(zero);
+            if ((/^(([0-9]+\\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\\.[0-9]+)|([0-9]*[1-9][0-9]*))$/.test(success)) || isNaN(success)){
+                layer.msg('成功率只能设置浮点数');
+                $(this).val("0.00");
+            }
+        })
+        $('#profit_ratio').change(function(index, item) {
+            const profit_ratio = $(this).val()
+            const intercept = profit_ratio.substring(profit_ratio.length, profit_ratio.length-1)
+            if(intercept == '.') {
+                layer.msg('利润率只能设置浮点数');
+                $(this).val("0.00");
+                return
+            }
+            const zero = profit_ratio.replace(/^0+\./g,'0.')
+            $(this).val(zero);
+            if ((/^(([0-9]+\\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\\.[0-9]+)|([0-9]*[1-9][0-9]*))$/.test(profit_ratio)) || isNaN(profit_ratio)){
+                layer.msg('利润率只能设置浮点数');
+                $(this).val("0.00");
+            }
+        })
+        $('.judge').each(function(index, item) {
+            let day_secs = $(item).find('.day_secs').val()
+            let night_secs = $(item).find('.night_secs').val()
+            let times_secs = $(item).find('.times').val()
+            $(item).change(function() {
+                let day_secs = $(item).find('.day_secs').val()
+                let night_secs = $(item).find('.night_secs').val()
+                let times_secs = $(item).find('.times').val()
+                day = day_secs
+                nights = night_secs
+                times = times_secs
+                if (day_secs == 0 || night_secs == 0 || times_secs == 0) {
+                    layer.msg('白天秒数,黑天秒数,重试次数(三者都需设置 只能设置大于0的整数)');
+                }
+            })
+        })
+    });
+</script>

+ 0 - 40
admin/templates/default/merchant.edit.php

@@ -73,46 +73,6 @@
                 <td class="vatop"><input type="text" id="night_timeout" name="night_timeout" class="txt" value="<?php echo $output['merchant']['night_timeout'];?>"></td>
                 <td class="vatop tips"></td>
             </tr>
-            <tr>
-                <td colspan="2" class="required"><label for="oil_quality">油卡通道质量:</label></td>
-            </tr>
-            <tr class="noborder">
-                <td class="vatop">
-                    <input name="oil_quality" <?php if($output['merchant']['oil_quality'] == refill\Quality::Normal){ echo 'checked';}?> value="<?php echo refill\Quality::Normal;?>" type="radio">无流水
-                    <input name="oil_quality" <?php if($output['merchant']['oil_quality'] == refill\Quality::SlowTwentyFour){ echo 'checked';}?> value="<?php echo refill\Quality::SlowTwentyFour;?>" type="radio">有流水
-                    <input name="oil_quality" <?php if($output['merchant']['oil_quality'] == refill\Quality::CardKey){ echo 'checked';}?> value="<?php echo refill\Quality::CardKey;?>" type="radio">卡密
-                    <input name="oil_quality" <?php if($output['merchant']['oil_quality'] == refill\Quality::Quick){ echo 'checked';}?> value="<?php echo refill\Quality::Quick;?>" type="radio">快充
-                    <input name="oil_quality" <?php if($output['merchant']['oil_quality'] == refill\Quality::OilSN_NONE_HAS){ echo 'checked';}?> value="<?php echo refill\Quality::OilSN_NONE_HAS;?>" type="radio">无流水+有流水
-                    <input name="oil_quality" <?php if($output['merchant']['oil_quality'] == refill\Quality::OilSN_HAS_NONE){ echo 'checked';}?> value="<?php echo refill\Quality::OilSN_HAS_NONE;?>" type="radio">有流水+无流水
-                    <input name="oil_quality" <?php if($output['merchant']['oil_quality'] == refill\Quality::OIL_SN_CARDKEY){ echo 'checked';}?> value="<?php echo refill\Quality::OIL_SN_CARDKEY;?>" type="radio">有流水+卡密
-                    <input name="oil_quality" <?php if($output['merchant']['oil_quality'] == refill\Quality::OIL_SNNONE_CARDKEY){ echo 'checked';}?> value="<?php echo refill\Quality::OIL_SNNONE_CARDKEY;?>" type="radio">无流水+卡密
-                    <input name="oil_quality" <?php if($output['merchant']['oil_quality'] == refill\Quality::OIL_SN_SNNONE_CARDKEY){ echo 'checked';}?> value="<?php echo refill\Quality::OIL_SN_SNNONE_CARDKEY;?>" type="radio">有流水+无流水+卡密
-                    <input name="oil_quality" <?php if($output['merchant']['oil_quality'] == refill\Quality::OIL_SNNONE_SN_CARDKEY){ echo 'checked';}?> value="<?php echo refill\Quality::OIL_SNNONE_SN_CARDKEY;?>" type="radio">无流水+有流水+卡密
-                    <input name="oil_quality" <?php if($output['merchant']['oil_quality'] == refill\Quality::OIL_SNNONE_SN_CARDKEY_QUICK){ echo 'checked';}?> value="<?php echo refill\Quality::OIL_SNNONE_SN_CARDKEY_QUICK;?>" type="radio">无流水+有流水+卡密+快充
-                </td>
-            </tr>
-            <tr>
-                <td colspan="2" class="required"><label for="quality">话费通道质量:</label></td>
-            </tr>
-            <tr class="noborder">
-                <td class="vatop">
-                    <input name="quality" <?php if($output['merchant']['quality'] == refill\Quality::Normal){ echo 'checked';}?> value="<?php echo refill\Quality::Normal;?>" type="radio">普通
-                    <input name="quality" <?php if($output['merchant']['quality'] == refill\Quality::Quick){ echo 'checked';}?> value="<?php echo refill\Quality::Quick;?>" type="radio">快速
-                    <input name="quality" <?php if($output['merchant']['quality'] == refill\Quality::CardKey){ echo 'checked';}?> value="<?php echo refill\Quality::CardKey;?>" type="radio">卡密
-                    <input name="quality" <?php if($output['merchant']['quality'] == refill\Quality::ThirdShop){ echo 'checked';}?> value="<?php echo refill\Quality::ThirdShop;?>" type="radio">三方
-                    <input name="quality" <?php if($output['merchant']['quality'] == refill\Quality::SlowTwentyFour){ echo 'checked';}?> value="<?php echo refill\Quality::SlowTwentyFour;?>" type="radio">慢24
-                    <input name="quality" <?php if($output['merchant']['quality'] == refill\Quality::SlowSix){ echo 'checked';}?> value="<?php echo refill\Quality::SlowSix;?>" type="radio">慢6
-                    <input name="quality" <?php if($output['merchant']['quality'] == refill\Quality::SlowTwo){ echo 'checked';}?> value="<?php echo refill\Quality::SlowTwo;?>" type="radio">慢2
-                    <input name="quality" <?php if($output['merchant']['quality'] == refill\Quality::SlowFortyEight){ echo 'checked';}?> value="<?php echo refill\Quality::SlowFortyEight;?>" type="radio">慢48
-                    <input name="quality" <?php if($output['merchant']['quality'] == refill\Quality::SlowSeventyTwo){ echo 'checked';}?> value="<?php echo refill\Quality::SlowSeventyTwo;?>" type="radio">慢72
-                    <input name="quality" <?php if($output['merchant']['quality'] == refill\Quality::Fastest){ echo 'checked';}?> value="<?php echo refill\Quality::Fastest;?>" type="radio">速充
-                    <input name="quality" <?php if($output['merchant']['quality'] == refill\Quality::SlowNormal){ echo 'checked';}?> value="<?php echo refill\Quality::SlowNormal;?>" type="radio">慢充一次+普充
-                    <input name="quality" <?php if($output['merchant']['quality'] == refill\Quality::ThirdNormal){ echo 'checked';}?> value="<?php echo refill\Quality::ThirdNormal;?>" type="radio">三方一次+普充
-                    <input name="quality" <?php if($output['merchant']['quality'] == refill\Quality::DefSuccess){ echo 'checked';}?> value="<?php echo refill\Quality::DefSuccess;?>" type="radio">普充+卡密+快充
-                    <input name="quality" <?php if($output['merchant']['quality'] == refill\Quality::NormalQuick){ echo 'checked';}?> value="<?php echo refill\Quality::NormalQuick;?>" type="radio">普充+快充
-                    <input name="quality" <?php if($output['merchant']['quality'] == refill\Quality::SlowSixNormal){ echo 'checked';}?> value="<?php echo refill\Quality::SlowSixNormal;?>" type="radio">慢充6+普充
-                </td>
-            </tr>
             </tbody>
             <tfoot>
             <tr class="tfoot">

+ 19 - 16
admin/templates/default/merchant.index.php

@@ -70,16 +70,16 @@ defined('InShopNC') or exit('Access Invalid!'); ?>
                 <th class="align-center"><?php echo $lang['merchant_name']; ?>编号</th>
                 <th class="align-left" style="text-align: left">机构账号</th>
                 <th class="align-center">会员ID</th>
-                <th class="align-left">机构公司名称</th>
-                <th class="align-right" style="text-align: right">所剩余额</th>
-                <th class="align-right" style="text-align: right">授信额度</th>
-                <th class="align-right" style="text-align: right">预警余额</th>
+                <th class="align-center">机构公司名称</th>
+                <th class="align-right">所剩余额</th>
+                <th class="align-right">授信额度</th>
+                <th class="align-right">预警余额</th>
                 <th class="align-center">机构状态</th>
                 <th class="align-left">上次登录ip</th>
                 <th class="align-left">上次登录日期</th>
                 <th class="align-center">加款操作</th>
                 <th class="align-center">机构操作</th>
-                <th class="align-center">充值操作(暂不生效)</th>
+                <th class="align-center">充值操作</th>
                 <th class="align-center"><?php echo $lang['operation']; ?></th>
             </tr>
             </thead>
@@ -91,8 +91,8 @@ defined('InShopNC') or exit('Access Invalid!'); ?>
                         <td class="align-center"><?php echo $v['mchid']; ?></td>
                         <td class="align-left"><?php echo $v['name']; ?></td>
                         <td class="align-center"><?php echo $v['admin_id']; ?></td>
-                        <td class="align-left"><?php echo $v['company_name']; ?></td>
-                        <td id="just" class="" style="text-align: right">
+                        <td class="align-center"><?php echo $v['company_name']; ?></td>
+                        <td id="just" class="align-right">
                             <?php if($v['available_predeposit'] > 0){?>
                                 <span style="color: #0bb20c">
                             <?php }?>
@@ -102,8 +102,8 @@ defined('InShopNC') or exit('Access Invalid!'); ?>
                             <?php echo $v['available_predeposit'];?>
                                 </span>
                         </td>
-                        <td style="text-align: right" class="align-right"><?php echo $v['credit_bonus']; ?></td>
-                        <td class="align-right" style="text-align: right"><?php echo $v['alarm_amount']; ?></td>
+                        <td class="align-right"><?php echo $v['credit_bonus']; ?></td>
+                        <td class="align-right"><?php echo $v['alarm_amount']; ?></td>
                         <td  class="align-center">
                             <?php if($v['merchant_state'] == 1){?>
                                 <span style="color: #0bb20c">
@@ -122,7 +122,7 @@ defined('InShopNC') or exit('Access Invalid!'); ?>
                             <a href="index.php?act=merchant&op=recharge_manual&type=edit&mchid=<?php echo $v['mchid'] ?>">调款</a>
                         </td>
                         <td class="align-center w200" id="mechanism">
-                            <a href="index.php?act=merchant&op=merchant_edit&mchid=<?php echo $v['mchid'] ?>">编辑</a>
+                            <a href="index.php?act=merchant&op=merchant_edit&mchid=<?php echo $v['mchid'] ?>">基础设置</a>
                             <?php if($v['merchant_state'] == 1){?>
                                 |
                                 <a class="closeall" href="index.php?act=merchant&op=changeState&state=2&mchid=<?php echo $v['mchid'] ?>" style="color: red">关闭机构</a>
@@ -133,13 +133,16 @@ defined('InShopNC') or exit('Access Invalid!'); ?>
                             <?php }?>
                         </td>
                         <td class="align-center">
-                            <a href="index.php?act=merchant&op=merchant_retry_times&mchid=<?php echo $v['mchid'] ?>">
-                                质量设置
-                            </a>
-                            |
-                            <a href="index.php?act=merchant&op=merchant_intercept&mchid=<?php echo $v['mchid'] ?>">
-                                拦截设置
+                            <a href="index.php?act=merchant&op=merchant_ctl&mchid=<?php echo $v['mchid'] ?>">
+                                充值设置
                             </a>
+<!--                            <a href="index.php?act=merchant&op=merchant_retry_times&mchid=--><?php //echo $v['mchid'] ?><!--">-->
+<!--                                质量设置-->
+<!--                            </a>-->
+<!--                            |-->
+<!--                            <a href="index.php?act=merchant&op=merchant_intercept&mchid=--><?php //echo $v['mchid'] ?><!--">-->
+<!--                                拦截设置-->
+<!--                            </a>-->
                         </td>
                         <td class="align-center w200">
                             <a href="index.php?act=merchant&op=price&quality=1&mchid=<?php echo $v['mchid'] ?>">通道费率设置</a>

+ 0 - 66
admin/templates/default/merchant.intercept.php

@@ -1,66 +0,0 @@
-<?php defined('InShopNC') or exit('Access Invalid!'); ?>
-
-<div class="page">
-    <div class="fixed-bar">
-        <div class="item-title">
-            <h3><?php echo $lang['nc_merchant'] ?></h3>
-            <ul class="tab-base">
-                <li><a href="index.php?act=merchant&op=merchant"><span><?php echo $lang['nc_manage'] ?></span></a></li>
-                <li><a href="JavaScript:void(0);" class="current"><span>拦截设置</span></a></li>
-            </ul>
-        </div>
-    </div>
-    <div class="fixed-empty"></div>
-    <form id="user_form" enctype="multipart/form-data" method="post">
-        <input type="hidden" name="form_submit" value="ok"/>
-        <input type="hidden" name="mchid" value="<?php echo $output['merchant']['mchid'];?>"/>
-        <table class="table tb-type2">
-            <tbody>
-            <tr class="noborder">
-                <td colspan="2"><label>机构名称:</label></td>
-            </tr>
-            <tr class="noborder">
-                <td><?php echo "{$output['merchant']['mchid']} :{$output['merchant']['company_name']}";?></td>
-            </tr>
-            <tr class="noborder">
-                <td colspan="2" class="required"><label for="name">是否拦截转网:</label>
-                <input type="radio" name="is_transfer" value="1" <?php if($output['intercept']['is_transfer'] == 1){ echo 'checked'; }?>>是
-                <input type="radio" name="is_transfer" value="0" <?php if($output['intercept']['is_transfer'] == 0){ echo 'checked'; }?>>否
-            </td>
-            </tr>
-            <tr class="noborder">
-                <td colspan="2" class="required"><label for="name">拦截号码状态:</label>
-                    <?php foreach ($output['card_state'] as $key => $value){?>
-                    <input type="checkbox" name="card_states[]" value="<?php echo $key;?>"
-                        <?php if( !empty($output['intercept']['card_states']) && in_array($key, $output['intercept']['card_states'])){ echo 'checked'; }?>
-                        ><?php echo $value;?>
-                    <?php }?>
-            </td>
-            </tr>
-            </tbody>
-            <tfoot>
-            <tr class="tfoot">
-                <td colspan="15"><a href="JavaScript:void(0);" class="btn"
-                                    id="submitBtn"><span><?php echo $lang['nc_submit']; ?></span></a></td>
-            </tr>
-            </tfoot>
-        </table>
-    </form>
-</div>
-<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/js/dialog/dialog.js" id="dialog_js"
-        charset="utf-8"></script>
-<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/js/jquery-ui/jquery.ui.js"></script>
-<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/js/ajaxfileupload/ajaxfileupload.js"></script>
-<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/js/jquery.Jcrop/jquery.Jcrop.js"></script>
-<link href="<?php echo RESOURCE_SITE_URL; ?>/js/jquery.Jcrop/jquery.Jcrop.min.css" rel="stylesheet" type="text/css"
-      id="cssfile2"/>
-<script type="text/javascript">
-    $(function () {
-        //按钮先执行验证再提交表单
-        $("#submitBtn").click(function () {
-            if ($("#user_form").valid()) {
-                $("#user_form").submit();
-            }
-        });
- });
-</script>

+ 2 - 0
admin/templates/default/merchant.order.stats.php

@@ -31,6 +31,8 @@
                 <li><a href="index.php?act=OrderStats&op=index&type=system"><span>平台对账记录</span></a></li>
                 <li><a href="index.php?act=OrderStats&op=index&type=provider"><span>上游对账记录</span></a></li>
                 <li><a href="JavaScript:void(0);" class="current"><span>下游对账记录</span></a></li>
+<!--                <li><a href="index.php?act=OrderStats&op=refill_task"><span>任务列表</span></a></li>-->
+<!--                <li><a href="index.php?act=OrderStats&op=task_add"><span>任务录入</span></a></li>-->
             </ul>
         </div>
     </div>

+ 111 - 85
admin/templates/default/merchant.ratios.php

@@ -11,8 +11,32 @@
     .layui-form-select .layui-input {
         height:26px;
     }
-    input::placeholder{ 
-        color:#333; 
+    input::placeholder{
+        color:#333;
+    }
+    #tablee tbody {
+        display:block;
+        height: 600px;
+        overflow-y:scroll;
+    }
+    #tablee thead,
+    .tbodyd tr {
+        display:table;
+        width:100%;
+        table-layout:fixed;
+    }
+    .w1pre {
+        width: 6%!important;
+    }
+    .w1p {
+        width: 3.5%!important;
+
+    }
+    #tablee thead {
+        width: calc( 100% - 1em )
+    }
+    .scrollTable .fixed-bar {
+        top: 115px!important;
     }
 </style>
 <div class="page">
@@ -33,11 +57,11 @@
         <div style="float: right; margin: 0px 69px 0 0">
             <p>三分钟:移 | 联 | 电(平均成功率/成功单量)</p>
             <?php if (!empty($output['list']) && is_array($output['list'])) { ?>
-            <p class="align-center"style=" margin: 7px 0">
-                <?php foreach ($output['stats'] as $stats){ ?>
-                    <?php echo (ncPriceFormat($stats['ratio'] / $stats['count']) * 100) ?? 0;?>%(<?php echo ncPriceFormat(($stats['success'] / $stats['count'])) ?? 0;?>)¥
-                <?php }?>
-            </p>
+                <p class="align-center"style=" margin: 7px 0">
+                    <?php foreach ($output['stats'] as $stats){ ?>
+                        <?php echo (ncPriceFormat($stats['ratio'] / $stats['count']) * 100) ?? 0;?>%(<?php echo ncPriceFormat(($stats['success'] / $stats['count'])) ?? 0;?>)¥
+                    <?php }?>
+                </p>
             <?php }else{?>
                 <p class="align-center"style=" margin: 7px 0">
                     0%(0)¥ 0%(0)¥ 0%(0)
@@ -51,84 +75,86 @@
             </tbody>
         </table>
     </form>
-    <form method="post" id="merchant_name_form">
+    <form method="post" id="merchant_name_form" class="scrollTable">
         <input type="hidden" name="form_submit" value="ok"/>
-        <table class="table tb-type2">
-            <thead>
-            <tr class="thead">
-                <th class="align-center w1pre">机构编码</th>
-                <th class="align-center w1pre">机构名称</th>
-                <th class="align-center w1pre">超时时间(秒)</th>
-                <th class="align-center w5pre">15分钟: 总(成功,失败,总订单数) <br> 移 | 联 | 电 (成功单量)</th>
-                <th class="align-center w10pre">30分钟</th>
-                <th class="align-center w10pre">1小时</th>
-                <th class="align-center w10pre">2小时</th>
-                <th class="align-center w10pre">当天</th>
-            </thead>
-            <tbody>
-            <?php if (!empty($output['list']) && is_array($output['list'])) { ?>
-                <?php foreach ($output['list'] as $k => $v) { ?>
-                    <tr class="trFlex">
-                        <td class="align-center"><?php echo $k;?></td>
-                        <td class="align-center"><?php echo $v['company_name'];?></td>
-                        <td class="align-center"><?php echo $v['time_out'];?></td>
-                        <td class="align-center">
-                            <?php if(($v['ratio']['ALL'][900][0] + $v['ratio']['ALL'][900][1]) > 0){?>
-                                <?php echo ($v['ratio']['ALL'][900][2] * 100) ?? 0;?>%(<span style="color: #2d7255; display: inline-block; padding-bottom: 4px;"><?php echo ($v['ratio']['ALL'][900][0]) ?? 0;?></span>,<span style="color: red;"><?php echo ($v['ratio']['ALL'][900][1]) ?? 0;?></span> ,<?php echo ($v['ratio']['ALL'][900][0] + $v['ratio']['ALL'][900][1]) ?? 0;?>) <br>
-                                <?php echo ($v['ratio']['YD'][900][2] * 100) ?? 0;?>%(<?php echo ($v['ratio']['YD'][900][0]) ?? 0;?>)¥<?php echo ($v['ratio']['LT'][900][2] * 100) ?? 0;?>%(<?php echo ($v['ratio']['LT'][900][0]) ?? 0;?>)¥<?php echo ($v['ratio']['DX'][900][2] * 100) ?? 0;?>%(<?php echo ($v['ratio']['DX'][900][0]) ?? 0;?>)
-                            <?php }else{?>
+        <div id='scrollTable' class="fixed-bar">
+            <table class="table tb-type2" id="tablee">
+                <thead>
+                <tr class="thead">
+                    <th class="align-center w1p">机构编码</th>
+                    <th class="align-center w1p">机构名称</th>
+                    <th class="align-center w1p">超时时间(秒)</th>
+                    <th class="align-center w10pre">15分钟: 总(成功,失败,总订单数) <br> 移 | 联 | 电 (成功单量)</th>
+                    <th class="align-center w10pre">30分钟</th>
+                    <th class="align-center w10pre">1小时</th>
+                    <th class="align-center w10pre">2小时</th>
+                    <th class="align-center w10pre">当天</th>
+                </thead>
+                <tbody class="tbodyd">
+                <?php if (!empty($output['list']) && is_array($output['list'])) { ?>
+                    <?php foreach ($output['list'] as $k => $v) { ?>
+                        <tr class="trFlex">
+                            <td class="align-center w1pre"><?php echo $k;?></td>
+                            <td class="align-center w1pre"><?php echo $v['company_name'];?></td>
+                            <td class="align-center w1pre"><?php echo $v['time_out'];?></td>
+                            <td class="align-center">
+                                <?php if(($v['ratio']['ALL'][900][0] + $v['ratio']['ALL'][900][1]) > 0){?>
+                                    <?php echo ($v['ratio']['ALL'][900][2] * 100) ?? 0;?>%(<span style="color: #2d7255; display: inline-block; padding-bottom: 4px;"><?php echo ($v['ratio']['ALL'][900][0]) ?? 0;?></span>,<span style="color: red;"><?php echo ($v['ratio']['ALL'][900][1]) ?? 0;?></span> ,<?php echo ($v['ratio']['ALL'][900][0] + $v['ratio']['ALL'][900][1]) ?? 0;?>) <br>
+                                    <?php echo ($v['ratio']['YD'][900][2] * 100) ?? 0;?>%(<?php echo ($v['ratio']['YD'][900][0]) ?? 0;?>)¥<?php echo ($v['ratio']['LT'][900][2] * 100) ?? 0;?>%(<?php echo ($v['ratio']['LT'][900][0]) ?? 0;?>)¥<?php echo ($v['ratio']['DX'][900][2] * 100) ?? 0;?>%(<?php echo ($v['ratio']['DX'][900][0]) ?? 0;?>)
+                                <?php }else{?>
+                                    ——
+                                <?php }?>
+                            </td>
+                            <td class="align-center">
+                                <?php if(($v['ratio']['ALL'][1800][0] + $v['ratio']['ALL'][1800][1]) > 0){?>
+                                    <?php echo ($v['ratio']['ALL'][1800][2] * 100) ?? 0;?>%(<span style="color: #2d7255;display: inline-block; padding-bottom: 4px;"><?php echo ($v['ratio']['ALL'][1800][0]) ?? 0;?></span>,<span style="color: red;"><?php echo ($v['ratio']['ALL'][1800][1]) ?? 0;?></span> ,<?php echo ($v['ratio']['ALL'][1800][0] + $v['ratio']['ALL'][1800][1]) ?? 0;?>) <br>
+                                    <?php echo ($v['ratio']['YD'][1800][2] * 100) ?? 0;?>%(<?php echo ($v['ratio']['YD'][1800][0]) ?? 0;?>)¥<?php echo ($v['ratio']['LT'][1800][2] * 100) ?? 0;?>%(<?php echo ($v['ratio']['LT'][1800][0]) ?? 0;?>)¥<?php echo ($v['ratio']['DX'][1800][2] * 100) ?? 0;?>%(<?php echo ($v['ratio']['DX'][1800][0]) ?? 0;?>)
+                                <?php }else{?>
+                                    ——
+                                <?php }?>
+                            </td>
+                            <td class="align-center">
+                                <?php if(($v['ratio']['ALL'][3600][0] + $v['ratio']['ALL'][3600][1]) > 0){?>
+                                    <?php echo ($v['ratio']['ALL'][3600][2] * 100) ?? 0;?>%(<span style="color: #2d7255;display: inline-block; padding-bottom: 4px;"><?php echo ($v['ratio']['ALL'][3600][0]) ?? 0;?></span>,<span style="color: red;"><?php echo ($v['ratio']['ALL'][3600][1]) ?? 0;?></span>,<?php echo ($v['ratio']['ALL'][3600][0] + $v['ratio']['ALL'][3600][1]) ?? 0;?>) <br>
+                                    <?php echo ($v['ratio']['YD'][3600][2] * 100) ?? 0;?>%(<?php echo ($v['ratio']['YD'][3600][0]) ?? 0;?>)¥<?php echo ($v['ratio']['LT'][3600][2] * 100) ?? 0;?>%(<?php echo ($v['ratio']['LT'][3600][0]) ?? 0;?>)¥<?php echo ($v['ratio']['DX'][3600][2] * 100) ?? 0;?>%(<?php echo ($v['ratio']['DX'][3600][0]) ?? 0;?>)
+                                <?php }else{?>
+                                    ——
+                                <?php }?>
+                            </td>
+                            <td class="align-center">
+                                <?php if(($v['ratio']['ALL'][7200][0] + $v['ratio']['ALL'][7200][1]) > 0){?>
+                                    <?php echo ($v['ratio']['ALL'][7200][2] * 100) ?? 0;?>%(<span style="color: #2d7255;display: inline-block; padding-bottom: 4px;"><?php echo ($v['ratio']['ALL'][7200][0]) ?? 0;?></span>,<span style="color: red;"><?php echo ($v['ratio']['ALL'][7200][1]) ?? 0;?></span>,<?php echo ($v['ratio']['ALL'][7200][0] + $v['ratio']['ALL'][7200][1]) ?? 0;?>) <br>
+                                    <?php echo ($v['ratio']['YD'][7200][2] * 100) ?? 0;?>%(<?php echo ($v['ratio']['YD'][7200][0]) ?? 0;?>)¥<?php echo ($v['ratio']['LT'][7200][2] * 100) ?? 0;?>%(<?php echo ($v['ratio']['LT'][7200][0]) ?? 0;?>)¥<?php echo ($v['ratio']['DX'][7200][2] * 100) ?? 0;?>%(<?php echo ($v['ratio']['DX'][7200][0]) ?? 0;?>)
+                                <?php }else{?>
+                                    ——
+                                <?php }?>
+                            </td>
+                            <td class="align-center">
+                                <?php if(($v['ratio']['ALL'][86400][0] + $v['ratio']['ALL'][86400][1]) > 0){?>
+                                    <?php echo ($v['ratio']['ALL'][86400][2] * 100) ?? 0;?>%(<span style="color: #2d7255;display: inline-block; padding-bottom: 4px;"><?php echo ($v['ratio']['ALL'][86400][0]) ?? 0;?></span>,<span style="color: red;"><?php echo ($v['ratio']['ALL'][86400][1]) ?? 0;?></span>,<?php echo ($v['ratio']['ALL'][86400][0] + $v['ratio']['ALL'][86400][1]) ?? 0;?>) <br>
+                                    <?php echo ($v['ratio']['YD'][86400][2] * 100) ?? 0;?>%(<?php echo ($v['ratio']['YD'][86400][0]) ?? 0;?>)¥<?php echo ($v['ratio']['LT'][86400][2] * 100) ?? 0;?>%(<?php echo ($v['ratio']['LT'][86400][0]) ?? 0;?>)¥<?php echo ($v['ratio']['DX'][86400][2] * 100) ?? 0;?>%(<?php echo ($v['ratio']['DX'][86400][0]) ?? 0;?>)
+                                <?php }else{?>
                                     ——
-                            <?php }?>
-                        </td>
-                        <td class="align-center">
-                            <?php if(($v['ratio']['ALL'][1800][0] + $v['ratio']['ALL'][1800][1]) > 0){?>
-                                <?php echo ($v['ratio']['ALL'][1800][2] * 100) ?? 0;?>%(<span style="color: #2d7255;display: inline-block; padding-bottom: 4px;"><?php echo ($v['ratio']['ALL'][1800][0]) ?? 0;?></span>,<span style="color: red;"><?php echo ($v['ratio']['ALL'][1800][1]) ?? 0;?></span> ,<?php echo ($v['ratio']['ALL'][1800][0] + $v['ratio']['ALL'][1800][1]) ?? 0;?>) <br>
-                                <?php echo ($v['ratio']['YD'][1800][2] * 100) ?? 0;?>%(<?php echo ($v['ratio']['YD'][1800][0]) ?? 0;?>)¥<?php echo ($v['ratio']['LT'][1800][2] * 100) ?? 0;?>%(<?php echo ($v['ratio']['LT'][1800][0]) ?? 0;?>)¥<?php echo ($v['ratio']['DX'][1800][2] * 100) ?? 0;?>%(<?php echo ($v['ratio']['DX'][1800][0]) ?? 0;?>)
-                            <?php }else{?>
-                                    —— 
-                            <?php }?>
-                        </td>
-                        <td class="align-center">
-                            <?php if(($v['ratio']['ALL'][3600][0] + $v['ratio']['ALL'][3600][1]) > 0){?>
-                                <?php echo ($v['ratio']['ALL'][3600][2] * 100) ?? 0;?>%(<span style="color: #2d7255;display: inline-block; padding-bottom: 4px;"><?php echo ($v['ratio']['ALL'][3600][0]) ?? 0;?></span>,<span style="color: red;"><?php echo ($v['ratio']['ALL'][3600][1]) ?? 0;?></span>,<?php echo ($v['ratio']['ALL'][3600][0] + $v['ratio']['ALL'][3600][1]) ?? 0;?>) <br>
-                                <?php echo ($v['ratio']['YD'][3600][2] * 100) ?? 0;?>%(<?php echo ($v['ratio']['YD'][3600][0]) ?? 0;?>)¥<?php echo ($v['ratio']['LT'][3600][2] * 100) ?? 0;?>%(<?php echo ($v['ratio']['LT'][3600][0]) ?? 0;?>)¥<?php echo ($v['ratio']['DX'][3600][2] * 100) ?? 0;?>%(<?php echo ($v['ratio']['DX'][3600][0]) ?? 0;?>)
-                            <?php }else{?>
-                                ——                                
-                            <?php }?>
-                        </td>
-                        <td class="align-center">
-                            <?php if(($v['ratio']['ALL'][7200][0] + $v['ratio']['ALL'][7200][1]) > 0){?>
-                                <?php echo ($v['ratio']['ALL'][7200][2] * 100) ?? 0;?>%(<span style="color: #2d7255;display: inline-block; padding-bottom: 4px;"><?php echo ($v['ratio']['ALL'][7200][0]) ?? 0;?></span>,<span style="color: red;"><?php echo ($v['ratio']['ALL'][7200][1]) ?? 0;?></span>,<?php echo ($v['ratio']['ALL'][7200][0] + $v['ratio']['ALL'][7200][1]) ?? 0;?>) <br>
-                                <?php echo ($v['ratio']['YD'][7200][2] * 100) ?? 0;?>%(<?php echo ($v['ratio']['YD'][7200][0]) ?? 0;?>)¥<?php echo ($v['ratio']['LT'][7200][2] * 100) ?? 0;?>%(<?php echo ($v['ratio']['LT'][7200][0]) ?? 0;?>)¥<?php echo ($v['ratio']['DX'][7200][2] * 100) ?? 0;?>%(<?php echo ($v['ratio']['DX'][7200][0]) ?? 0;?>)
-                            <?php }else{?>
-                                —— 
-                            <?php }?>
-                        </td>
-                        <td class="align-center">
-                            <?php if(($v['ratio']['ALL'][86400][0] + $v['ratio']['ALL'][86400][1]) > 0){?>
-                                <?php echo ($v['ratio']['ALL'][86400][2] * 100) ?? 0;?>%(<span style="color: #2d7255;display: inline-block; padding-bottom: 4px;"><?php echo ($v['ratio']['ALL'][86400][0]) ?? 0;?></span>,<span style="color: red;"><?php echo ($v['ratio']['ALL'][86400][1]) ?? 0;?></span>,<?php echo ($v['ratio']['ALL'][86400][0] + $v['ratio']['ALL'][86400][1]) ?? 0;?>) <br>
-                                <?php echo ($v['ratio']['YD'][86400][2] * 100) ?? 0;?>%(<?php echo ($v['ratio']['YD'][86400][0]) ?? 0;?>)¥<?php echo ($v['ratio']['LT'][86400][2] * 100) ?? 0;?>%(<?php echo ($v['ratio']['LT'][86400][0]) ?? 0;?>)¥<?php echo ($v['ratio']['DX'][86400][2] * 100) ?? 0;?>%(<?php echo ($v['ratio']['DX'][86400][0]) ?? 0;?>)
-                            <?php }else{?>
-                                —— 
-                            <?php }?>
-                        </td>
+                                <?php }?>
+                            </td>
+                        </tr>
+                    <?php } ?>
+                <?php } else { ?>
+                    <tr class="no_data">
+                        <td colspan="8"><?php echo $lang['nc_no_record']; ?></td>
                     </tr>
                 <?php } ?>
-            <?php } else { ?>
-                <tr class="no_data">
-                    <td colspan="8"><?php echo $lang['nc_no_record']; ?></td>
+                </tbody>
+                <tfoot>
+                <tr class="tfoot">
+                    <td></td>
+                    <td colspan="8">
+                        <div class="pagination"><?php echo $output['show_page']; ?></div>
+                    </td>
                 </tr>
-            <?php } ?>
-            </tbody>
-            <tfoot>
-            <tr class="tfoot">
-                <td></td>
-                <td colspan="8">
-                    <div class="pagination"><?php echo $output['show_page']; ?></div>
-                </td>
-            </tr>
-            </tfoot>
-        </table>
+                </tfoot>
+            </table>
+        </div>
         <!-- <span style="color: red;font-size: 16px;">移 | 联 | 电</span> -->
     </form>
 </div>
@@ -152,13 +178,13 @@
         });
         // 表格hover时背景
         $('.trFlex').each(function () {
-            $("tbody>tr:odd").css("background-color","#FEF2E8");  
-            $("tbody>tr:even").css("background-color","#f5f6ff"); 
+            $("tbody>tr:odd").css("background-color","#FEF2E8");
+            $("tbody>tr:even").css("background-color","#f5f6ff");
             $(this).hover(function () {
-            $(this)[0].style.backgroundColor = '#cbe9f3'
+                $(this)[0].style.backgroundColor = '#cbe9f3'
             },function() {
-            $("tbody>tr:odd").css("background-color","#FEF2E8");  
-            $("tbody>tr:even").css("background-color","#f5f6ff"); 
+                $("tbody>tr:odd").css("background-color","#FEF2E8");
+                $("tbody>tr:even").css("background-color","#f5f6ff");
             })
         })
         // 导出

+ 4 - 4
admin/templates/default/merchant.refill.evidence_list.php

@@ -178,10 +178,10 @@
                 <th>申请编号</th>
                 <th>机构名称</th>
                 <th>申请金额</th>
-                <th>申请后可用金额</th>
                 <th class="align-center">转账银行开户人姓名</th>
                 <th class="align-center">转账银行名称</th>
                 <th class="align-center">收款银行</th>
+                <th>申请后可用金额</th>
                 <th class="align-center">是否银行转账</th>
                 <th class="align-center">申请状态</th>
                 <th class="align-center">预存状态</th>
@@ -200,6 +200,9 @@
                         <td><?php echo $v['apply_id']; ?></td>
                         <td><?php echo $v['mch_name']; ?></td>
                         <td><?php echo $v['amount']*100%100==0 ? intval($v['amount']) : $v['amount']; ?> (<?php echo $v['amount']>=10000 ? $v['amount']/10000 .'万' : $v['amount'] . '元';?>)</td>
+                        <td class="align-left"><?php echo $v['bank_username']; ?></td>
+                        <td class="align-left"><?php echo $v['bank_name']; ?></td>
+                        <td class="align-left"><?php echo $v['receive_bank'] ? $output['receive_bank_text'][$v['receive_bank']-1] : '/'; ?></td>
                         <td>
                             <?php if ($v['is_operation'] == 1 && $v['status'] !=3 ){
                                 echo ncPriceFormat($v['available_predeposit'] + $v['amount']);
@@ -207,9 +210,6 @@
                                 echo  $v['after_available'] == 0 ? '/' :  $v['after_available'];
                             }?>
                         </td>
-                        <td class="align-left"><?php echo $v['bank_username']; ?></td>
-                        <td class="align-left"><?php echo $v['bank_name']; ?></td>
-                        <td class="align-left"><?php echo $v['receive_bank'] ? $output['receive_bank_text'][$v['receive_bank']-1] : '/'; ?></td>
                         <td class="align-center"><?php echo $v['is_bank_text']; ?></td>
                         <td class="align-center">
                             <?php if ($v['status'] == 1){ ?>

+ 0 - 152
admin/templates/default/merchant.retry.times.php

@@ -1,152 +0,0 @@
-<style>
-    .open {
-    display: inline-block;
-    vertical-align: text-bottom;
-    margin-right: 20px;
-    margin-left: 5px;
-    }
-    .page .fixed-bar .item-title h3 {
-        margin-top:18px !important;
-        margin-bottom:10px !important;
-        font-weight:700 !important;
-    }
-    .tab-base li span {
-        font-size:12px !important;
-    }
-</style>
-<?php defined('InShopNC') or exit('Access Invalid!'); ?>
-
-<div class="page">
-    <div class="fixed-bar">
-        <div class="item-title">
-            <h3><?php echo $lang['nc_merchant'] ?></h3>
-            <ul class="tab-base">
-                <li><a href="index.php?act=merchant&op=merchant"><span><?php echo $lang['nc_manage'] ?></span></a></li>
-                <li><a href="JavaScript:void(0);" class="current"><span>质量设置</span></a></li>
-            </ul>
-        </div>
-    </div>
-    <div class="fixed-empty"></div>
-    <form id="user_form" enctype="multipart/form-data" method="post">
-        <input type="hidden" name="form_submit" value="ok"/>
-        <input type="hidden" name="mchid" value="<?php echo $output['merchant']['mchid'];?>"/>
-        <table class="table tb-type2">
-            <tbody>
-            <tr class="noborder">
-                <td colspan="2"><label class="validation">机构名称:</label></td>
-            </tr>
-            <tr class="noborder">
-                <td>
-                <label style="margin-left: 16px;" for="name"><?php echo "{$output['merchant']['mchid']} :{$output['merchant']['company_name']}";?></label>
-                
-            </td>
-            </tr>
-            <tr class="noborder">
-                <td colspan="2" class="required"><label class="validation" for="name">开启状态:</label>
-                开启<input type="radio" class="open" name="opened" value="1" <?php if($output['retry_times']['opened'] == 1){ echo 'checked'; }?>>
-                关闭<input type="radio" class="open" name="opened" value="0" <?php if($output['retry_times']['opened'] == 0){ echo 'checked'; }?>>
-            </td>
-            </tr>
-            <tr class="noborder">
-                <td colspan="2" class="required"><label class="validation" for="name">检测条件:</label>
-            </td>
-            </tr>
-            <tr class="noborder">
-            <td colspan="2" class="required"><label style="margin-left: 16px;" for="name">成功率:</label>
-            <input type="text" name="ratio" value="<?php echo $output['retry_times']['lower_ratio']['ratio'] ?? 0;?>" id="success">
-            <label style="margin-left: 15px;" for="name">时间期限(秒):</label>
-            <input type="text" name="period" value="<?php echo $output['retry_times']['lower_ratio']['period'] ?? 0;?>" id="term">
-
-            </td>
-            </tr>
-            <tr class="noborder">
-                <td colspan="2" class="required"><label  class="validation" for="name">质量设置:</label>
-            </td>
-            </tr>
-            <?php foreach($output['quality'] as $key => $value){?>
-            <tr class="noborder">
-                <td colspan="2" class="required">
-                    <label class="seconds" style="margin-left: 16px;display:inline-block;  margin-right: 16px; min-width: 38px" for="name"><?php echo $value;?>:</label>
-                    <label for="name">秒数:</label>
-                    <input type="text" name="<?php echo "{$key}-secs";?>" value="<?php echo $output['retry_times']['qualities'][$key]['secs'] ?? 0;?>" class="secondss">
-                    <label style="margin-left: 15px;" for="name">重试次数:</label>
-                    <input type="text" name="<?php echo "{$key}-times";?>" value="<?php echo $output['retry_times']['qualities'][$key]['times'] ?? 0;?>" class="frequency">
-                </td>
-            </tr>
-            <?php }?>
-            </tbody>
-            <tfoot>
-            <tr class="tfoot">
-                <td colspan="15"><a href="JavaScript:void(0);" class="btn"
-                                    id="submitBtn"><span><?php echo $lang['nc_submit']; ?></span></a></td>
-            </tr>
-            </tfoot>
-        </table>
-    </form>
-</div>
-<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/js/dialog/dialog.js" id="dialog_js"
-        charset="utf-8"></script>
-<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/js/jquery-ui/jquery.ui.js"></script>
-<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/js/ajaxfileupload/ajaxfileupload.js"></script>
-<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/js/jquery.Jcrop/jquery.Jcrop.js"></script>
-<script type="text/javascript" src="<?php echo ADMIN_TEMPLATES_URL;?>/layui/layui.js"></script>
-<link rel="stylesheet" type="text/css" href="<?php echo ADMIN_TEMPLATES_URL; ?>/layui/css/layui.css"/>
-<link href="<?php echo RESOURCE_SITE_URL; ?>/js/jquery.Jcrop/jquery.Jcrop.min.css" rel="stylesheet" type="text/css"
-      id="cssfile2"/>
-<script type="text/javascript">
-    $(function () {
-        //按钮先执行验证再提交表单
-        $("#submitBtn").click(function () {
-            if ($("#user_form").valid()) {
-                $("#user_form").submit();
-            }
-        });
-        
-        // 成功率
-        $('#success').change(function() {
-           const negative = $(this).val();
-        // 保留两位小数
-           const decimal = negative.replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3')
-           $(this).val(decimal);
-
-           if (negative < 0 || isNaN(negative)) {
-            layer.msg('成功率不能设置负数和字母');
-            $(this).val("");
-
-           }
-        })
-        
-        // 时间期限
-        $('#term').change(function() {
-           const negative = $(this).val();
-           if (negative < 0 || isNaN(negative)) {
-            layer.msg('时间期限只能设置大于0的数');
-            $(this).val("");
-           }
-        })
-        
-        // 秒数
-        $('.secondss').each(function(index, item) {
-           $(item).change(function() {
-           const negative = $(this).val();
-            if (negative < 0 || isNaN(negative)) {
-            layer.msg('秒数只能设置大于0的数');
-            $(item).val("");
-           }
-           })
-         
-        })
-        // 重试次数
-        $('.frequency').each(function(index, item) {
-            $(item).change(function() {
-                const negative = $(this).val();
-           if (negative < 0 || isNaN(negative)) {
-            layer.msg('重试次数只能设置大于0的数');
-            $(item).val("");
-
-           }
-            })
-    
-        })
-    });
-</script>

+ 2 - 0
admin/templates/default/provider.order.stats.php

@@ -31,6 +31,8 @@
                 <li><a href="index.php?act=OrderStats&op=index&type=system"><span>平台对账记录</span></a></li>
                 <li><a href="JavaScript:void(0);" class="current"><span>上游对账记录</span></a></li>
                 <li><a href="index.php?act=OrderStats&op=index&type=merchant"><span>下游对账记录</span></a></li>
+<!--                <li><a href="index.php?act=OrderStats&op=refill_task"><span>任务列表</span></a></li>-->
+<!--                <li><a href="index.php?act=OrderStats&op=task_add"><span>任务录入</span></a></li>-->
             </ul>
         </div>
     </div>

+ 173 - 299
admin/templates/default/provider.price.php

@@ -1,5 +1,7 @@
 <?php defined('InShopNC') or exit('Access Invalid!'); ?>
 <style>
+    
+
     .page .fixed-bar .item-title h3 {
         margin-top:18px !important;
         margin-bottom:10px !important;
@@ -14,314 +16,139 @@
     input::placeholder{ 
         color:#333; 
     }
+    #tablee tbody {
+        display:block;
+        height: 600px;
+        overflow-y:scroll;
+    }
+    #tablee thead,
+    .tbodyd tr {
+        display:table;
+        width:100%;
+        table-layout:fixed;
+    }
+    #tablee thead {
+        width: calc( 100% - 1em )
+    }
+    .scrollTable .fixed-bar {
+        top: 115px!important;
+    }
+    .tbodyd tr:hover { background-color : #cbe9f3!important;}
+    .tbodyd tr:hover td { background : none!important;}
+
 </style>
 <div class="page">
     <div class="fixed-bar">
         <div class="item-title">
             <h3>通道金额明细</h3>
             <ul class="tab-base">
-                <li><a href="JavaScript:void(0);" class="current" ><span>折扣明细</span></a></li>
+                <li><a href="index.php?act=provider_price&op=index&card_type=<?php echo mtopcard\PhoneCardPaper?>" class="classA" data-type="<?php echo mtopcard\PhoneCardPaper;?>"><span>话费折扣</span></a></li>
+                <li><a href="index.php?act=provider_price&op=index&card_type=<?php echo mtopcard\OilCardPaper?>" class="classA" data-type="<?php echo mtopcard\OilCardPaper?>"><span>油卡折扣</span></a></li>
             </ul>
         </div>
     </div>
     <div class="fixed-empty"></div>
     <form method="get" name="formSearch" id="formSearch" class="layui-form">
-        <input type="hidden" value="refill_refund" name="act">
-        <input type="hidden" value="merchant_ratios" name="op">
+        <input type="hidden" value="provider_price" name="act">
+        <input type="hidden" value="index" name="op">
+        <input type="hidden" name="export" value=""/>
         <table class="tb-type1 noborder search">
-            <tbody>
+            <tbody id="tableHread">
             <tr>
+                <th><label>通道名称</label></th>
+                <td>
+                    <select name="provider_id" class="querySelect" lay-verify="" lay-search>
+                        <option value=""><?php echo $lang['nc_please_choose']; ?></option>
+                        <?php foreach($output['provider_list'] as $provider){?>
+                            <option value="<?php echo $provider['provider_id']?>"
+                                    <?php if ($_GET['provider_id'] == $provider['provider_id']){ ?>selected<?php } ?>><?php echo $provider['store_name']?>
+                            </option>
+                        <?php }?>
+                    </select>
+                </td>
+
+                <th><label style="margin-left: 15px;">通道质量</label></th>
+                <td>
+                    <select name="quality" class="querySelect">
+                        <option value=""><?php echo $lang['nc_please_choose']; ?></option>
+                        <option value="<?php echo refill\Quality::Normal;?>"
+                                <?php if ($_GET['quality'] == refill\Quality::Normal){ ?>selected<?php } ?>>普充(无流水)
+                        </option>
+                        <option value="<?php echo refill\Quality::Quick;?>"
+                                <?php if ($_GET['quality'] == refill\Quality::Quick){ ?>selected<?php } ?>>快充
+                        </option>
+                        <option value="<?php echo refill\Quality::CardKey;?>"
+                                <?php if ($_GET['quality'] == refill\Quality::CardKey){ ?>selected<?php } ?>>卡密
+                        </option>
+                        <option value="<?php echo refill\Quality::ThirdShop;?>"
+                                <?php if ($_GET['quality'] == refill\Quality::ThirdShop){ ?>selected<?php } ?>>三方
+                        </option>
+                        <option value="<?php echo refill\Quality::SlowTwentyFour;?>"
+                                <?php if ($_GET['quality'] == refill\Quality::SlowTwentyFour){ ?>selected<?php } ?>>慢24(有流水)
+                        </option>
+                        <option value="<?php echo refill\Quality::SlowSix;?>"
+                                <?php if ($_GET['quality'] == refill\Quality::SlowSix){ ?>selected<?php } ?>>慢6
+                        </option>
+                        <option value="<?php echo refill\Quality::SlowTwo;?>"
+                                <?php if ($_GET['quality'] == refill\Quality::SlowTwo){ ?>selected<?php } ?>>慢2
+                        </option>
+                        <option value="<?php echo refill\Quality::SlowFortyEight;?>"
+                                <?php if ($_GET['quality'] == refill\Quality::SlowFortyEight){ ?>selected<?php } ?>>慢48
+                        </option>
+                        <option value="<?php echo refill\Quality::SlowSeventyTwo;?>"
+                                <?php if ($_GET['quality'] == refill\Quality::SlowSeventyTwo){ ?>selected<?php } ?>>慢72
+                        </option>
+                        <option value="<?php echo refill\Quality::Fastest;?>"
+                                <?php if ($_GET['quality'] == refill\Quality::Fastest){ ?>selected<?php } ?>>速充
+                        </option>
+                    </select>
+                </td>
+                <td>
+                    <a style="margin-left: 15px;" href="javascript:void(0);" id="ncsubmit" class="btn-search "
+                       title="<?php echo $lang['nc_query']; ?>">&nbsp;</a>
+                </td>
             </tr>
             </tbody>
         </table>
     </form>
-    <form method="post" id="merchant_name_form">
+    <form method="post" id="merchant_name_form" class="scrollTable">
         <input type="hidden" name="form_submit" value="ok"/>
-        <table class="table tb-type2">
-            <thead>
+        <div id='scrollTable' class="fixed-bar">
+        <table style="width: 100%" class="table tb-type2" id="tablee">
+            <thead id="tbody">
+            <tr class="thead">
+                <th rowspan="2" class="align-center">通道ID</th>
+                <th rowspan="2" class="align-center">通道名称</th>
+                <?php foreach ($output['card_types'] as $card_type) {?>
+                    <th colspan="<?php echo count($output['specs']);?>" class="align-center" data-type="<?php echo $card_type;?>">
+                        <?php echo $output['card_type_text'][$card_type];?>
+                    </th>
+                <?php }?>
+            </tr> 
+            
             <tr class="thead">
-                <th class="align-center w1pre">通道组ID</th>
-                <th class="align-center w1pre">通道组名称</th>
-                <th class="align-center w1pre">通道组编码</th>
-                <th class="align-center">10元</th>
-                <th class="align-center">20元</th>
-                <th class="align-center">30元</th>
-                <th class="align-center">50元</th>
-                <th class="align-center">100元</th>
-                <th class="align-center">200元</th>
-                <th class="align-center">300元</th>
-                <th class="align-center">500元</th>
-                <th class="align-center">1000元</th>
-                <th class="align-center">2000元</th>
-                <th class="align-center">实时余额</th>
+                <?php foreach ($output['card_types'] as $card_type) {?>
+                <?php foreach ($output['specs'] as $spec){ ?>
+                        <th class="align-center" data-type="<?php echo $card_type;?>"><?php echo $spec;?>元</th>
+                    <?php }?>
+                <?php }?>
+            </tr> 
             </thead>
-            <tbody>
-            <tr class="trFlex">
-                <td rowspan="3" class="align-center" style="color: red">中国移动</td>
-                        <td class="align-center">11</td>
-                        <td class="align-center">2211</td>
-                        <th class="align-center">10元</th>
-                <td class="align-center">20元</td>
-                <td class="align-center">30元</td>
-                <td class="align-center">50元</td>
-                <td class="align-center">100元</td>
-                <td class="align-center">200元</td>
-                <td class="align-center">300元</td>
-                <td class="align-center">500元</td>
-                <td class="align-center">1000元</td>
-                <td class="align-center">2200元</td>
-                <td class="align-center">2200元</td>
-          
-                    </tr>
-                    
-            <tr class="trFlex">
-                        <td class="align-center">11</td>
-                        <!-- <td class="align-center">中国移动</td> -->
-                        <td class="align-center">2211</td>
-                        <th class="align-center">10元</th>
-                <td class="align-center">20元</td>
-                <td class="align-center">30元</td>
-                <td class="align-center">50元</td>
-                <td class="align-center">100元</td>
-                <td class="align-center">200元</td>
-                <td class="align-center">300元</td>
-                <td class="align-center">500元</td>
-                <td class="align-center">1000元</td>
-                <td class="align-center">2200元</td>
-                <td class="align-center">2200元</td>
-          
-                    </tr>
-                    <tr  class="trFlex"> 
-                    <td class="align-center">11</td>
-                        <!-- <td class="align-center">中国移动</td> -->
-                        <td class="align-center">2211</td>
-                        <th class="align-center">10元</th>
-                <td class="align-center">20元</td>
-                <td class="align-center">30元</td>
-                <td class="align-center">50元</td>
-                <td class="align-center">100元</td>
-                <td class="align-center">200元</td>
-                <td class="align-center">300元</td>
-                <td class="align-center">500元</td>
-                <td class="align-center">1000元</td>
-                <td class="align-center">2200元</td>
-                <td class="align-center">2200元</td>
-          
-                    </tr>
-                    <tr  class="trFlex"> 
-                        <td rowspan="3" class="align-center" style="color: red">中国联通</td>
-                    <td class="align-center">11</td>
-                        <td class="align-center">2211</td>
-                        <th class="align-center">10元</th>
-                <td class="align-center">20元</td>
-                <td class="align-center">30元</td>
-                <td class="align-center">50元</td>
-                <td class="align-center">100元</td>
-                <td class="align-center">200元</td>
-                <td class="align-center">300元</td>
-                <td class="align-center">500元</td>
-                <td class="align-center">1000元</td>
-                <td class="align-center">2200元</td>
-                <td class="align-center">2200元</td>
-          
-                    </tr>
-                    <tr  class="trFlex"> 
-                    <td class="align-center">11</td>
-                        <td class="align-center">2211</td>
-                        <th class="align-center">10元</th>
-                <td class="align-center">20元</td>
-                <td class="align-center">30元</td>
-                <td class="align-center">50元</td>
-                <td class="align-center">100元</td>
-                <td class="align-center">200元</td>
-                <td class="align-center">300元</td>
-                <td class="align-center">500元</td>
-                <td class="align-center">1000元</td>
-                <td class="align-center">2200元</td>
-                <td class="align-center">2200元</td>
-          
-                    </tr>
-                    <tr  class="trFlex"> 
-                    <td class="align-center">11</td>
-                        <td class="align-center">2211</td>
-                        <th class="align-center">10元</th>
-                <td class="align-center">20元</td>
-                <td class="align-center">30元</td>
-                <td class="align-center">50元</td>
-                <td class="align-center">100元</td>
-                <td class="align-center">200元</td>
-                <td class="align-center">300元</td>
-                <td class="align-center">500元</td>
-                <td class="align-center">1000元</td>
-                <td class="align-center">2200元</td>
-                <td class="align-center">2200元</td>
-          
-                    </tr>
-                    
-                    <tr  class="trFlex"> 
-                        <td rowspan="3" class="align-center" style="color: red">中国电信</td>
-                    <td class="align-center">11</td>
-                        <td class="align-center">2211</td>
-                        <th class="align-center">10元</th>
-                <td class="align-center">20元</td>
-                <td class="align-center">30元</td>
-                <td class="align-center">50元</td>
-                <td class="align-center">100元</td>
-                <td class="align-center">200元</td>
-                <td class="align-center">300元</td>
-                <td class="align-center">500元</td>
-                <td class="align-center">1000元</td>
-                <td class="align-center">2200元</td>
-                <td class="align-center">2200元</td>
-          
-                    </tr>
-                    <tr  class="trFlex"> 
-                    <td class="align-center">11</td>
-                        <td class="align-center">2211</td>
-                        <th class="align-center">10元</th>
-                <td class="align-center">20元</td>
-                <td class="align-center">30元</td>
-                <td class="align-center">50元</td>
-                <td class="align-center">100元</td>
-                <td class="align-center">200元</td>
-                <td class="align-center">300元</td>
-                <td class="align-center">500元</td>
-                <td class="align-center">1000元</td>
-                <td class="align-center">2200元</td>
-                <td class="align-center">2200元</td>
-          
-                    </tr>
-                    <tr  class="trFlex"> 
-                    <td class="align-center">11</td>
-                        <td class="align-center">2211</td>
-                        <th class="align-center">10元</th>
-                <td class="align-center">20元</td>
-                <td class="align-center">30元</td>
-                <td class="align-center">50元</td>
-                <td class="align-center">100元</td>
-                <td class="align-center">200元</td>
-                <td class="align-center">300元</td>
-                <td class="align-center">500元</td>
-                <td class="align-center">1000元</td>
-                <td class="align-center">2200元</td>
-                <td class="align-center">2200元</td>
-          
-                    </tr>
-                    
-                    <tr  class="trFlex"> 
-                        <td rowspan="3" class="align-center" style="color: red">石油</td>
-                    <td class="align-center">11</td>
-                        <td class="align-center">2211</td>
-                        <th class="align-center">10元</th>
-                <td class="align-center">20元</td>
-                <td class="align-center">30元</td>
-                <td class="align-center">50元</td>
-                <td class="align-center">100元</td>
-                <td class="align-center">200元</td>
-                <td class="align-center">300元</td>
-                <td class="align-center">500元</td>
-                <td class="align-center">1000元</td>
-                <td class="align-center">2200元</td>
-                <td class="align-center">2200元</td>
-          
-                    </tr>
-                    <tr  class="trFlex"> 
-                    <td class="align-center">11</td>
-                        <td class="align-center">2211</td>
-                        <th class="align-center">10元</th>
-                <td class="align-center">20元</td>
-                <td class="align-center">30元</td>
-                <td class="align-center">50元</td>
-                <td class="align-center">100元</td>
-                <td class="align-center">200元</td>
-                <td class="align-center">300元</td>
-                <td class="align-center">500元</td>
-                <td class="align-center">1000元</td>
-                <td class="align-center">2200元</td>
-                <td class="align-center">2200元</td>
-          
-                    </tr>
-                    <tr  class="trFlex"> 
-                    <td class="align-center">11</td>
-                        <td class="align-center">2211</td>
-                        <th class="align-center">10元</th>
-                <td class="align-center">20元</td>
-                <td class="align-center">30元</td>
-                <td class="align-center">50元</td>
-                <td class="align-center">100元</td>
-                <td class="align-center">200元</td>
-                <td class="align-center">300元</td>
-                <td class="align-center">500元</td>
-                <td class="align-center">1000元</td>
-                <td class="align-center">2200元</td>
-                <td class="align-center">2200元</td>
-          
-                    </tr>
-                    
-                    <tr  class="trFlex"> 
-                        <td rowspan="3" class="align-center" style="color: red">石化</td>
-                    <td class="align-center">11</td>
-                        <td class="align-center">2211</td>
-                        <th class="align-center">10元</th>
-                <td class="align-center">20元</td>
-                <td class="align-center">30元</td>
-                <td class="align-center">50元</td>
-                <td class="align-center">100元</td>
-                <td class="align-center">200元</td>
-                <td class="align-center">300元</td>
-                <td class="align-center">500元</td>
-                <td class="align-center">1000元</td>
-                <td class="align-center">2200元</td>
-                <td class="align-center">2200元</td>
-          
-                    </tr>
-                    <tr  class="trFlex"> 
-                    <td class="align-center">11</td>
-                        <td class="align-center">2211</td>
-                        <th class="align-center">10元</th>
-                <td class="align-center">20元</td>
-                <td class="align-center">30元</td>
-                <td class="align-center">50元</td>
-                <td class="align-center">100元</td>
-                <td class="align-center">200元</td>
-                <td class="align-center">300元</td>
-                <td class="align-center">500元</td>
-                <td class="align-center">1000元</td>
-                <td class="align-center">2200元</td>
-                <td class="align-center">2200元</td>
-          
-                    </tr>
-                    <tr  class="trFlex"> 
-                    <td class="align-center">11</td>
-                        <td class="align-center">2211</td>
-                        <th class="align-center">10元</th>
-                <td class="align-center">20元</td>
-                <td class="align-center">30元</td>
-                <td class="align-center">50元</td>
-                <td class="align-center">100元</td>
-                <td class="align-center">200元</td>
-                <td class="align-center">300元</td>
-                <td class="align-center">500元</td>
-                <td class="align-center">1000元</td>
-                <td class="align-center">2200元</td>
-                <td class="align-center">2200元</td>
-          
-                    </tr>
-            <!-- <?php if (!empty($output['list']) && is_array($output['list'])) { ?>
-                <?php foreach ($output['list'] as $k => $v) { ?>
-                    <tr class="trFlex">
-                        <td class="align-center"><?php echo $k; ?></td>
-                        <td class="align-center"><?php echo $v['company_name']; ?></td>
-                        <td class="align-center"><?php echo $v['time_out']; ?></td>
-                        <td class="align-center"><?php echo ($v['ratio']['ALL'][900] * 100) ?? 0; ?>% <br> <br>
-          
-                    </tr>
-                <?php } ?>
-            <?php } else { ?>
-                <tr class="no_data">
-                    <td colspan="7"><?php echo $lang['nc_no_record']; ?></td>
+            <tbody class="tbody tbodyd">
+
+            <?php if(!empty($output['data'])){ ?>
+            <?php foreach ($output['data'] as $key => $value){?>
+                <tr class="trFlex" id="trFlex">
+                    <td class="align-center"><?php echo $key;?></td>
+                    <td class="align-center"><?php echo $value['store_name'];?></td>
+                    <?php foreach ($output['card_types'] as $card_type) {?>
+                        <?php foreach ($output['specs'] as $spec){ ?>
+                            <td class="align-center" data-type="<?php echo $card_type;?>"><?php echo $value['price'][$value['name'].'-'.$card_type.'-'.$spec];?></td>
+                        <?php }?>
+                    <?php } ?>
                 </tr>
-            <?php } ?> -->
+            <?php } ?>
+            <?php } ?>
             </tbody>
             <tfoot>
             <tr class="tfoot">
@@ -332,7 +159,10 @@
             </tr>
             </tfoot>
         </table>
-        <!-- <span style="color: red;font-size: 16px;">移 | 联 | 电</span> -->
+        </div>
+
+      
+
     </form>
 </div>
 <script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/js/jquery.edit.js" charset="utf-8"></script>
@@ -353,16 +183,28 @@
         $('#ncsubmit').click(function () {
             $('#formSearch').submit();
         });
-        // 表格hover时背景
-        $('.trFlex').each(function () {
-            $("tbody>tr:odd").css("background-color","#FEF2E8");  
-            $("tbody>tr:even").css("background-color","#ebf1de"); 
-            $(this).hover(function () {
-                $(this)[0].style.backgroundColor = '#cbe9f3'
-            },function() {
-            $("tbody>tr:odd").css("background-color","#FEF2E8");  
-            $("tbody>tr:even").css("background-color","#ebf1de"); 
-            })
+
+        let type = '<?php echo $_GET['card_type'];?>';
+        $(".classA").each(function () {
+            if (type == $(this).attr("data-type")) {
+                $(this).addClass('current')
+                $(this).attr('href','JavaScript:void(0);')
+            }
+        })
+
+
+         
+        $('.trFlex td').each(function (index, item) {
+            let color = $(this).attr('data-type')
+            if (color ==  4 || color ==  1) {
+                $(this).css('background', '#f1dde6')
+            } else if (color == 5 || color ==  2) {
+                $(this).css('background', '#c8c6f3')
+            } else if (color == 6) {
+                $(this).css('background', '#f2f3c6')
+            } else {
+                $(this).css('background', '#fff')
+            }
         })
         // 导出
         $('#ncexport').click(function () {
@@ -377,7 +219,39 @@
                 layer.close(ii);
             }, 800);
         })
-        
+        //表头颜色
+        $('.thead th').each(function () {
+            let color = $(this).attr('data-type')
+            if (color == 4 || color ==  1) {
+                $(this).css('background', '#f1dde6')
+            } else if (color == 5 || color ==  2) {
+                $(this).css('background', '#c8c6f3')
+            } else if (color == 6) {
+                $(this).css('background', '#f2f3c6')
+            } else {
+                $(this).css('background', '#fff')
+            }            
+        })
 
+        let newArr = [];
+        let html = [];
+        $('.tbody tr').each(function () {
+            let res = $(this).find('td').eq(2).text();
+            if (!isNaN(res)) {
+                newArr.push(res);
+            }
+        })
+            newArr.forEach(item => {
+                html.push (item * 1)
+        });
+        function avg() {
+			let sum = 0;
+			for (var i = 0, j = arguments.length; i < j; i++) {
+				sum += arguments[i];
+			}
+			return sum / arguments.length;
+		}
+            let retain = avg.apply(null, html).toFixed(4);
+            console.log(retain);
     });
 </script>

+ 77 - 57
admin/templates/default/refill.order.search.php

@@ -4,60 +4,76 @@
         width: 60px;
         margin-left: 10px;
     }
+
     .db-right {
         padding-right: 134px !important;
         border-bottom: 1px solid #ccc;
     }
+
     .db-center {
         padding: 9px 0;
         border-bottom: 1px solid #ccc;
     }
+
     .db-top {
         padding: 0 30px;
     }
+
     .page .fixed-bar .item-title h3 {
         margin-top: 18px !important;
         margin-bottom: 10px !important;
         font-weight: 700 !important;
     }
+
     .tab-base li span {
         font-size: 12px !important;
     }
+
     .query_ors {
         width: 125px;
     }
+
     th label {
         display: inline-block;
         width: 60px;
     }
+
     .lineLi {
         min-width: 150px;
         font-size: 12px;
         color: #000;
     }
+
     #prompt ul .noLineLi {
         background: none;
     }
+
     #prompt div {
         display: inline-block;
         background: none
     }
+
     #prompt ul .lineLi {
         color: #000;
     }
+
     #selest_nc {
         width: 220px
     }
+
     tbody {
         font-size: 12px;
     }
+
     .layui-form-select .layui-input {
         padding: 13px 5px;
     }
+
     .layui-form-selected dl {
         display: flex !important;
         flex-wrap: wrap !important;
     }
+
     .layui-form-select dl {
 
         top: 29px !important;
@@ -66,50 +82,63 @@
         padding: 14px 0 !important;
         left: -599px !important;
     }
+
     .layui-form-select {
         width: 45%;
     }
+
     .layui-select-title {
         width: 104%;
     }
+
     .layui-form-select .layui-input {
 
         padding-left: 11px;
     }
+
     .page .fixed-bar .item-title h3 {
         margin-top: 18px !important;
         margin-bottom: 10px !important;
         font-weight: 700 !important;
     }
+
     .tab-base li span {
         font-size: 12px !important;
     }
+
     .layui-form-select .layui-input {
         height: 26px;
     }
+
     input::placeholder {
         color: #333;
     }
+
     .xm-tips {
         color: #333 !important;
         font-size: 12px;
     }
+
     .layui-form-select dl dd.layui-this {
         display: none;
     }
+
     .layui-form-select dl dd {
         cursor: pointer;
         width: 130px;
     }
+
     .tb-type1 td select {
         width: 201px;
     }
+
     .tb-type1 td input[type="text"],
     .tb-type1 td select {
         margin-right: 4px;
         margin-left: 0;
         width: 195px;
     }
+
     .layui-form-select .layui-edge {
         right: -91px !important;
     }
@@ -134,10 +163,10 @@
                 <th><label for="query_start_time">下单时间</label></th>
                 <td style="width: 327px">
                     <input class="txt date" type="text" value="<?php echo $_GET['query_start_time']; ?>"
-                           id="startTime" name="query_start_time" autocomplete="off" style="width:120px" />
+                           id="startTime" name="query_start_time" autocomplete="off" style="width:120px"/>
                     <label for="query_start_time">~</label>
                     <input class="txt date" type="text" value="<?php echo $_GET['query_end_time']; ?>"
-                           id="endTime" name="query_end_time" autocomplete="off" style="width:120px" />
+                           id="endTime" name="query_end_time" autocomplete="off" style="width:120px"/>
                 </td>
                 <th><label>订单状态</label></th>
                 <td>
@@ -156,37 +185,42 @@
                     </select>
                 </td>
                 <th><label class="query_ors">供方名称</label></th>
-                <td >
-                    <select name="store_id" class="" >
+                <td>
+                    <select name="store_id" class="">
                         <option value=""><?php echo $lang['nc_please_choose']; ?></option>
-                        <?php foreach($output['provider_list'] as $provider){?>
-                            <option value="<?php echo $provider['store_id']?>"
-                                    <?php if ($_GET['store_id'] == $provider['store_id']){ ?>selected<?php } ?> data-color="<?php echo $provider['opened']?>" class="textColor"><?php echo $provider['store_name']?>
+                        <?php foreach ($output['provider_list'] as $provider) { ?>
+                            <option value="<?php echo $provider['store_id'] ?>"
+                                    <?php if ($_GET['store_id'] == $provider['store_id']){ ?>selected<?php } ?>
+                                    data-color="<?php echo $provider['opened'] ?>"
+                                    class="textColor"><?php echo $provider['store_name'] ?>
                             </option>
-                        <?php }?>
+                        <?php } ?>
                     </select>
                 </td>
                 <th><label class="">客户名称</label></th>
-                <td  class="layui-form td_time" style="width: 110px;">
+                <td class="layui-form td_time" style="width: 110px;">
                     <select name="mchid" class="querySelect" lay-verify="" lay-search>
                         <option value=""><?php echo $lang['nc_please_choose']; ?></option>
-                        <?php foreach($output['merchant_list'] as $merchant){?>
-                            <option value="<?php echo $merchant['mchid']?>"
-                                    <?php if ($_GET['mchid'] == $merchant['mchid']){ ?>selected<?php } ?>><?php echo $merchant['company_name'] == '' ? $merchant['name'] : $merchant['company_name'];?>
+                        <?php foreach ($output['merchant_list'] as $merchant) { ?>
+                            <option value="<?php echo $merchant['mchid'] ?>"
+                                    <?php if ($_GET['mchid'] == $merchant['mchid']){ ?>selected<?php } ?>><?php echo $merchant['company_name'] == '' ? $merchant['name'] : $merchant['company_name']; ?>
                             </option>
-                        <?php }?>
+                        <?php } ?>
                     </select>
                 </td>
-       
+
             </tr>
             <tr>
-   
-                <th><label  class="query_ors">订单号(多行查询)</label></th>
-                <td><textarea style="width: 324px;" name="order_sns" id="order_sns" cols="30" rows="10"><?php echo $_GET['order_sns'];?></textarea></td>
+
+                <th><label class="query_ors">订单号(多行查询)</label></th>
+                <td><textarea style="width: 324px;" name="order_sns" id="order_sns" cols="30"
+                              rows="10"><?php echo $_GET['order_sns']; ?></textarea></td>
                 <th><label class="query_ors">充值卡号(多行查询)</label></th>
-                <td><textarea name="card_nos" id="card_nos" cols="30" rows="10"><?php echo $_GET['card_nos'];?></textarea></td>
+                <td><textarea name="card_nos" id="card_nos" cols="30"
+                              rows="10"><?php echo $_GET['card_nos']; ?></textarea></td>
                 <th><label class="query_ors">商家单号(多行查询)</label></th>
-                <td><textarea name="mch_orders" id="mch_orders" cols="30" rows="10"><?php echo $_GET['mch_orders'];?></textarea></td>
+                <td><textarea name="mch_orders" id="mch_orders" cols="30"
+                              rows="10"><?php echo $_GET['mch_orders']; ?></textarea></td>
                 <td>
                     <a href="javascript:void(0);" id="ncsubmit" class="btn-search "
                        title="<?php echo $lang['nc_query']; ?>">&nbsp;
@@ -247,7 +281,7 @@
                     <td class="align-center"><?php echo $order['card_type_text']; ?></td>
                     <td class="align-center"><?php echo $order['refill_amount']; ?></td>
                     <td class="align-right">
-                        <span class="doubleclick"  data-order="<?php echo $order['order_sn'];?>">
+                        <span class="doubleclick" data-order="<?php echo $order['order_sn']; ?>">
                             <?php echo date('Y-m-d H:i:s', $order['order_time']); ?>
                         </span>
                     </td>
@@ -299,7 +333,7 @@
         charset="utf-8"></script>
 <link rel="stylesheet" type="text/css"
       href="<?php echo RESOURCE_SITE_URL; ?>/js/jquery-ui/themes/ui-lightness/jquery.ui.css"/>
-      <script type="text/javascript" src="<?php echo ADMIN_TEMPLATES_URL;?>/layui/layui.js"></script>
+<script type="text/javascript" src="<?php echo ADMIN_TEMPLATES_URL; ?>/layui/layui.js"></script>
 <link rel="stylesheet" type="text/css" href="<?php echo ADMIN_TEMPLATES_URL; ?>/layui/css/layui.css"/>
 <script type="text/javascript">
     $(function () {
@@ -317,33 +351,19 @@
             elem: '#endTime',
             type: 'datetime'
         });
-        let isWring = '<?php echo $output['count'][1];?>';
-        let setTimer
-        let num
-        if (Number(isWring) > 0) {
-            window.clearTimeout(setTimer)
-            setTimer = setTimeout(function () {
-                $("#auto")[0].play();
-                // $("#auto").attr("src", '<?php echo RESOURCE_SITE_URL; ?>/warning.mp3');
-            }, 1000);
-            window.clearTimeout(num)
-            num = setTimeout(function () {
-                window.location.reload();
-            }, 60000);
-        }
-                //双击
-        $('.doubleclick').dblclick(function() {
+        //双击
+        $('.doubleclick').dblclick(function () {
             let order_sn = $(this).attr('data-order')
             $.get('index.php?act=refill_order&op=showOrders', {
-                order_sn:order_sn
-            }, function(data) {
+                order_sn: order_sn
+            }, function (data) {
                 data = JSON.parse(data)
-                if (data.state == 1) {
-                let order_item = data.data
-                let html = ''; 
-                for (let i = 0; i < order_item.length; i++) {
-                    var item = order_item[i];
-                    html += `
+                if (data.state === 1) {
+                    let order_item = data.data
+                    let html = '';
+                    for (let i = 0; i < order_item.length; i++) {
+                        var item = order_item[i];
+                        html += `
                     <tr>
                          <td class="db-center">${item.order_sn}</td>
                          <td class="db-center">${item.commit_time_text}</td>
@@ -353,8 +373,8 @@
                          <td class="db-center">${item.channel_name}</td>
                          <td class="db-center">${item.err_msg}</td>
                     <tr>`
-                }
-                let content =  `<table>
+                    }
+                    let content = `<table>
                                 <thead>
                                     <tr>
                                         <th class="db-right">订单号</th>
@@ -368,10 +388,10 @@
                                 </thead>
                                 <tbody>${html}</tbody>
                             </table>`
-                layer.open({
-                   title: `<span>共${data.count}单</span> <span class="db-top">回调状态:${data.mch_notify_state}</span> <span>回调次数:${data.mch_notify_times}</span>` ,
-                   content:content
-                        });
+                    layer.open({
+                        title: `<span>共${data.count}单</span> <span class="db-top">回调状态:${data.mch_notify_state}</span> <span>回调次数:${data.mch_notify_times}</span>`,
+                        content: content
+                    });
                 } else {
                     alert("没有此订单");
                 }
@@ -379,20 +399,20 @@
         })
         //过滤
         $("#card_nos").blur(function () {
-            let test_mch =  $("#card_nos").val();
+            let test_mch = $("#card_nos").val();
             let result = test_mch.replace(/[\  \r\n\,]+/g, ",");
             $(this).val(result)
-            })
+        })
         $("#mch_orders").blur(function () {
-            let test_mch =  $("#mch_orders").val();
+            let test_mch = $("#mch_orders").val();
             let result = test_mch.replace(/[\  \r\n\,]+/g, ",");
             $(this).val(result)
-            })
+        })
         $("#order_sns").blur(function () {
-            let test_mch =  $("#order_sns").val();
+            let test_mch = $("#order_sns").val();
             let result = test_mch.replace(/[\  \r\n\,]+/g, ",");
             $(this).val(result)
-            })
+        })
         // 表格hover时背景
         $('.trFlex').each(function () {
             $(this).hover(function () {

+ 380 - 0
admin/templates/default/refill.task.php

@@ -0,0 +1,380 @@
+<style>
+    th label {
+        display: inline-block;
+        width: 60px;
+        margin-left: 10px;
+    }
+    .page .fixed-bar .item-title h3 {
+        margin-top: 18px !important;
+        margin-bottom: 10px !important;
+        font-weight: 700 !important;
+    }
+    .tab-base li span {
+        font-size: 12px !important;
+    }
+    .query_ors {
+        width: 125px;
+    }
+    th label {
+        display: inline-block;
+        width: 60px;
+    }
+    .lineLi {
+        min-width: 150px;
+        font-size: 12px;
+        color: #000;
+    }
+    #prompt ul .noLineLi {
+        background: none;
+    }
+    #prompt div {
+        display: inline-block;
+        background: none
+    }
+    #prompt ul .lineLi {
+        color: #000;
+    }
+    #selest_nc {
+        width: 220px
+    }
+    tbody {
+        font-size: 12px;
+    }
+    .layui-form-select .layui-input {
+        padding: 13px 5px;
+    }
+    .selection .layui-form-selected dl {
+        display: flex !important;
+        flex-wrap: wrap !important;
+    }
+    .selection .layui-form-select dl {
+
+        top: 29px !important;
+        min-width: 883% !important;
+        max-height: 280px !important;
+        padding: 14px 0 !important;
+        left: 0 !important;
+    }
+    .layui-form-select {
+        width: 45%;
+    }
+    .layui-select-title {
+        width: 104%;
+    }
+    .selection .layui-form-select .layui-input {
+        padding-left: 11px;
+    }
+    .page .fixed-bar .item-title h3 {
+        margin-top: 18px !important;
+        margin-bottom: 10px !important;
+        font-weight: 700 !important;
+    }
+    .tab-base li span {
+        font-size: 12px !important;
+    }
+    .layui-form-select .layui-input {
+        height: 26px;
+    }
+    input::placeholder {
+        color: #333;
+    }
+    .xm-tips {
+        color: #333 !important;
+        font-size: 12px;
+    }
+    .layui-form-select dl dd.layui-this {
+        display: none;
+    }
+    .layui-form-select dl dd {
+        cursor: pointer;
+        width: 130px;
+    }
+    .tb-type1 td select {
+        width: 201px;
+    }
+    .tb-type1 td input[type="text"],
+    .tb-type1 td select {
+        margin-right: 4px;
+        margin-left: 0;
+        width: 195px;
+    }
+    .layui-form-select .layui-edge {
+        right: -91px !important;
+    }
+    .type .layui-form-select dl {
+        top: 29px !important;
+        width: 214% !important;
+    }
+</style>
+
+<?php defined('InShopNC') or exit('Access Invalid!'); ?>
+<div class="page">
+    <div class="fixed-bar">
+        <div class="item-title">
+            <h3>对账管理</h3>
+            <ul class="tab-base">
+                <li><a href="index.php?act=OrderStats&op=index&type=system"><span>上游对账记录</span></a></li>
+                <li><a href="index.php?act=OrderStats&op=index&type=provider"><span>上游对账记录</span></a></li>
+                <li><a href="index.php?act=OrderStats&op=index&type=merchant"><span>下游对账记录</span></a></li>
+                <li><a href="JavaScript:void(0);" class="current"><span>任务列表</span></a></li>
+                <li><a href="index.php?act=OrderStats&op=task_add"><span>任务录入</span></a></li>
+            </ul>
+        </div>
+    </div>
+    <div class="fixed-empty"></div>
+    <form method="get" action="index.php" name="formSearch" id="formSearch">
+        <input type="hidden" name="act" value="orderstats"/>
+        <input type="hidden" name="op" value="refill_task"/>
+        <input type="hidden" name="cid_type" value=""/>
+        <input type="hidden" name="default_cid_type" value="<?php echo $_GET['cid_type']; ?>"/>
+        <table class="tb-type1 noborder search">
+            <tr>
+                <th><label>主体类型</label></th>
+                <td class="layui-form type">
+                    <select name="type" id="type" lay-filter="type">
+                        <option value="">请选择</option>
+                        <?php foreach ($output['type'] as $key => $value){?>
+                            <option value="<?php echo $key;?>" <?php if($_GET['type'] === $key) { echo 'selected'; }?>><?php echo $value;?></option>
+                        <?php }?>
+                    </select>
+                </td>
+                <th><label>主体选择</label></th>
+                <td class="layui-form selection">
+                    <select name="cid" id="cid" lay-filter="cid" lay-search></select>
+                </td>
+                <td>
+                    <a href="javascript:void(0);" id="ncsubmit" class="btn-search "
+                       title="<?php echo $lang['nc_query']; ?>">&nbsp;
+                    </a>
+                </td>
+            </tr>
+        </table>
+    </form>
+
+    <table class="table tb-type2 nobdb">
+        <thead>
+        <tr class="thead">
+            <th class="align-center">编号</th>
+            <th class="align-center">任务ID</th>
+            <th class="align-center">任务类型</th>
+            <th class="align-center">主体类型</th>
+            <th class="align-center">主体ID</th>
+            <th class="align-center">主体名称</th>
+            <th class="align-center">任务条件</th>
+            <th class="align-center">任务状态</th>
+            <th class="align-center">生成日期</th>
+            <th class="align-center">处理日期</th>
+            <th class="align-center">完成日期</th>
+            <th class="align-center">处理结果</th>
+            <th class="align-center">操作</th>
+        </tr>
+        </thead>
+        <tbody id="tbody">
+        <?php if (count($output['list']) > 0) { ?>
+            <?php
+            foreach ($output['list'] as $key => $value) { ?>
+                <tr class="hover trFlex">
+                    <td class="align-center"><?php echo $key + 1; ?></td>
+                    <td class="align-center"><?php echo $value['task_id']; ?></td>
+                    <td class="align-center"><?php echo $output['task_type'][$value['task_type']]; ?></td>
+                    <td class="align-center"><?php echo $output['type'][$value['type']]; ?></td>
+                    <td class="align-center"><?php echo $value['cid']; ?></td>
+                    <td class="align-center"><?php echo $value['cname']; ?></td>
+                    <td class="align-center">
+                        <p>统计日期类型:<?php echo $output['order_time_type'][$value['condition']['order_time_type']];?></p>
+                        <p>
+                            统计日期范围:<?php echo date("Y-m-d H:i:s", $value['condition']['start_unixtime'])?>
+                            <?php if (!empty($value['condition']['end_unixtime'])) {
+                                echo '~' . date("Y-m-d H:i:s", $value['condition']['end_unixtime']);
+                            }
+                            ?>
+                        </p>
+                        <p>订单状态:
+                            <?php if ($value['condition']['order_state'] === '') {
+                                echo '/';
+                            } else {
+                                echo orderState($value['condition']);
+                            }
+                            ?>
+                        </p>
+                    </td>
+                    <td class="align-center"><?php echo $output['task_state'][$value['task_state']]; ?></td>
+                    <td class="align-center"><?php echo $value['add_time'] ? date('Y-m-d H:i:s', $value['add_time']) : '/'; ?></td>
+                    <td class="align-center"><?php echo $value['dispose_time'] ? date('Y-m-d H:i:s', $value['dispose_time']) : '/'; ?></td>
+                    <td class="align-center"><?php echo $value['finish_time'] ? date('Y-m-d H:i:s', $value['finish_time']) : '/'; ?></td>
+                    <td class="align-center">
+                        <?php if($value['task_state'] == 3 && !empty($value['task_result'])){?>
+                            <a target="_blank" href="<?php echo UPLOAD_SITE_URL . '/' . ATTACH_TASK . DS . $value['task_result']; ?>">下载</a>
+                        <?php }?>
+                    </td>
+                    <td class="align-center">
+                        <a href="index.php?act=OrderStats&op=task_del&task_id=<?php echo $value['task_id'] ?>">删除</a>
+                    </td>
+                </tr>
+            <?php } ?>
+        <?php } else { ?>
+            <tr class="no_data">
+                <td colspan="13"><?php echo $lang['nc_no_record']; ?></td>
+            </tr>
+        <?php } ?>
+        </tbody>
+        <tfoot>
+        <tr class="tfoot">
+            <td colspan="13" id="dataFuncs">
+                <div class="pagination"> <?php echo $output['show_page']; ?> </div>
+            </td>
+        </tr>
+        </tfoot>
+    </table>
+    <!-- 预警提示 -->
+    <audio id="auto" src="<?php echo RESOURCE_SITE_URL; ?>/warning.mp3"></audio>
+</div>
+<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/laydate/laydate.js"></script>
+<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/js/jquery-ui/jquery.ui.js"></script>
+<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/js/jquery-ui/i18n/zh-CN.js"
+        charset="utf-8"></script>
+<link rel="stylesheet" type="text/css"
+      href="<?php echo RESOURCE_SITE_URL; ?>/js/jquery-ui/themes/ui-lightness/jquery.ui.css"/>
+<script type="text/javascript" src="<?php echo ADMIN_TEMPLATES_URL;?>/layui/layui.js"></script>
+<link rel="stylesheet" type="text/css" href="<?php echo ADMIN_TEMPLATES_URL; ?>/layui/css/layui.css"/>
+<script type="text/javascript">
+    let selectValue = ''
+    let Interface
+    let default_type = '<?php echo $_GET['type'];?>';
+    // console.log(default_type, 'type');
+    let default_cid_m = '<?php echo $_GET['cid'];?>';
+    // console.log(default_cid_m);
+
+    $(function () {
+        $('#ncsubmit').click(function () {
+            $('input[name="cid_type"]').val(selectValue);
+            $('#formSearch').submit();
+        });
+        $('#query_start_time').datepicker({dateFormat: 'yy-mm-dd'});
+        $('#query_end_time').datepicker({dateFormat: 'yy-mm-dd'});
+        // 日期选择器
+        laydate.render({
+            elem: '#startTime',
+            type: 'datetime'
+        });
+        laydate.render({
+            elem: '#endTime',
+            type: 'datetime'
+        });
+
+        // 表格hover时背景
+        $('.trFlex').each(function () {
+            $(this).hover(function () {
+                $(this)[0].style.backgroundColor = '#cbe9f3'
+            }, function () {
+                $(this)[0].style.backgroundColor = '#fff'
+            })
+        })
+        // 供方名称颜色
+        $('.textColor').each(function () {
+            let color = $(this).attr('data-color')
+            if (color == '1') {
+                $(this).css('color', 'green')
+            } else {
+                $(this).css('color', 'red')
+            }
+        })
+
+
+
+
+
+        //主体选择
+        layui.use(['form'], function () {
+            let form = layui.form;
+            let default_type = $('select[name="type"]').val();
+            if (default_type === 'merchant') {
+                $.get('index.php?act=refill_order&op=merchant_data', function(res) {
+                    res = JSON.parse(res)
+                    let html = '';
+                    res.forEach(item => {
+                        html += `<option value="${item.value}">${item.name}</option>`;
+                    })
+                    let select_type = `<select>${html}</select>`
+                    $('#cid').html(select_type);
+                    form.render('select')
+                })
+            } else if (default_type === 'provider'){
+                $.get('index.php?act=refill_order&op=provider_data', function(res) {
+                    selectRes = JSON.parse(res)
+                        let html = '';
+                        selectRes.forEach(item => {
+                            html += `<option value="${item.value}">${item.name}</option>`;
+                        })
+                        let select_type = `<select>${html}</select>`
+                        $('#cid').html(select_type);
+                        let default_cid_type = $('input[name="default_cid_type"]').val()
+                        console.log(default_cid_type, '隐藏');
+                        if (default_cid_type) {
+                            for (let i = 0; i < selectRes.length; i++) {
+                                // let html = '';
+                                 if(selectRes[i].value == default_cid_type) {
+                                    console.log(selectRes[i].value, '接口的valie');
+                                    selectRes[i].selected = true
+                                // html = `<option value="${selectRes[i].value }">${selectRes[i].name }</option>`;
+                                // let select_type = `<select>${html}</select>`
+                                // electRes[i].selected = true
+                                // var select = 'dd[lay-value=' + selectRes[i].value + ']';// 设置value
+                                // $("#cid").find("option[value="+selectRes[i].value+"]").prop("selected",true);
+                                // let as = $('#cid').siblings("div.layui-form-select").find('dl').find(select).click()
+                                form.render('select')
+                        }
+                    }
+                }
+                        form.render('select')
+                })
+                 form.on('select(cid)', function (data) {
+                        let form_type = data.value;
+                        selectValue = data.value
+                        form.render('select')
+
+                    })
+            } else {
+                $('#cid').html('');
+                form.render('select')
+            }
+            form.on('select(type)', function (data) {
+                let form_type = data.value;
+                form.render('select')
+                if (form_type === 'merchant') {
+                    $.get('index.php?act=refill_order&op=merchant_data', function(res) {
+                        res = JSON.parse(res)
+                        let html = '';
+                        res.forEach(item => {
+                            html += `<option value="${item.value}">${item.name}</option>`;
+                        })
+                        let select_type = `<select>${html}</select>`
+                        $('#cid').html(select_type);
+                        form.render('select')
+
+                    })
+                } else if (form_type === 'provider'){
+                    $.get('index.php?act=refill_order&op=provider_data', function(res) {
+                        res = JSON.parse(res)
+                        let html = '';
+                        res.forEach(item => {
+                            html += `<option value="${item.value}">${item.name}</option>`;
+                        })
+                        let select_type = `<select>${html}</select>`
+                        $('#cid').html(select_type);
+                        form.render('select')
+                    })
+                    form.on('select(cid)', function (data) {
+                        let form_type = data.value;
+                        selectValue = data.value
+                        form.render('select')
+
+                    })
+                } else {
+                    $('#cid').html('');
+                    form.render('select')
+                }
+            })
+        })
+    });
+</script> 

+ 18 - 15
admin/templates/default/system.order.stats.php

@@ -17,6 +17,9 @@
                 <li><a href="JavaScript:void(0);" class="current"><span>平台对账记录</span></a></li>
                 <li><a href="index.php?act=OrderStats&op=index&type=provider"><span>上游对账记录</span></a></li>
                 <li><a href="index.php?act=OrderStats&op=index&type=merchant"><span>下游对账记录</span></a></li>
+
+<!--                <li><a href="index.php?act=OrderStats&op=refill_task"><span>任务列表</span></a></li>-->
+<!--                <li><a href="index.php?act=OrderStats&op=task_add"><span>任务录入</span></a></li>-->
             </ul>
         </div>
     </div>
@@ -190,22 +193,22 @@
             excel += row + "</tr>"; 
             //设置数据 
             for (var i = 0; i < arrData.length; i++) { 
-                var row = "<tr>"; 
+                var tr = "<tr>";
                 let code = i+1
-                row += "<td>" +code+ "</td>"
-                row += '<td style=font-size:14px;'+ 'mso-number-format:"\@"'+ '>' + arrData[i].time_text + '</td>';
-                row += '<td style=font-size:14px;'+ 'mso-number-format:"\@"'+ '>' + arrData[i].cname + '</td>';
-                row += '<td style=font-size:14px;'+ 'mso-number-format:"\@"'+ '>' + arrData[i].cid + '</td>';
-                row += '<td style=font-size:14px;'+ 'mso-number-format:"\@"'+ '>' + arrData[i].success_count + '</td>';
-                row += '<td style=font-size:14px;'+ 'mso-number-format:"\@"'+ '>' + arrData[i].success_refill_amounts + '</td>';
-                row += '<td style=font-size:14px;'+ 'mso-number-format:"\@"'+ '>' + arrData[i].success_mch_amounts + '</td>';
-                row += '<td style=font-size:14px;'+ 'mso-number-format:"\@"'+ '>' + arrData[i].success_channel_amounts + '</td>';
-                row += '<td style=font-size:14px;'+ 'mso-number-format:"\@"'+ '>' + arrData[i].profit_amounts + '</td>';
-                row += '<td style=font-size:14px;'+ 'mso-number-format:"\@"'+ '>' + arrData[i].service_amounts + '</td>';
-                row += '<td style=font-size:14px;'+ 'mso-number-format:"\@"'+ '>' + arrData[i].order_count + '</td>';
-                row += '<td style=font-size:14px;'+ 'mso-number-format:"\@"'+ '>' + arrData[i].cancel_count + '</td>';
-                row += '<td style=font-size:14px;'+ 'mso-number-format:"\@"'+ '>' + arrData[i].success_ratio + '</td>';
-                excel += row + "</tr>"; 
+                tr += "<td>" +code+ "</td>"
+                tr += '<td style=font-size:14px;'+ 'mso-number-format:"\@"'+ '>' + arrData[i].time_text + '</td>';
+                tr += '<td style=font-size:14px;'+ 'mso-number-format:"\@"'+ '>' + arrData[i].cname + '</td>';
+                tr += '<td style=font-size:14px;'+ 'mso-number-format:"\@"'+ '>' + arrData[i].cid + '</td>';
+                tr += '<td style=font-size:14px;'+ 'mso-number-format:"\@"'+ '>' + arrData[i].success_count + '</td>';
+                tr += '<td style=font-size:14px;'+ 'mso-number-format:"\@"'+ '>' + arrData[i].success_refill_amounts + '</td>';
+                tr += '<td style=font-size:14px;'+ 'mso-number-format:"\@"'+ '>' + arrData[i].success_mch_amounts + '</td>';
+                tr += '<td style=font-size:14px;'+ 'mso-number-format:"\@"'+ '>' + arrData[i].success_channel_amounts + '</td>';
+                tr += '<td style=font-size:14px;'+ 'mso-number-format:"\@"'+ '>' + arrData[i].profit_amounts + '</td>';
+                tr += '<td style=font-size:14px;'+ 'mso-number-format:"\@"'+ '>' + arrData[i].service_amounts + '</td>';
+                tr += '<td style=font-size:14px;'+ 'mso-number-format:"\@"'+ '>' + arrData[i].order_count + '</td>';
+                tr += '<td style=font-size:14px;'+ 'mso-number-format:"\@"'+ '>' + arrData[i].cancel_count + '</td>';
+                tr += '<td style=font-size:14px;'+ 'mso-number-format:"\@"'+ '>' + arrData[i].success_ratio + '</td>';
+                excel += tr + "</tr>";
             } 
                 excel += "</table>"; 
                 var excelFile = "<html xmlns:o='urn:schemas-microsoft-com:office:office' xmlns:x='urn:schemas-microsoft-com:office:excel' xmlns='http://www.w3.org/TR/REC-html40'>"; 

+ 180 - 2
crontab/control/minutes.php

@@ -14,6 +14,7 @@ require_once(BASE_HELPER_PATH . '/refill/util.php');
 require_once(BASE_HELPER_PATH . '/refill/divert_account.php');
 require_once(BASE_HELPER_PATH . '/refill/RefillFactory.php');
 require_once(BASE_CORE_PATH . '/framework/function/http.php');
+require_once(BASE_HELPER_PATH . '/PHPExcel/PHPExcel.php');
 
 
 class minutesControl extends BaseCronControl
@@ -31,13 +32,14 @@ class minutesControl extends BaseCronControl
         $this->_cron_common([1,2,3,4,5,6,7]);
         $this->_fetch_order_unavaliable();
         $this->_check_merchant_alarm_amount();
+
+//        $this->_refill_task();
         Log::record(__FUNCTION__ . " end",Log::DEBUG);
 
 //        $this->_web_index_update();
 //        $this->_check_merchant_alarm_amount();
 //        $this->check_refill_order_limit();
-
-//      $this->_cron_mail_send();
+//        $this->_cron_mail_send();
 //        $this->_SendOrderQuery();
     }
 
@@ -625,6 +627,7 @@ class minutesControl extends BaseCronControl
 
         return $cronid;
     }
+
     //查询超过5分钟的充值中订单
     public function _SendOrderQuery()
     {
@@ -639,4 +642,179 @@ class minutesControl extends BaseCronControl
             }
         }
     }
+
+    //
+
+    public function _refill_task(): bool
+    {
+        Log::record(__FUNCTION__,Log::DEBUG);
+        $model_refill_task = Model('refill_task');
+
+        $task = $model_refill_task->UnDispose('order_export');
+        if (empty($task)) return false;
+
+        $task_id = $task['task_id'];
+        $task_condition = unserialize($task['task_condition']);
+        if (empty($task_condition)) {
+            Log::record("refill task condition unserialize err, task_id:{$task_id}");
+            return false;
+        }
+
+        $type = $task['type'];
+        $cid = $task['cid'];
+        if ($type === 'merchant') {
+            $condition['refill_order.mchid'] = $cid;
+        } elseif ($type === 'provider') {
+            $condition['vr_order.store_id'] = $cid;
+        } else {
+            Log::record("refill task type err, task_id:{$task_id}");
+            return false;
+        }
+        $order_time_type = $task_condition['order_time_type'];
+        $start_unixtime = $task_condition['start_unixtime'];
+        $end_unixtime = $task_condition['end_unixtime'];
+        $order_state = $task_condition['order_state'];
+        if ($start_unixtime > 0 && $end_unixtime > $start_unixtime) {
+            $condition["refill_order.{$order_time_type}"] = [['egt', $start_unixtime], ['lt', $end_unixtime], 'and'];
+            $condition['vr_order.add_time'] = ['egt', $start_unixtime-1];
+        } elseif ($start_unixtime > 0) {
+            $condition["refill_order.{$order_time_type}"] = ['egt', $start_unixtime];
+            $condition['vr_order.add_time'] = ['egt', $start_unixtime-1];
+        }
+        if (in_array($order_state, ['0', '10', '20', '30', '40'], true)) {
+            $condition['order_state'] = $order_state;
+        }
+
+        $model_refill_task->Dispose($task_id);
+        [$state, $task_result] = $this->order_export($condition, $type, $task_id);
+        if ($state) {
+            $model_refill_task->DisposeFinish($task_id, $task_result);
+        } else {
+            $model_refill_task->DisposeErr($task_id, $task_result);
+        }
+
+        return true;
+    }
+
+    /**
+     * @throws PHPExcel_Exception
+     */
+    private function order_export($condition, $type, $task_id)
+    {
+        $orders = $this->getAllOrders($condition);
+        if(empty($orders)) {
+            return [false, '统计数据为空'];
+        }
+        $orders = $this->orderFormat($orders);
+        $objPHPExcel = new PHPExcel();
+
+        if ($type === 'merchant') {
+            $column_keys = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K'];
+            $column_values = ['商户号', '客户订单号', '平台单号', '面额', '充值卡号', '充值卡类型', '下单日期', '完成日期', '官方流水号', '订单状态', '扣款金额'];
+            $data_keys = ['mchid', 'mch_order', 'order_sn', 'refill_amount', 'card_no', 'card_type_text', 'order_time_text', 'notify_time_text', 'official_sn', 'order_state_text', 'mch_amount'];
+        } elseif ($type === 'provider') {
+            $column_keys = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J'];
+            $column_values = ['上游订单号', '平台单号', '面额', '充值卡号', '充值卡类型', '下单日期', '完成日期', '官方流水号', '订单状态', '扣款金额'];
+            $data_keys = ['ch_trade_no', 'order_sn', 'refill_amount', 'card_no', 'card_type_text', 'order_time_text', 'notify_time_text', 'official_sn', 'order_state_text', 'channel_amount'];
+        } else {
+            return [false, '主体类型错误'];
+        }
+
+        $objPHPExcel->setActiveSheetIndex(0);
+        $objPHPExcel->getDefaultStyle()->getFont()->setName('Arial')->setSize(10);
+        foreach ($column_keys as $key => $column_key) {
+            $objPHPExcel->getActiveSheet()->getColumnDimension($column_key)->setWidth(25);
+            $cell_value = $column_key . 1;
+            $objPHPExcel->getActiveSheet()->setCellValue($cell_value, $column_values[$key]);
+        }
+
+        foreach ($orders as $k => $order) {
+            foreach ($column_keys as $key => $column_key) {
+                $field = $column_key.($k+2);
+                $objPHPExcel->getActiveSheet()->setCellValueExplicit($field, $order[$data_keys[$key]],
+                    PHPExcel_Cell_DataType::TYPE_STRING);
+            }
+        }
+        try {
+            $path = BASE_ROOT_PATH . "/data/upload/task/";
+            if(!is_dir($path)){
+                mkdir($path, 0755);
+            }
+            $filename = date('YmdHis',time())."-任务导出-任务ID:{$task_id}.xlsx";
+
+            $file_path = $path . $filename;
+            $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');
+
+            $objWriter->save($file_path);
+            return [true, $filename];
+        } catch (Exception $e) {
+            return [false, $e->getMessage()];
+        }
+    }
+
+    private function getAllOrders($condition): array
+    {
+        $len = 1000;
+
+        $i = 0;
+        $orders = [];
+        while (true)
+        {
+            $start = $i * $len;
+            $items = Model('')->table('refill_order,vr_order')
+                ->field('refill_order.*,vr_order.order_state')
+                ->join('inner')
+                ->on('refill_order.order_id=vr_order.order_id')
+                ->where($condition)
+                ->order('refill_order.order_time desc')
+                ->limit("{$start},{$len}")
+                ->select();
+            $orders = array_merge($orders,$items);
+            if (empty($items) || count($items) < $len) {
+                break;
+            }
+            $i++;
+        }
+        return $orders;
+    }
+
+    private function orderFormat($orders): array
+    {
+        $card_type_texts = [mtopcard\PetroChinaCard => '中石油', mtopcard\SinopecCard => '中石化', mtopcard\ChinaMobileCard => '中国移动', mtopcard\ChinaUnicomCard => '中国联通', mtopcard\ChinaTelecomCard => '中国电信'];
+        $orderState = function ($order_info) {
+            $is_retrying = $order_info['is_retrying'];
+            switch ($order_info['order_state']) {
+                case ORDER_STATE_CANCEL:
+                    if ($is_retrying) {
+                        $order_state = '重试中';
+                    } else {
+                        $order_state = '已取消';
+                    }
+                    break;
+                case ORDER_STATE_NEW:
+                    $order_state = '待付款';
+                    break;
+                case ORDER_STATE_PAY:
+                    $order_state = '待发货';
+                    break;
+                case ORDER_STATE_SEND:
+                    $order_state = '待收货';
+                    break;
+                case ORDER_STATE_SUCCESS:
+                    $order_state = '交易完成';
+                    break;
+                default :
+                    $order_state = '未知状态';
+            }
+            return $order_state;
+        };
+        foreach($orders as $key => $order)
+        {
+            $orders[$key]['card_type_text'] = $card_type_texts[$order['card_type']];
+            $orders[$key]['order_time_text'] = $order['order_time'] ? date('Y-m-d H:i:s', $order['order_time']) : '';
+            $orders[$key]['notify_time_text'] = $order['notify_time'] ? date('Y-m-d H:i:s', $order['notify_time']) : '';
+            $orders[$key]['order_state_text'] = $orderState($order);
+        }
+        return $orders;
+    }
 }

+ 0 - 5
data/config/dev/refill.ini.php

@@ -1517,8 +1517,3 @@ $config['merchant_intercept'] = [
     10213 => ['card_states' => [],'is_transfer' => true]
 ];
 
-//// "status": 1 //状态 0:空号;1:实号;2:停机;3:库无;4:沉默号;5:风险号
-$config['merchant_intercept'] = [
-    1092 => ['card_states' => [2,4],'is_transfer' => false]
-];
-

+ 233 - 110
data/config/win/refill.ini.php

@@ -629,36 +629,36 @@ $zhongst_phone = ['name' => 'zhongst', 'store_id' => 39, 'qualitys' => '2',
         ],
 
         30 => [
-            ['goods_id' => 6466, 'price' => 30.06, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6466, 'price' => 30.06, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 6466, 'price' => 30.12, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6466, 'price' => 29.91, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6466, 'price' => 30.09, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
 
         50 => [
-            ['goods_id' => 6467, 'price' => 50.1, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6467, 'price' => 50.1, 'quality' => 2, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 6467, 'price' => 50.05, 'quality' => 2, 'card_type' => 'chinatelecom']
+            ['goods_id' => 6467, 'price' => 50.15, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6467, 'price' => 49.85, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 6467, 'price' => 49.9, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
 
         100 => [
-            ['goods_id' => 6468, 'price' => 100.2, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6468, 'price' => 100.2, 'quality' => 2, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 6468, 'price' => 100.1, 'quality' => 2, 'card_type' => 'chinatelecom']
+            ['goods_id' => 6468, 'price' => 100.3, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6468, 'price' => 99.7, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 6468, 'price' => 99.8, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         200 => [
-            ['goods_id' => 6469, 'price' => 200.4, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6469, 'price' => 200.4, 'quality' => 2, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 6469, 'price' => 200.2, 'quality' => 2, 'card_type' => 'chinatelecom']
+            ['goods_id' => 6469, 'price' => 200.6, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6469, 'price' => 199.4, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 6469, 'price' => 199.6, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         300 => [
-            ['goods_id' => 6470, 'price' => 300.6, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6470, 'price' => 300.6, 'quality' => 2, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 6470, 'price' => 300.3, 'quality' => 2, 'card_type' => 'chinatelecom']
+            ['goods_id' => 6470, 'price' => 300.9, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6470, 'price' => 299.1, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 6470, 'price' => 299.4, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         500 => [
             ['goods_id' => 6471, 'price' => 501, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6471, 'price' => 501, 'quality' => 2, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 6471, 'price' => 500.5, 'quality' => 2, 'card_type' => 'chinatelecom']
+            ['goods_id' => 6471, 'price' => 498.5, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 6471, 'price' => 499, 'quality' => 2, 'card_type' => 'chinatelecom']
         ]
     ],
     'official_sn' => true, 'refill_type' => 'api'];
@@ -1195,28 +1195,28 @@ $moxj_phone = ['name' => 'moxj', 'store_id' => 64, 'qualitys' => '1',
 $moxj_fs_phone = ['name' => 'moxj_fs', 'store_id' => 65, 'qualitys' => '1',
     'amount' => [
         10 => [
-            ['goods_id' => 6644, 'price' => 9.48, 'quality' => 1, 'card_type' => 'chinamobile']
+            ['goods_id' => 6644, 'price' => 9.4, 'quality' => 1, 'card_type' => 'chinamobile']
         ],
         20 => [
-            ['goods_id' => 6645, 'price' => 18.96, 'quality' => 1, 'card_type' => 'chinamobile']
+            ['goods_id' => 6645, 'price' => 18.8, 'quality' => 1, 'card_type' => 'chinamobile']
         ],
         30 => [
-            ['goods_id' => 6646, 'price' => 28.44, 'quality' => 1, 'card_type' => 'chinamobile']
+            ['goods_id' => 6646, 'price' => 28.2, 'quality' => 1, 'card_type' => 'chinamobile']
         ],
         50 => [
-            ['goods_id' => 6647, 'price' => 47.4, 'quality' => 1, 'card_type' => 'chinamobile']
+            ['goods_id' => 6647, 'price' => 47, 'quality' => 1, 'card_type' => 'chinamobile']
         ],
         100 => [
-            ['goods_id' => 6648, 'price' => 94.8, 'quality' => 1, 'card_type' => 'chinamobile']
+            ['goods_id' => 6648, 'price' => 94, 'quality' => 1, 'card_type' => 'chinamobile']
         ],
         200 => [
-            ['goods_id' => 6649, 'price' => 189.6, 'quality' => 1, 'card_type' => 'chinamobile']
+            ['goods_id' => 6649, 'price' => 188, 'quality' => 1, 'card_type' => 'chinamobile']
         ],
         300 => [
-            ['goods_id' => 6650, 'price' => 284.4, 'quality' => 1, 'card_type' => 'chinamobile']
+            ['goods_id' => 6650, 'price' => 282, 'quality' => 1, 'card_type' => 'chinamobile']
         ],
         500 => [
-            ['goods_id' => 6651, 'price' => 474, 'quality' => 1, 'card_type' => 'chinamobile']
+            ['goods_id' => 6651, 'price' => 470, 'quality' => 1, 'card_type' => 'chinamobile']
         ],
     ],
     'official_sn' => true, 'refill_type' => 'api'];
@@ -1471,42 +1471,42 @@ $lingzhman48_phone = ['name' => 'lingzhman48', 'store_id' => 76, 'qualitys' => '
 $cangbu_phone = ['name' => 'cangbu', 'store_id' => 78,'qualitys' => '1',
     'amount' => [
         10 => [
-            ['goods_id' => 6744, 'price' => 9.54, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6744, 'price' => 9.57, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6744, 'price' => 9.45, 'quality' => 1, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6744, 'price' => 9.5, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         20 => [
-            ['goods_id' => 6745, 'price' => 19.08, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6745, 'price' => 19.14, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6745, 'price' => 18.9, 'quality' => 1, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6745, 'price' => 19, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         30 => [
-            ['goods_id' => 6746, 'price' => 28.62, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6746, 'price' => 28.71, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6746, 'price' => 28.35, 'quality' => 1, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6746, 'price' => 28.5, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         50 => [
-            ['goods_id' => 6747, 'price' => 48, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6747, 'price' => 47.85, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6747, 'price' => 47.25, 'quality' => 1, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6747, 'price' => 47.5, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         100 => [
-            ['goods_id' => 6748, 'price' => 96, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6748, 'price' => 95.7, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6748, 'price' => 94.5, 'quality' => 1, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6748, 'price' => 95, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         200 => [
-            ['goods_id' => 6749, 'price' => 192, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6749, 'price' => 191.4, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6749, 'price' => 189, 'quality' => 1, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6749, 'price' => 190, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         300 => [
-            ['goods_id' => 6750, 'price' => 288, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6750, 'price' => 287.1, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6750, 'price' => 283.5, 'quality' => 1, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6750, 'price' => 285, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         500 => [
-            ['goods_id' => 6751, 'price' => 480, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6751, 'price' => 478.5, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6751, 'price' => 472.5, 'quality' => 1, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6751, 'price' => 475, 'quality' => 1, 'card_type' => 'chinatelecom']
         ]
@@ -1596,14 +1596,14 @@ $hongxudagy_phone = ['name' => 'hongxudagy', 'store_id' => 86, 'qualitys' => '2'
 
 $yunchonggong_phone = ['name' => 'yunchonggong', 'store_id' => 87,'qualitys' => '1',
     'amount' => [
-        10 => [
-            ['goods_id' => 6797, 'price' => 9.5, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6797, 'price' => 9.47, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
-        ],
-        20 => [
-            ['goods_id' => 6798, 'price' => 19, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6798, 'price' => 18.94, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
-        ],
+//        10 => [
+//            ['goods_id' => 6797, 'price' => 9.5, 'quality' => 1, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 6797, 'price' => 9.47, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
+//        ],
+//        20 => [
+//            ['goods_id' => 6798, 'price' => 19, 'quality' => 1, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 6798, 'price' => 18.94, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
+//        ],
         30 => [
             ['goods_id' => 6799, 'price' => 28.5, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6799, 'price' => 28.41, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
@@ -1621,13 +1621,13 @@ $yunchonggong_phone = ['name' => 'yunchonggong', 'store_id' => 87,'qualitys' =>
             ['goods_id' => 6802, 'price' => 189.4, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
         ],
         300 => [
-            ['goods_id' => 6803, 'price' => 285, 'quality' => 1, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 6803, 'price' => 285, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6803, 'price' => 284.1, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
         ],
-        500 => [
-            ['goods_id' => 6804, 'price' => 475, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6804, 'price' => 473.5, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
-        ]
+//        500 => [
+//            ['goods_id' => 6804, 'price' => 475, 'quality' => 1, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 6804, 'price' => 473.5, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
+//        ]
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 
@@ -1850,14 +1850,34 @@ $lechong_phone = ['name' => 'lechong', 'store_id' => 99, 'qualitys' => '1',
 
 $xinhengyang_phone = ['name' => 'xinhengyang', 'store_id' => 100, 'qualitys' => '1',
     'amount' => [
-        10 => [['goods_id' => 6893, 'price' => 9.56, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        20 => [['goods_id' => 6894, 'price' => 19.12, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        30 => [['goods_id' => 6895, 'price' => 28.68, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        50 => [['goods_id' => 6896, 'price' => 47.8, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        100 => [['goods_id' => 6897, 'price' => 95.6, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        200 => [['goods_id' => 6898, 'price' => 191.2, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        300 => [['goods_id' => 6899, 'price' => 286.8, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        500 => [['goods_id' => 6900, 'price' => 478, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']]
+//        10 => [['goods_id' => 6893, 'price' => 9.56, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+//        20 => [['goods_id' => 6894, 'price' => 19.12, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        30 => [
+            ['goods_id' => 6895, 'price' => 28.62, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6895, 'price' => 28.59, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 6895, 'price' => 28.62, 'quality' => 1, 'card_type' => 'chinatelecom']
+        ],
+        50 => [
+            ['goods_id' => 6896, 'price' => 47.7, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6896, 'price' => 47.65, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 6896, 'price' => 47.7, 'quality' => 1, 'card_type' => 'chinatelecom']
+        ],
+        100 => [
+            ['goods_id' => 6897, 'price' => 95.4, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6897, 'price' => 95.3, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 6897, 'price' => 95.4, 'quality' => 1, 'card_type' => 'chinatelecom']
+        ],
+        200 => [
+            ['goods_id' => 6898, 'price' => 190.8, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6898, 'price' => 190.6, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 6898, 'price' => 190.8, 'quality' => 1, 'card_type' => 'chinatelecom']
+        ],
+        300 => [
+            ['goods_id' => 6899, 'price' => 286.2, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6899, 'price' => 285.9, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 6899, 'price' => 286.2, 'quality' => 1, 'card_type' => 'chinatelecom']
+        ],
+//        500 => [['goods_id' => 6900, 'price' => 478, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']]
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 
@@ -1880,27 +1900,27 @@ $miaoxt_phone = ['name' => 'miaoxt', 'store_id' => 101, 'qualitys' => '2',
         ],
         50 => [
             ['goods_id' => 6904, 'price' => 50.1, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6904, 'price' => 50, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 6904, 'price' => 50.2, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6904, 'price' => 50.1, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         100 => [
             ['goods_id' => 6905, 'price' => 100.2, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6905, 'price' => 100, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 6905, 'price' => 100.1, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6905, 'price' => 100.2, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         200 => [
             ['goods_id' => 6906, 'price' => 200.4, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6906, 'price' => 200, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 6906, 'price' => 200.2, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6906, 'price' => 200.4, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         300 => [
             ['goods_id' => 6907, 'price' => 300.6, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6907, 'price' => 300, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 6907, 'price' => 300.3, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6907, 'price' => 300.6, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         500 => [
             ['goods_id' => 6908, 'price' => 501, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6908, 'price' => 500, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 6908, 'price' => 500.5, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6908, 'price' => 501, 'quality' => 2, 'card_type' => 'chinatelecom']
         ]
     ],
@@ -1921,14 +1941,14 @@ $tianyan_phone = ['name' => 'tianyan', 'store_id' => 102, 'qualitys' => '1',
 
 $yunsuoyaoman_phone = ['name' => 'yunsuoyaoman', 'store_id' => 110,'qualitys' => '5',
     'amount' => [
-        10 => [['goods_id' => 6970, 'price' => 9.16, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        20 => [['goods_id' => 6971, 'price' => 18.32, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        30 => [['goods_id' => 6972, 'price' => 27.48, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        50 => [['goods_id' => 6973, 'price' => 45.8, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        100 => [['goods_id' => 6974, 'price' => 91.6, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        200 => [['goods_id' => 6975, 'price' => 183.2, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        300 => [['goods_id' => 6976, 'price' => 274.8, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        500 => [['goods_id' => 6977, 'price' => 458, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']]
+        10 => [['goods_id' => 6970, 'price' => 9.22, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        20 => [['goods_id' => 6971, 'price' => 18.44, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        30 => [['goods_id' => 6972, 'price' => 27.66, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        50 => [['goods_id' => 6973, 'price' => 46.1, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        100 => [['goods_id' => 6974, 'price' => 92.2, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        200 => [['goods_id' => 6975, 'price' => 184.4, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        300 => [['goods_id' => 6976, 'price' => 276.5, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        500 => [['goods_id' => 6977, 'price' => 461, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']]
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 
@@ -2189,22 +2209,22 @@ $yilin_phone = ['name' => 'yilin', 'store_id' => 115, 'qualitys' => '1',
         30 => [
             ['goods_id' => 7005, 'price' => 28.68, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 7005, 'price' => 28.62, 'quality' => 1, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 7005, 'price' => 28.89, 'quality' => 1, 'card_type' => 'chinatelecom']
+            ['goods_id' => 7005, 'price' => 28.83, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         50 => [
             ['goods_id' => 7006, 'price' => 47.8, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 7006, 'price' => 47.7, 'quality' => 1, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 7006, 'price' => 48.15, 'quality' => 1, 'card_type' => 'chinatelecom']
+            ['goods_id' => 7006, 'price' => 48.05, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         100 => [
             ['goods_id' => 7007, 'price' => 95.6, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 7007, 'price' => 95.4, 'quality' => 1, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 7007, 'price' => 96.3, 'quality' => 1, 'card_type' => 'chinatelecom']
+            ['goods_id' => 7007, 'price' => 96.1, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         200 => [
             ['goods_id' => 7008, 'price' => 191.2, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 7008, 'price' => 190.8, 'quality' => 1, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 7008, 'price' => 192.6, 'quality' => 1, 'card_type' => 'chinatelecom']
+            ['goods_id' => 7008, 'price' => 192.2, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         300 => [
             ['goods_id' => 7009, 'price' => 286.8, 'quality' => 1, 'card_type' => 'chinamobile'],
@@ -2377,47 +2397,47 @@ $guochuang_nation_phone = ['name' => 'guochuang_nation', 'store_id' => 121, 'qua
         5  => [
             ['goods_id' => 7055, 'price' => 5.205, 'quality' => 2, 'card_type' => 'chinamobile'],
             ['goods_id' => 7055, 'price' => 5.155, 'quality' => 2, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 7055, 'price' => 5.26, 'quality' => 2, 'card_type' => 'chinatelecom']
+            ['goods_id' => 7055, 'price' => 5.205, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         6  => [
             ['goods_id' => 7056, 'price' => 6.2064, 'quality' => 2, 'card_type' => 'chinamobile'],
             ['goods_id' => 7056, 'price' => 6.186, 'quality' => 2, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 7056, 'price' => 6.312, 'quality' => 2, 'card_type' => 'chinatelecom']
+            ['goods_id' => 7056, 'price' => 6.246, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         7  => [
             ['goods_id' => 7057, 'price' => 7.2072, 'quality' => 2, 'card_type' => 'chinamobile'],
             ['goods_id' => 7057, 'price' => 7.217, 'quality' => 2, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 7057, 'price' => 7.364, 'quality' => 2, 'card_type' => 'chinatelecom']
+            ['goods_id' => 7057, 'price' => 7.287, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         8  => [
             ['goods_id' => 7058, 'price' => 8.208, 'quality' => 2, 'card_type' => 'chinamobile'],
             ['goods_id' => 7058, 'price' => 8.248, 'quality' => 2, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 7058, 'price' => 8.416, 'quality' => 2, 'card_type' => 'chinatelecom']
+            ['goods_id' => 7058, 'price' => 8.328, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         9  => [
             ['goods_id' => 7059, 'price' => 9.2088, 'quality' => 2, 'card_type' => 'chinamobile'],
             ['goods_id' => 7059, 'price' => 9.279, 'quality' => 2, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 7059, 'price' => 9.468, 'quality' => 2, 'card_type' => 'chinatelecom']
+            ['goods_id' => 7059, 'price' => 9.369, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
 
         10 => [
-            ['goods_id' => 7060, 'price' => 10.21, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 7060, 'price' => 10.24, 'quality' => 2, 'card_type' => 'chinamobile'],
             ['goods_id' => 7060, 'price' => 10.07, 'quality' => 2, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 7060, 'price' => 10.21, 'quality' => 2, 'card_type' => 'chinatelecom']
+            ['goods_id' => 7060, 'price' => 10.26, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         20 => [
-            ['goods_id' => 7061, 'price' => 20.22, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 7061, 'price' => 20.09, 'quality' => 2, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 7061, 'price' => 20.22, 'quality' => 2, 'card_type' => 'chinatelecom']
+            ['goods_id' => 7061, 'price' => 20.48, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 7061, 'price' => 20.52, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7061, 'price' => 20.62, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         30 => [
-            ['goods_id' => 7062, 'price' => 30.12, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 7062, 'price' => 30.135, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7062, 'price' => 30.21, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 7062, 'price' => 30.381, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7062, 'price' => 30.39, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         50 => [
             ['goods_id' => 7063, 'price' => 50.2, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 7063, 'price' => 50.225, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7063, 'price' => 50.4, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7063, 'price' => 50.4, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         100 => [
@@ -2480,14 +2500,14 @@ $shimier_phone = ['name' => 'shimier', 'store_id' => 123,'qualitys' => '1',
 
 $zhongst_mix_phone = ['name' => 'zhongst_mix', 'store_id' => 124, 'qualitys' => '2',
     'amount' => [
-        10 => [['goods_id' => 7084, 'price' => 9.95, 'quality' => 2, 'card_type' => 'chinamobile']],
-        20 => [['goods_id' => 7085, 'price' => 19.9, 'quality' => 2, 'card_type' => 'chinamobile']],
-        30 => [['goods_id' => 7086, 'price' => 29.85, 'quality' => 2, 'card_type' => 'chinamobile']],
-        50 => [['goods_id' => 7087, 'price' => 49.75, 'quality' => 2, 'card_type' => 'chinamobile']],
-        100 => [['goods_id' => 7088, 'price' => 99.5, 'quality' => 2, 'card_type' => 'chinamobile']],
-        200 => [['goods_id' => 7089, 'price' => 199, 'quality' => 2, 'card_type' => 'chinamobile']],
-        300 => [['goods_id' => 7090, 'price' => 298.5, 'quality' => 2, 'card_type' => 'chinamobile']],
-        500 => [['goods_id' => 7091, 'price' => 497.5, 'quality' => 2, 'card_type' => 'chinamobile']]
+        10 => [['goods_id' => 7084, 'price' => 9.93, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        20 => [['goods_id' => 7085, 'price' => 19.86, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        30 => [['goods_id' => 7086, 'price' => 29.79, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        50 => [['goods_id' => 7087, 'price' => 49.65, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        100 => [['goods_id' => 7088, 'price' => 99.3, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        200 => [['goods_id' => 7089, 'price' => 198.6, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        300 => [['goods_id' => 7090, 'price' => 297.9, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        500 => [['goods_id' => 7091, 'price' => 496.5, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']]
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 
@@ -2544,35 +2564,35 @@ $hangtong_phone = ['name' => 'hangtong', 'store_id' => 126,'qualitys' => '1',
 $dashang_phone = ['name' => 'dashang', 'store_id' => 127, 'qualitys' => '2',
     'amount' => [
         10 => [
-            ['goods_id' => 7108, 'price' => 9.98, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7108, 'price' => 9.99, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7108, 'price' => 9.98, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         20 => [
-            ['goods_id' => 7109, 'price' => 19.96, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7109, 'price' => 19.98, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7109, 'price' => 19.96, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         30 => [
-            ['goods_id' => 7110, 'price' => 29.94, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7110, 'price' => 29.97, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7110, 'price' => 29.94, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         50 => [
-            ['goods_id' => 7111, 'price' => 49.9, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7111, 'price' => 49.875, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7111, 'price' => 49.9, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         100 => [
-            ['goods_id' => 7112, 'price' => 99.8, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7112, 'price' => 99.75, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7112, 'price' => 99.8, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         200 => [
-            ['goods_id' => 7113, 'price' => 199.6, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7113, 'price' => 199.5, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7113, 'price' => 199.6, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         300 => [
-            ['goods_id' => 7114, 'price' => 299.4, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7114, 'price' => 299.25, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7114, 'price' => 299.4, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         500 => [
-            ['goods_id' => 7115, 'price' => 499, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7115, 'price' => 498.75, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7115, 'price' => 499, 'quality' => 2, 'card_type' => 'chinatelecom']
         ]
     ],
@@ -2688,7 +2708,7 @@ $chizeng_phone = ['name' => 'chizeng', 'store_id' => 133, 'qualitys' => '1',
         30 => [
 //            ['goods_id' => 7149, 'price' => 28.8, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 7149, 'price' => 28.35, 'quality' => 1, 'card_type' => 'chinaunicom'],
-//            ['goods_id' => 7149, 'price' => 28.5, 'quality' => 1, 'card_type' => 'chinatelecom']
+            ['goods_id' => 7149, 'price' => 28.5, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         50 => [
             ['goods_id' => 7150, 'price' => 47.45, 'quality' => 1, 'card_type' => 'chinamobile'],
@@ -2705,11 +2725,11 @@ $chizeng_phone = ['name' => 'chizeng', 'store_id' => 133, 'qualitys' => '1',
             ['goods_id' => 7152, 'price' => 189, 'quality' => 1, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7152, 'price' => 190, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
-        300 => [
+//        300 => [
 //            ['goods_id' => 7153, 'price' => 285.3, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 7153, 'price' => 283.5, 'quality' => 1, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 7153, 'price' => 283.5, 'quality' => 1, 'card_type' => 'chinaunicom'],
 //            ['goods_id' => 7153, 'price' => 284.7, 'quality' => 1, 'card_type' => 'chinatelecom']
-        ],
+//        ],
 //        500 => [
 //            ['goods_id' => 7154, 'price' => 475.5, 'quality' => 1, 'card_type' => 'chinamobile'],
 //            ['goods_id' => 7154, 'price' => 472.5, 'quality' => 1, 'card_type' => 'chinaunicom'],
@@ -2780,10 +2800,22 @@ $xingzy_normal_phone = ['name' => 'xingzy_normal', 'store_id' => 137, 'qualitys'
     'amount' => [
 //        10 => [['goods_id' => 7179, 'price' => 9.55, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']],
 //        20 => [['goods_id' => 7180, 'price' => 19.1, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']],
-        30 => [['goods_id' => 7181, 'price' => 28.65, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']],
-        50 => [['goods_id' => 7182, 'price' => 47.75, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']],
-        100 => [['goods_id' => 7183, 'price' => 95.5, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']],
-        200 => [['goods_id' => 7184, 'price' => 191, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']],
+        30 => [
+            ['goods_id' => 7181, 'price' => 28.65, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7181, 'price' => 28.74, 'quality' => 1, 'card_type' => 'chinatelecom']
+        ],
+        50 => [
+            ['goods_id' => 7182, 'price' => 47.75, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7182, 'price' => 47.9, 'quality' => 1, 'card_type' => 'chinatelecom']
+        ],
+        100 => [
+            ['goods_id' => 7183, 'price' => 95.5, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7183, 'price' => 95.8, 'quality' => 1, 'card_type' => 'chinatelecom']
+        ],
+        200 => [
+            ['goods_id' => 7184, 'price' => 191, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7184, 'price' => 191.6, 'quality' => 1, 'card_type' => 'chinatelecom']
+        ],
 //        300 => [['goods_id' => 7185, 'price' => 286.5, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']],
 //        500 => [['goods_id' => 7186, 'price' => 477.5, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']]
     ],
@@ -2828,6 +2860,87 @@ $dinghui_phone = ['name' => 'dinghui', 'store_id' => 140, 'qualitys' => '5',
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 
+$xiaoniu_hf_phone = ['name' => 'xiaoniu_hf', 'store_id' => 141, 'qualitys' => '3',
+    'amount' => [
+        10 => [['goods_id' => 7211, 'price' => 9.7,  'quality' => 3, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        20 => [['goods_id' => 7212, 'price' => 19.4, 'quality' => 3, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        30 => [['goods_id' => 7213, 'price' => 29.1, 'quality' => 3, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        50 => [['goods_id' => 7214, 'price' => 48.5, 'quality' => 3, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        100 => [['goods_id' => 7215, 'price' => 97, 'quality' => 3, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        200 => [['goods_id' => 7216, 'price' => 194, 'quality' => 3, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        300 => [['goods_id' => 7217, 'price' => 291, 'quality' => 3, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        500 => [['goods_id' => 7218, 'price' => 485, 'quality' => 3, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']]
+    ],
+    'official_sn' => true, 'refill_type' => 'api'];
+
+$shuoruan_phone = ['name' => 'shuoruan', 'store_id' => 142, 'qualitys' => '2',
+    'amount' => [
+//        10 => [['goods_id' => 7219, 'price' => 9.97, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+//        20 => [['goods_id' => 7220, 'price' => 19.94, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+//        30 => [['goods_id' => 7221, 'price' => 29.91, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        50 => [['goods_id' => 7222, 'price' => 49.85, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        100 => [['goods_id' => 7223, 'price' => 99.7, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        200 => [['goods_id' => 7224, 'price' => 199.4, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+//        300 => [['goods_id' => 7225, 'price' => 299.1, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+//        500 => [['goods_id' => 7226, 'price' => 498.5, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']]
+    ],
+    'official_sn' => true, 'refill_type' => 'api'];
+
+$linzhu_phone = ['name' => 'linzhu', 'store_id' => 144,'qualitys' => '1',
+    'amount' => [
+        10 => [['goods_id' => 7235, 'price' => 9.51,  'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        20 => [['goods_id' => 7236, 'price' => 19.02, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        30 => [['goods_id' => 7237, 'price' => 28.53, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        50 => [['goods_id' => 7238, 'price' => 47.55, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        100 => [['goods_id' => 7239, 'price' => 95.1, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        200 => [['goods_id' => 7240, 'price' => 190.20, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        300 => [['goods_id' => 7241, 'price' => 285.30, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        500 => [['goods_id' => 7242, 'price' => 475.50, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']]
+    ],
+    'official_sn' => true, 'refill_type' => 'api'];
+
+$fangxing_phone = ['name' => 'fangxing', 'store_id' => 145, 'qualitys' => '2',
+    'amount' => [
+        10 => [['goods_id' => 7243, 'price' => 9.68, 'quality' => 2, 'card_type' => 'chinamobile']],
+        20 => [['goods_id' => 7244, 'price' => 19.36, 'quality' => 2, 'card_type' => 'chinamobile']],
+        30 => [['goods_id' => 7245, 'price' => 29.04, 'quality' => 2, 'card_type' => 'chinamobile']],
+        50 => [['goods_id' => 7246, 'price' => 48.4, 'quality' => 2, 'card_type' => 'chinamobile']],
+        100 => [['goods_id' => 7247, 'price' => 96.8, 'quality' => 2, 'card_type' => 'chinamobile']],
+        200 => [['goods_id' => 7248, 'price' => 193.6, 'quality' => 2, 'card_type' => 'chinamobile']],
+        300 => [['goods_id' => 7249, 'price' => 290.4, 'quality' => 2, 'card_type' => 'chinamobile']],
+        500 => [['goods_id' => 7250, 'price' => 484, 'quality' => 2, 'card_type' => 'chinamobile']]
+    ],
+    'official_sn' => true, 'refill_type' => 'api'];
+
+$huafutongman_phone = ['name' => 'huafutongman', 'store_id' => 146,'qualitys' => '5',
+    'amount' => [
+//        10 => [
+//            ['goods_id' => 7251, 'price' => 9.13, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom'],
+//        ],
+//        20 => [
+//            ['goods_id' => 7252, 'price' => 18.26, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom'],
+//        ],
+//        30 => [
+//            ['goods_id' => 7253, 'price' => 27.39, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom'],
+//        ],
+        50 => [
+            ['goods_id' => 7254, 'price' => 45.65, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom'],
+        ],
+        100 => [
+            ['goods_id' => 7255, 'price' => 91.3, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom'],
+        ],
+        200 => [
+            ['goods_id' => 7256, 'price' => 182.6, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom'],
+        ],
+//        300 => [
+//            ['goods_id' => 7257, 'price' => 273.9, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom'],
+//        ],
+//        500 => [
+//            ['goods_id' => 7258, 'price' => 456.5, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom'],
+//        ]
+    ],
+    'refill_type' => 'api'];
+
 $phone_providers = [
 //    ['name' => 'beixt', 'cfg' => $beixt_phone],
 //    ['name' => 'bxtwt', 'cfg' => $bxtwt_phone],
@@ -2934,7 +3047,11 @@ $phone_providers = [
     ['name' => 'xingzy_normal', 'cfg' => $xingzy_normal_phone],
     ['name' => 'pushang', 'cfg' => $pushang_phone],
     ['name' => 'huafutong', 'cfg' => $huafutong_phone],
-    ['name' => 'dinghui', 'cfg' => $dinghui_phone]
+    ['name' => 'dinghui', 'cfg' => $dinghui_phone],
+    ['name' => 'xiaoniu_hf', 'cfg' => $xiaoniu_hf_phone],
+    ['name' => 'shuoruan', 'cfg' => $shuoruan_phone],
+    ['name' => 'linzhu', 'cfg' => $linzhu_phone],
+    ['name' => 'huafutongman', 'cfg' => $huafutongman_phone]
 ];
 $config['phone_providers'] = $phone_providers;
 
@@ -2981,7 +3098,7 @@ $config['merchant_retry_times'] = [
         'qualities' => [1 => ['secs' => 1200, 'times' => 100], 2 => ['secs' => 100, 'times' => 5]],
         'lower_ratio' => ['ratio' => 0.9, 'period' => 3600], 'profit_ratio' => 0.003],
     10216 => [ //飘逸-10分
-        'qualities' => [1 => ['secs' => 630, 'times' => 100], 2 => ['secs' => 70, 'times' => 5]],
+        'qualities' => [1 => ['secs' => 530, 'times' => 100], 2 => ['secs' => 70, 'times' => 5]],
         'lower_ratio' => ['ratio' => 0.4, 'period' => 3600], 'profit_ratio' => 0.015],
     10217 => [ //天采-混充50m
         'qualities' => [1 => ['secs' => 2400, 'times' => 200], 2 => ['secs' => 600, 'times' => 20]],
@@ -2989,7 +3106,13 @@ $config['merchant_retry_times'] = [
 
     10231 => [ //汇通-普充2号
         'qualities' => [1 => ['secs' => 1000, 'times' => 200], 2 => ['secs' => 200, 'times' => 20]],
-        'lower_ratio' => ['ratio' => 0.6, 'period' => 3600], 'profit_ratio' => 0.003]
+        'lower_ratio' => ['ratio' => 0.6, 'period' => 3600], 'profit_ratio' => 0.003],
+    10233 => [ //瑾相联-10分
+        'qualities' => [1 => ['secs' => 630, 'times' => 100], 2 => ['secs' => 70, 'times' => 5]],
+        'lower_ratio' => ['ratio' => 0.4, 'period' => 3600], 'profit_ratio' => 0.015],
+    10236 => [ //邀友補充-05號通道
+        'qualities' => [1 => ['secs' => 3300, 'times' => 1000], 2 => ['secs' => 300, 'times' => 5]],
+        'lower_ratio' => ['ratio' => 0.99, 'period' => 3600], 'profit_ratio' => 0.015],
 ];
 
 //// "status": 1 //状态 0:空号;1:实号;2:停机;3:库无;4:沉默号;5:风险号

+ 233 - 110
data/config/xyz/refill.ini.php

@@ -629,36 +629,36 @@ $zhongst_phone = ['name' => 'zhongst', 'store_id' => 39, 'qualitys' => '2',
         ],
 
         30 => [
-            ['goods_id' => 6466, 'price' => 30.06, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6466, 'price' => 30.06, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 6466, 'price' => 30.12, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6466, 'price' => 29.91, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6466, 'price' => 30.09, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
 
         50 => [
-            ['goods_id' => 6467, 'price' => 50.1, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6467, 'price' => 50.1, 'quality' => 2, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 6467, 'price' => 50.05, 'quality' => 2, 'card_type' => 'chinatelecom']
+            ['goods_id' => 6467, 'price' => 50.15, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6467, 'price' => 49.85, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 6467, 'price' => 49.9, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
 
         100 => [
-            ['goods_id' => 6468, 'price' => 100.2, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6468, 'price' => 100.2, 'quality' => 2, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 6468, 'price' => 100.1, 'quality' => 2, 'card_type' => 'chinatelecom']
+            ['goods_id' => 6468, 'price' => 100.3, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6468, 'price' => 99.7, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 6468, 'price' => 99.8, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         200 => [
-            ['goods_id' => 6469, 'price' => 200.4, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6469, 'price' => 200.4, 'quality' => 2, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 6469, 'price' => 200.2, 'quality' => 2, 'card_type' => 'chinatelecom']
+            ['goods_id' => 6469, 'price' => 200.6, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6469, 'price' => 199.4, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 6469, 'price' => 199.6, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         300 => [
-            ['goods_id' => 6470, 'price' => 300.6, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6470, 'price' => 300.6, 'quality' => 2, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 6470, 'price' => 300.3, 'quality' => 2, 'card_type' => 'chinatelecom']
+            ['goods_id' => 6470, 'price' => 300.9, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6470, 'price' => 299.1, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 6470, 'price' => 299.4, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         500 => [
             ['goods_id' => 6471, 'price' => 501, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6471, 'price' => 501, 'quality' => 2, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 6471, 'price' => 500.5, 'quality' => 2, 'card_type' => 'chinatelecom']
+            ['goods_id' => 6471, 'price' => 498.5, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 6471, 'price' => 499, 'quality' => 2, 'card_type' => 'chinatelecom']
         ]
     ],
     'official_sn' => true, 'refill_type' => 'api'];
@@ -1195,28 +1195,28 @@ $moxj_phone = ['name' => 'moxj', 'store_id' => 64, 'qualitys' => '1',
 $moxj_fs_phone = ['name' => 'moxj_fs', 'store_id' => 65, 'qualitys' => '1',
     'amount' => [
         10 => [
-            ['goods_id' => 6644, 'price' => 9.48, 'quality' => 1, 'card_type' => 'chinamobile']
+            ['goods_id' => 6644, 'price' => 9.4, 'quality' => 1, 'card_type' => 'chinamobile']
         ],
         20 => [
-            ['goods_id' => 6645, 'price' => 18.96, 'quality' => 1, 'card_type' => 'chinamobile']
+            ['goods_id' => 6645, 'price' => 18.8, 'quality' => 1, 'card_type' => 'chinamobile']
         ],
         30 => [
-            ['goods_id' => 6646, 'price' => 28.44, 'quality' => 1, 'card_type' => 'chinamobile']
+            ['goods_id' => 6646, 'price' => 28.2, 'quality' => 1, 'card_type' => 'chinamobile']
         ],
         50 => [
-            ['goods_id' => 6647, 'price' => 47.4, 'quality' => 1, 'card_type' => 'chinamobile']
+            ['goods_id' => 6647, 'price' => 47, 'quality' => 1, 'card_type' => 'chinamobile']
         ],
         100 => [
-            ['goods_id' => 6648, 'price' => 94.8, 'quality' => 1, 'card_type' => 'chinamobile']
+            ['goods_id' => 6648, 'price' => 94, 'quality' => 1, 'card_type' => 'chinamobile']
         ],
         200 => [
-            ['goods_id' => 6649, 'price' => 189.6, 'quality' => 1, 'card_type' => 'chinamobile']
+            ['goods_id' => 6649, 'price' => 188, 'quality' => 1, 'card_type' => 'chinamobile']
         ],
         300 => [
-            ['goods_id' => 6650, 'price' => 284.4, 'quality' => 1, 'card_type' => 'chinamobile']
+            ['goods_id' => 6650, 'price' => 282, 'quality' => 1, 'card_type' => 'chinamobile']
         ],
         500 => [
-            ['goods_id' => 6651, 'price' => 474, 'quality' => 1, 'card_type' => 'chinamobile']
+            ['goods_id' => 6651, 'price' => 470, 'quality' => 1, 'card_type' => 'chinamobile']
         ],
     ],
     'official_sn' => true, 'refill_type' => 'api'];
@@ -1471,42 +1471,42 @@ $lingzhman48_phone = ['name' => 'lingzhman48', 'store_id' => 76, 'qualitys' => '
 $cangbu_phone = ['name' => 'cangbu', 'store_id' => 78,'qualitys' => '1',
     'amount' => [
         10 => [
-            ['goods_id' => 6744, 'price' => 9.54, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6744, 'price' => 9.57, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6744, 'price' => 9.45, 'quality' => 1, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6744, 'price' => 9.5, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         20 => [
-            ['goods_id' => 6745, 'price' => 19.08, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6745, 'price' => 19.14, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6745, 'price' => 18.9, 'quality' => 1, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6745, 'price' => 19, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         30 => [
-            ['goods_id' => 6746, 'price' => 28.62, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6746, 'price' => 28.71, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6746, 'price' => 28.35, 'quality' => 1, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6746, 'price' => 28.5, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         50 => [
-            ['goods_id' => 6747, 'price' => 48, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6747, 'price' => 47.85, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6747, 'price' => 47.25, 'quality' => 1, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6747, 'price' => 47.5, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         100 => [
-            ['goods_id' => 6748, 'price' => 96, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6748, 'price' => 95.7, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6748, 'price' => 94.5, 'quality' => 1, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6748, 'price' => 95, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         200 => [
-            ['goods_id' => 6749, 'price' => 192, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6749, 'price' => 191.4, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6749, 'price' => 189, 'quality' => 1, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6749, 'price' => 190, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         300 => [
-            ['goods_id' => 6750, 'price' => 288, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6750, 'price' => 287.1, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6750, 'price' => 283.5, 'quality' => 1, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6750, 'price' => 285, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         500 => [
-            ['goods_id' => 6751, 'price' => 480, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6751, 'price' => 478.5, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6751, 'price' => 472.5, 'quality' => 1, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6751, 'price' => 475, 'quality' => 1, 'card_type' => 'chinatelecom']
         ]
@@ -1596,14 +1596,14 @@ $hongxudagy_phone = ['name' => 'hongxudagy', 'store_id' => 86, 'qualitys' => '2'
 
 $yunchonggong_phone = ['name' => 'yunchonggong', 'store_id' => 87,'qualitys' => '1',
     'amount' => [
-        10 => [
-            ['goods_id' => 6797, 'price' => 9.5, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6797, 'price' => 9.47, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
-        ],
-        20 => [
-            ['goods_id' => 6798, 'price' => 19, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6798, 'price' => 18.94, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
-        ],
+//        10 => [
+//            ['goods_id' => 6797, 'price' => 9.5, 'quality' => 1, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 6797, 'price' => 9.47, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
+//        ],
+//        20 => [
+//            ['goods_id' => 6798, 'price' => 19, 'quality' => 1, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 6798, 'price' => 18.94, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
+//        ],
         30 => [
             ['goods_id' => 6799, 'price' => 28.5, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6799, 'price' => 28.41, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
@@ -1621,13 +1621,13 @@ $yunchonggong_phone = ['name' => 'yunchonggong', 'store_id' => 87,'qualitys' =>
             ['goods_id' => 6802, 'price' => 189.4, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
         ],
         300 => [
-            ['goods_id' => 6803, 'price' => 285, 'quality' => 1, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 6803, 'price' => 285, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6803, 'price' => 284.1, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
         ],
-        500 => [
-            ['goods_id' => 6804, 'price' => 475, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6804, 'price' => 473.5, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
-        ]
+//        500 => [
+//            ['goods_id' => 6804, 'price' => 475, 'quality' => 1, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 6804, 'price' => 473.5, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
+//        ]
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 
@@ -1850,14 +1850,34 @@ $lechong_phone = ['name' => 'lechong', 'store_id' => 99, 'qualitys' => '1',
 
 $xinhengyang_phone = ['name' => 'xinhengyang', 'store_id' => 100, 'qualitys' => '1',
     'amount' => [
-        10 => [['goods_id' => 6893, 'price' => 9.56, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        20 => [['goods_id' => 6894, 'price' => 19.12, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        30 => [['goods_id' => 6895, 'price' => 28.68, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        50 => [['goods_id' => 6896, 'price' => 47.8, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        100 => [['goods_id' => 6897, 'price' => 95.6, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        200 => [['goods_id' => 6898, 'price' => 191.2, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        300 => [['goods_id' => 6899, 'price' => 286.8, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        500 => [['goods_id' => 6900, 'price' => 478, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']]
+//        10 => [['goods_id' => 6893, 'price' => 9.56, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+//        20 => [['goods_id' => 6894, 'price' => 19.12, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        30 => [
+            ['goods_id' => 6895, 'price' => 28.62, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6895, 'price' => 28.59, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 6895, 'price' => 28.62, 'quality' => 1, 'card_type' => 'chinatelecom']
+        ],
+        50 => [
+            ['goods_id' => 6896, 'price' => 47.7, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6896, 'price' => 47.65, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 6896, 'price' => 47.7, 'quality' => 1, 'card_type' => 'chinatelecom']
+        ],
+        100 => [
+            ['goods_id' => 6897, 'price' => 95.4, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6897, 'price' => 95.3, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 6897, 'price' => 95.4, 'quality' => 1, 'card_type' => 'chinatelecom']
+        ],
+        200 => [
+            ['goods_id' => 6898, 'price' => 190.8, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6898, 'price' => 190.6, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 6898, 'price' => 190.8, 'quality' => 1, 'card_type' => 'chinatelecom']
+        ],
+        300 => [
+            ['goods_id' => 6899, 'price' => 286.2, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6899, 'price' => 285.9, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 6899, 'price' => 286.2, 'quality' => 1, 'card_type' => 'chinatelecom']
+        ],
+//        500 => [['goods_id' => 6900, 'price' => 478, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']]
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 
@@ -1880,27 +1900,27 @@ $miaoxt_phone = ['name' => 'miaoxt', 'store_id' => 101, 'qualitys' => '2',
         ],
         50 => [
             ['goods_id' => 6904, 'price' => 50.1, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6904, 'price' => 50, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 6904, 'price' => 50.2, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6904, 'price' => 50.1, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         100 => [
             ['goods_id' => 6905, 'price' => 100.2, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6905, 'price' => 100, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 6905, 'price' => 100.1, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6905, 'price' => 100.2, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         200 => [
             ['goods_id' => 6906, 'price' => 200.4, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6906, 'price' => 200, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 6906, 'price' => 200.2, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6906, 'price' => 200.4, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         300 => [
             ['goods_id' => 6907, 'price' => 300.6, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6907, 'price' => 300, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 6907, 'price' => 300.3, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6907, 'price' => 300.6, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         500 => [
             ['goods_id' => 6908, 'price' => 501, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6908, 'price' => 500, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 6908, 'price' => 500.5, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6908, 'price' => 501, 'quality' => 2, 'card_type' => 'chinatelecom']
         ]
     ],
@@ -1921,14 +1941,14 @@ $tianyan_phone = ['name' => 'tianyan', 'store_id' => 102, 'qualitys' => '1',
 
 $yunsuoyaoman_phone = ['name' => 'yunsuoyaoman', 'store_id' => 110,'qualitys' => '5',
     'amount' => [
-        10 => [['goods_id' => 6970, 'price' => 9.16, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        20 => [['goods_id' => 6971, 'price' => 18.32, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        30 => [['goods_id' => 6972, 'price' => 27.48, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        50 => [['goods_id' => 6973, 'price' => 45.8, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        100 => [['goods_id' => 6974, 'price' => 91.6, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        200 => [['goods_id' => 6975, 'price' => 183.2, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        300 => [['goods_id' => 6976, 'price' => 274.8, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        500 => [['goods_id' => 6977, 'price' => 458, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']]
+        10 => [['goods_id' => 6970, 'price' => 9.22, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        20 => [['goods_id' => 6971, 'price' => 18.44, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        30 => [['goods_id' => 6972, 'price' => 27.66, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        50 => [['goods_id' => 6973, 'price' => 46.1, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        100 => [['goods_id' => 6974, 'price' => 92.2, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        200 => [['goods_id' => 6975, 'price' => 184.4, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        300 => [['goods_id' => 6976, 'price' => 276.5, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        500 => [['goods_id' => 6977, 'price' => 461, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']]
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 
@@ -2189,22 +2209,22 @@ $yilin_phone = ['name' => 'yilin', 'store_id' => 115, 'qualitys' => '1',
         30 => [
             ['goods_id' => 7005, 'price' => 28.68, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 7005, 'price' => 28.62, 'quality' => 1, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 7005, 'price' => 28.89, 'quality' => 1, 'card_type' => 'chinatelecom']
+            ['goods_id' => 7005, 'price' => 28.83, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         50 => [
             ['goods_id' => 7006, 'price' => 47.8, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 7006, 'price' => 47.7, 'quality' => 1, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 7006, 'price' => 48.15, 'quality' => 1, 'card_type' => 'chinatelecom']
+            ['goods_id' => 7006, 'price' => 48.05, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         100 => [
             ['goods_id' => 7007, 'price' => 95.6, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 7007, 'price' => 95.4, 'quality' => 1, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 7007, 'price' => 96.3, 'quality' => 1, 'card_type' => 'chinatelecom']
+            ['goods_id' => 7007, 'price' => 96.1, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         200 => [
             ['goods_id' => 7008, 'price' => 191.2, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 7008, 'price' => 190.8, 'quality' => 1, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 7008, 'price' => 192.6, 'quality' => 1, 'card_type' => 'chinatelecom']
+            ['goods_id' => 7008, 'price' => 192.2, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         300 => [
             ['goods_id' => 7009, 'price' => 286.8, 'quality' => 1, 'card_type' => 'chinamobile'],
@@ -2377,47 +2397,47 @@ $guochuang_nation_phone = ['name' => 'guochuang_nation', 'store_id' => 121, 'qua
         5  => [
             ['goods_id' => 7055, 'price' => 5.205, 'quality' => 2, 'card_type' => 'chinamobile'],
             ['goods_id' => 7055, 'price' => 5.155, 'quality' => 2, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 7055, 'price' => 5.26, 'quality' => 2, 'card_type' => 'chinatelecom']
+            ['goods_id' => 7055, 'price' => 5.205, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         6  => [
             ['goods_id' => 7056, 'price' => 6.2064, 'quality' => 2, 'card_type' => 'chinamobile'],
             ['goods_id' => 7056, 'price' => 6.186, 'quality' => 2, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 7056, 'price' => 6.312, 'quality' => 2, 'card_type' => 'chinatelecom']
+            ['goods_id' => 7056, 'price' => 6.246, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         7  => [
             ['goods_id' => 7057, 'price' => 7.2072, 'quality' => 2, 'card_type' => 'chinamobile'],
             ['goods_id' => 7057, 'price' => 7.217, 'quality' => 2, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 7057, 'price' => 7.364, 'quality' => 2, 'card_type' => 'chinatelecom']
+            ['goods_id' => 7057, 'price' => 7.287, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         8  => [
             ['goods_id' => 7058, 'price' => 8.208, 'quality' => 2, 'card_type' => 'chinamobile'],
             ['goods_id' => 7058, 'price' => 8.248, 'quality' => 2, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 7058, 'price' => 8.416, 'quality' => 2, 'card_type' => 'chinatelecom']
+            ['goods_id' => 7058, 'price' => 8.328, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         9  => [
             ['goods_id' => 7059, 'price' => 9.2088, 'quality' => 2, 'card_type' => 'chinamobile'],
             ['goods_id' => 7059, 'price' => 9.279, 'quality' => 2, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 7059, 'price' => 9.468, 'quality' => 2, 'card_type' => 'chinatelecom']
+            ['goods_id' => 7059, 'price' => 9.369, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
 
         10 => [
-            ['goods_id' => 7060, 'price' => 10.21, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 7060, 'price' => 10.24, 'quality' => 2, 'card_type' => 'chinamobile'],
             ['goods_id' => 7060, 'price' => 10.07, 'quality' => 2, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 7060, 'price' => 10.21, 'quality' => 2, 'card_type' => 'chinatelecom']
+            ['goods_id' => 7060, 'price' => 10.26, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         20 => [
-            ['goods_id' => 7061, 'price' => 20.22, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 7061, 'price' => 20.09, 'quality' => 2, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 7061, 'price' => 20.22, 'quality' => 2, 'card_type' => 'chinatelecom']
+            ['goods_id' => 7061, 'price' => 20.48, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 7061, 'price' => 20.52, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7061, 'price' => 20.62, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         30 => [
-            ['goods_id' => 7062, 'price' => 30.12, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 7062, 'price' => 30.135, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7062, 'price' => 30.21, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 7062, 'price' => 30.381, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7062, 'price' => 30.39, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         50 => [
             ['goods_id' => 7063, 'price' => 50.2, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 7063, 'price' => 50.225, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7063, 'price' => 50.4, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7063, 'price' => 50.4, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         100 => [
@@ -2480,14 +2500,14 @@ $shimier_phone = ['name' => 'shimier', 'store_id' => 123,'qualitys' => '1',
 
 $zhongst_mix_phone = ['name' => 'zhongst_mix', 'store_id' => 124, 'qualitys' => '2',
     'amount' => [
-        10 => [['goods_id' => 7084, 'price' => 9.95, 'quality' => 2, 'card_type' => 'chinamobile']],
-        20 => [['goods_id' => 7085, 'price' => 19.9, 'quality' => 2, 'card_type' => 'chinamobile']],
-        30 => [['goods_id' => 7086, 'price' => 29.85, 'quality' => 2, 'card_type' => 'chinamobile']],
-        50 => [['goods_id' => 7087, 'price' => 49.75, 'quality' => 2, 'card_type' => 'chinamobile']],
-        100 => [['goods_id' => 7088, 'price' => 99.5, 'quality' => 2, 'card_type' => 'chinamobile']],
-        200 => [['goods_id' => 7089, 'price' => 199, 'quality' => 2, 'card_type' => 'chinamobile']],
-        300 => [['goods_id' => 7090, 'price' => 298.5, 'quality' => 2, 'card_type' => 'chinamobile']],
-        500 => [['goods_id' => 7091, 'price' => 497.5, 'quality' => 2, 'card_type' => 'chinamobile']]
+        10 => [['goods_id' => 7084, 'price' => 9.93, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        20 => [['goods_id' => 7085, 'price' => 19.86, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        30 => [['goods_id' => 7086, 'price' => 29.79, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        50 => [['goods_id' => 7087, 'price' => 49.65, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        100 => [['goods_id' => 7088, 'price' => 99.3, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        200 => [['goods_id' => 7089, 'price' => 198.6, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        300 => [['goods_id' => 7090, 'price' => 297.9, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        500 => [['goods_id' => 7091, 'price' => 496.5, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']]
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 
@@ -2544,35 +2564,35 @@ $hangtong_phone = ['name' => 'hangtong', 'store_id' => 126,'qualitys' => '1',
 $dashang_phone = ['name' => 'dashang', 'store_id' => 127, 'qualitys' => '2',
     'amount' => [
         10 => [
-            ['goods_id' => 7108, 'price' => 9.98, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7108, 'price' => 9.99, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7108, 'price' => 9.98, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         20 => [
-            ['goods_id' => 7109, 'price' => 19.96, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7109, 'price' => 19.98, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7109, 'price' => 19.96, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         30 => [
-            ['goods_id' => 7110, 'price' => 29.94, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7110, 'price' => 29.97, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7110, 'price' => 29.94, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         50 => [
-            ['goods_id' => 7111, 'price' => 49.9, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7111, 'price' => 49.875, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7111, 'price' => 49.9, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         100 => [
-            ['goods_id' => 7112, 'price' => 99.8, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7112, 'price' => 99.75, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7112, 'price' => 99.8, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         200 => [
-            ['goods_id' => 7113, 'price' => 199.6, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7113, 'price' => 199.5, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7113, 'price' => 199.6, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         300 => [
-            ['goods_id' => 7114, 'price' => 299.4, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7114, 'price' => 299.25, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7114, 'price' => 299.4, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         500 => [
-            ['goods_id' => 7115, 'price' => 499, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7115, 'price' => 498.75, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7115, 'price' => 499, 'quality' => 2, 'card_type' => 'chinatelecom']
         ]
     ],
@@ -2688,7 +2708,7 @@ $chizeng_phone = ['name' => 'chizeng', 'store_id' => 133, 'qualitys' => '1',
         30 => [
 //            ['goods_id' => 7149, 'price' => 28.8, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 7149, 'price' => 28.35, 'quality' => 1, 'card_type' => 'chinaunicom'],
-//            ['goods_id' => 7149, 'price' => 28.5, 'quality' => 1, 'card_type' => 'chinatelecom']
+            ['goods_id' => 7149, 'price' => 28.5, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         50 => [
             ['goods_id' => 7150, 'price' => 47.45, 'quality' => 1, 'card_type' => 'chinamobile'],
@@ -2705,11 +2725,11 @@ $chizeng_phone = ['name' => 'chizeng', 'store_id' => 133, 'qualitys' => '1',
             ['goods_id' => 7152, 'price' => 189, 'quality' => 1, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7152, 'price' => 190, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
-        300 => [
+//        300 => [
 //            ['goods_id' => 7153, 'price' => 285.3, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 7153, 'price' => 283.5, 'quality' => 1, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 7153, 'price' => 283.5, 'quality' => 1, 'card_type' => 'chinaunicom'],
 //            ['goods_id' => 7153, 'price' => 284.7, 'quality' => 1, 'card_type' => 'chinatelecom']
-        ],
+//        ],
 //        500 => [
 //            ['goods_id' => 7154, 'price' => 475.5, 'quality' => 1, 'card_type' => 'chinamobile'],
 //            ['goods_id' => 7154, 'price' => 472.5, 'quality' => 1, 'card_type' => 'chinaunicom'],
@@ -2780,10 +2800,22 @@ $xingzy_normal_phone = ['name' => 'xingzy_normal', 'store_id' => 137, 'qualitys'
     'amount' => [
 //        10 => [['goods_id' => 7179, 'price' => 9.55, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']],
 //        20 => [['goods_id' => 7180, 'price' => 19.1, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']],
-        30 => [['goods_id' => 7181, 'price' => 28.65, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']],
-        50 => [['goods_id' => 7182, 'price' => 47.75, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']],
-        100 => [['goods_id' => 7183, 'price' => 95.5, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']],
-        200 => [['goods_id' => 7184, 'price' => 191, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']],
+        30 => [
+            ['goods_id' => 7181, 'price' => 28.65, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7181, 'price' => 28.74, 'quality' => 1, 'card_type' => 'chinatelecom']
+        ],
+        50 => [
+            ['goods_id' => 7182, 'price' => 47.75, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7182, 'price' => 47.9, 'quality' => 1, 'card_type' => 'chinatelecom']
+        ],
+        100 => [
+            ['goods_id' => 7183, 'price' => 95.5, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7183, 'price' => 95.8, 'quality' => 1, 'card_type' => 'chinatelecom']
+        ],
+        200 => [
+            ['goods_id' => 7184, 'price' => 191, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7184, 'price' => 191.6, 'quality' => 1, 'card_type' => 'chinatelecom']
+        ],
 //        300 => [['goods_id' => 7185, 'price' => 286.5, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']],
 //        500 => [['goods_id' => 7186, 'price' => 477.5, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']]
     ],
@@ -2828,6 +2860,87 @@ $dinghui_phone = ['name' => 'dinghui', 'store_id' => 140, 'qualitys' => '5',
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 
+$xiaoniu_hf_phone = ['name' => 'xiaoniu_hf', 'store_id' => 141, 'qualitys' => '3',
+    'amount' => [
+        10 => [['goods_id' => 7211, 'price' => 9.7,  'quality' => 3, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        20 => [['goods_id' => 7212, 'price' => 19.4, 'quality' => 3, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        30 => [['goods_id' => 7213, 'price' => 29.1, 'quality' => 3, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        50 => [['goods_id' => 7214, 'price' => 48.5, 'quality' => 3, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        100 => [['goods_id' => 7215, 'price' => 97, 'quality' => 3, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        200 => [['goods_id' => 7216, 'price' => 194, 'quality' => 3, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        300 => [['goods_id' => 7217, 'price' => 291, 'quality' => 3, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        500 => [['goods_id' => 7218, 'price' => 485, 'quality' => 3, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']]
+    ],
+    'official_sn' => true, 'refill_type' => 'api'];
+
+$shuoruan_phone = ['name' => 'shuoruan', 'store_id' => 142, 'qualitys' => '2',
+    'amount' => [
+//        10 => [['goods_id' => 7219, 'price' => 9.97, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+//        20 => [['goods_id' => 7220, 'price' => 19.94, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+//        30 => [['goods_id' => 7221, 'price' => 29.91, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        50 => [['goods_id' => 7222, 'price' => 49.85, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        100 => [['goods_id' => 7223, 'price' => 99.7, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        200 => [['goods_id' => 7224, 'price' => 199.4, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+//        300 => [['goods_id' => 7225, 'price' => 299.1, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+//        500 => [['goods_id' => 7226, 'price' => 498.5, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']]
+    ],
+    'official_sn' => true, 'refill_type' => 'api'];
+
+$linzhu_phone = ['name' => 'linzhu', 'store_id' => 144,'qualitys' => '1',
+    'amount' => [
+        10 => [['goods_id' => 7235, 'price' => 9.51,  'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        20 => [['goods_id' => 7236, 'price' => 19.02, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        30 => [['goods_id' => 7237, 'price' => 28.53, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        50 => [['goods_id' => 7238, 'price' => 47.55, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        100 => [['goods_id' => 7239, 'price' => 95.1, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        200 => [['goods_id' => 7240, 'price' => 190.20, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        300 => [['goods_id' => 7241, 'price' => 285.30, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        500 => [['goods_id' => 7242, 'price' => 475.50, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']]
+    ],
+    'official_sn' => true, 'refill_type' => 'api'];
+
+$fangxing_phone = ['name' => 'fangxing', 'store_id' => 145, 'qualitys' => '2',
+    'amount' => [
+        10 => [['goods_id' => 7243, 'price' => 9.68, 'quality' => 2, 'card_type' => 'chinamobile']],
+        20 => [['goods_id' => 7244, 'price' => 19.36, 'quality' => 2, 'card_type' => 'chinamobile']],
+        30 => [['goods_id' => 7245, 'price' => 29.04, 'quality' => 2, 'card_type' => 'chinamobile']],
+        50 => [['goods_id' => 7246, 'price' => 48.4, 'quality' => 2, 'card_type' => 'chinamobile']],
+        100 => [['goods_id' => 7247, 'price' => 96.8, 'quality' => 2, 'card_type' => 'chinamobile']],
+        200 => [['goods_id' => 7248, 'price' => 193.6, 'quality' => 2, 'card_type' => 'chinamobile']],
+        300 => [['goods_id' => 7249, 'price' => 290.4, 'quality' => 2, 'card_type' => 'chinamobile']],
+        500 => [['goods_id' => 7250, 'price' => 484, 'quality' => 2, 'card_type' => 'chinamobile']]
+    ],
+    'official_sn' => true, 'refill_type' => 'api'];
+
+$huafutongman_phone = ['name' => 'huafutongman', 'store_id' => 146,'qualitys' => '5',
+    'amount' => [
+//        10 => [
+//            ['goods_id' => 7251, 'price' => 9.13, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom'],
+//        ],
+//        20 => [
+//            ['goods_id' => 7252, 'price' => 18.26, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom'],
+//        ],
+//        30 => [
+//            ['goods_id' => 7253, 'price' => 27.39, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom'],
+//        ],
+        50 => [
+            ['goods_id' => 7254, 'price' => 45.65, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom'],
+        ],
+        100 => [
+            ['goods_id' => 7255, 'price' => 91.3, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom'],
+        ],
+        200 => [
+            ['goods_id' => 7256, 'price' => 182.6, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom'],
+        ],
+//        300 => [
+//            ['goods_id' => 7257, 'price' => 273.9, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom'],
+//        ],
+//        500 => [
+//            ['goods_id' => 7258, 'price' => 456.5, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom'],
+//        ]
+    ],
+    'refill_type' => 'api'];
+
 $phone_providers = [
 //    ['name' => 'beixt', 'cfg' => $beixt_phone],
 //    ['name' => 'bxtwt', 'cfg' => $bxtwt_phone],
@@ -2934,7 +3047,11 @@ $phone_providers = [
     ['name' => 'xingzy_normal', 'cfg' => $xingzy_normal_phone],
     ['name' => 'pushang', 'cfg' => $pushang_phone],
     ['name' => 'huafutong', 'cfg' => $huafutong_phone],
-    ['name' => 'dinghui', 'cfg' => $dinghui_phone]
+    ['name' => 'dinghui', 'cfg' => $dinghui_phone],
+    ['name' => 'xiaoniu_hf', 'cfg' => $xiaoniu_hf_phone],
+    ['name' => 'shuoruan', 'cfg' => $shuoruan_phone],
+    ['name' => 'linzhu', 'cfg' => $linzhu_phone],
+    ['name' => 'huafutongman', 'cfg' => $huafutongman_phone]
 ];
 $config['phone_providers'] = $phone_providers;
 
@@ -2981,7 +3098,7 @@ $config['merchant_retry_times'] = [
         'qualities' => [1 => ['secs' => 1200, 'times' => 100], 2 => ['secs' => 100, 'times' => 5]],
         'lower_ratio' => ['ratio' => 0.9, 'period' => 3600], 'profit_ratio' => 0.003],
     10216 => [ //飘逸-10分
-        'qualities' => [1 => ['secs' => 630, 'times' => 100], 2 => ['secs' => 70, 'times' => 5]],
+        'qualities' => [1 => ['secs' => 530, 'times' => 100], 2 => ['secs' => 70, 'times' => 5]],
         'lower_ratio' => ['ratio' => 0.4, 'period' => 3600], 'profit_ratio' => 0.015],
     10217 => [ //天采-混充50m
         'qualities' => [1 => ['secs' => 2400, 'times' => 200], 2 => ['secs' => 600, 'times' => 20]],
@@ -2989,7 +3106,13 @@ $config['merchant_retry_times'] = [
 
     10231 => [ //汇通-普充2号
         'qualities' => [1 => ['secs' => 1000, 'times' => 200], 2 => ['secs' => 200, 'times' => 20]],
-        'lower_ratio' => ['ratio' => 0.6, 'period' => 3600], 'profit_ratio' => 0.003]
+        'lower_ratio' => ['ratio' => 0.6, 'period' => 3600], 'profit_ratio' => 0.003],
+    10233 => [ //瑾相联-10分
+        'qualities' => [1 => ['secs' => 630, 'times' => 100], 2 => ['secs' => 70, 'times' => 5]],
+        'lower_ratio' => ['ratio' => 0.4, 'period' => 3600], 'profit_ratio' => 0.015],
+    10236 => [ //邀友補充-05號通道
+        'qualities' => [1 => ['secs' => 3300, 'times' => 1000], 2 => ['secs' => 300, 'times' => 5]],
+        'lower_ratio' => ['ratio' => 0.99, 'period' => 3600], 'profit_ratio' => 0.015],
 ];
 
 //// "status": 1 //状态 0:空号;1:实号;2:停机;3:库无;4:沉默号;5:风险号

+ 233 - 110
data/config/xyzadm/refill.ini.php

@@ -629,36 +629,36 @@ $zhongst_phone = ['name' => 'zhongst', 'store_id' => 39, 'qualitys' => '2',
         ],
 
         30 => [
-            ['goods_id' => 6466, 'price' => 30.06, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6466, 'price' => 30.06, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 6466, 'price' => 30.12, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6466, 'price' => 29.91, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6466, 'price' => 30.09, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
 
         50 => [
-            ['goods_id' => 6467, 'price' => 50.1, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6467, 'price' => 50.1, 'quality' => 2, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 6467, 'price' => 50.05, 'quality' => 2, 'card_type' => 'chinatelecom']
+            ['goods_id' => 6467, 'price' => 50.15, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6467, 'price' => 49.85, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 6467, 'price' => 49.9, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
 
         100 => [
-            ['goods_id' => 6468, 'price' => 100.2, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6468, 'price' => 100.2, 'quality' => 2, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 6468, 'price' => 100.1, 'quality' => 2, 'card_type' => 'chinatelecom']
+            ['goods_id' => 6468, 'price' => 100.3, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6468, 'price' => 99.7, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 6468, 'price' => 99.8, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         200 => [
-            ['goods_id' => 6469, 'price' => 200.4, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6469, 'price' => 200.4, 'quality' => 2, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 6469, 'price' => 200.2, 'quality' => 2, 'card_type' => 'chinatelecom']
+            ['goods_id' => 6469, 'price' => 200.6, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6469, 'price' => 199.4, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 6469, 'price' => 199.6, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         300 => [
-            ['goods_id' => 6470, 'price' => 300.6, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6470, 'price' => 300.6, 'quality' => 2, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 6470, 'price' => 300.3, 'quality' => 2, 'card_type' => 'chinatelecom']
+            ['goods_id' => 6470, 'price' => 300.9, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6470, 'price' => 299.1, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 6470, 'price' => 299.4, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         500 => [
             ['goods_id' => 6471, 'price' => 501, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6471, 'price' => 501, 'quality' => 2, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 6471, 'price' => 500.5, 'quality' => 2, 'card_type' => 'chinatelecom']
+            ['goods_id' => 6471, 'price' => 498.5, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 6471, 'price' => 499, 'quality' => 2, 'card_type' => 'chinatelecom']
         ]
     ],
     'official_sn' => true, 'refill_type' => 'api'];
@@ -1195,28 +1195,28 @@ $moxj_phone = ['name' => 'moxj', 'store_id' => 64, 'qualitys' => '1',
 $moxj_fs_phone = ['name' => 'moxj_fs', 'store_id' => 65, 'qualitys' => '1',
     'amount' => [
         10 => [
-            ['goods_id' => 6644, 'price' => 9.48, 'quality' => 1, 'card_type' => 'chinamobile']
+            ['goods_id' => 6644, 'price' => 9.4, 'quality' => 1, 'card_type' => 'chinamobile']
         ],
         20 => [
-            ['goods_id' => 6645, 'price' => 18.96, 'quality' => 1, 'card_type' => 'chinamobile']
+            ['goods_id' => 6645, 'price' => 18.8, 'quality' => 1, 'card_type' => 'chinamobile']
         ],
         30 => [
-            ['goods_id' => 6646, 'price' => 28.44, 'quality' => 1, 'card_type' => 'chinamobile']
+            ['goods_id' => 6646, 'price' => 28.2, 'quality' => 1, 'card_type' => 'chinamobile']
         ],
         50 => [
-            ['goods_id' => 6647, 'price' => 47.4, 'quality' => 1, 'card_type' => 'chinamobile']
+            ['goods_id' => 6647, 'price' => 47, 'quality' => 1, 'card_type' => 'chinamobile']
         ],
         100 => [
-            ['goods_id' => 6648, 'price' => 94.8, 'quality' => 1, 'card_type' => 'chinamobile']
+            ['goods_id' => 6648, 'price' => 94, 'quality' => 1, 'card_type' => 'chinamobile']
         ],
         200 => [
-            ['goods_id' => 6649, 'price' => 189.6, 'quality' => 1, 'card_type' => 'chinamobile']
+            ['goods_id' => 6649, 'price' => 188, 'quality' => 1, 'card_type' => 'chinamobile']
         ],
         300 => [
-            ['goods_id' => 6650, 'price' => 284.4, 'quality' => 1, 'card_type' => 'chinamobile']
+            ['goods_id' => 6650, 'price' => 282, 'quality' => 1, 'card_type' => 'chinamobile']
         ],
         500 => [
-            ['goods_id' => 6651, 'price' => 474, 'quality' => 1, 'card_type' => 'chinamobile']
+            ['goods_id' => 6651, 'price' => 470, 'quality' => 1, 'card_type' => 'chinamobile']
         ],
     ],
     'official_sn' => true, 'refill_type' => 'api'];
@@ -1471,42 +1471,42 @@ $lingzhman48_phone = ['name' => 'lingzhman48', 'store_id' => 76, 'qualitys' => '
 $cangbu_phone = ['name' => 'cangbu', 'store_id' => 78,'qualitys' => '1',
     'amount' => [
         10 => [
-            ['goods_id' => 6744, 'price' => 9.54, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6744, 'price' => 9.57, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6744, 'price' => 9.45, 'quality' => 1, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6744, 'price' => 9.5, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         20 => [
-            ['goods_id' => 6745, 'price' => 19.08, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6745, 'price' => 19.14, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6745, 'price' => 18.9, 'quality' => 1, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6745, 'price' => 19, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         30 => [
-            ['goods_id' => 6746, 'price' => 28.62, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6746, 'price' => 28.71, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6746, 'price' => 28.35, 'quality' => 1, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6746, 'price' => 28.5, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         50 => [
-            ['goods_id' => 6747, 'price' => 48, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6747, 'price' => 47.85, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6747, 'price' => 47.25, 'quality' => 1, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6747, 'price' => 47.5, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         100 => [
-            ['goods_id' => 6748, 'price' => 96, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6748, 'price' => 95.7, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6748, 'price' => 94.5, 'quality' => 1, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6748, 'price' => 95, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         200 => [
-            ['goods_id' => 6749, 'price' => 192, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6749, 'price' => 191.4, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6749, 'price' => 189, 'quality' => 1, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6749, 'price' => 190, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         300 => [
-            ['goods_id' => 6750, 'price' => 288, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6750, 'price' => 287.1, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6750, 'price' => 283.5, 'quality' => 1, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6750, 'price' => 285, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         500 => [
-            ['goods_id' => 6751, 'price' => 480, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6751, 'price' => 478.5, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6751, 'price' => 472.5, 'quality' => 1, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6751, 'price' => 475, 'quality' => 1, 'card_type' => 'chinatelecom']
         ]
@@ -1596,14 +1596,14 @@ $hongxudagy_phone = ['name' => 'hongxudagy', 'store_id' => 86, 'qualitys' => '2'
 
 $yunchonggong_phone = ['name' => 'yunchonggong', 'store_id' => 87,'qualitys' => '1',
     'amount' => [
-        10 => [
-            ['goods_id' => 6797, 'price' => 9.5, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6797, 'price' => 9.47, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
-        ],
-        20 => [
-            ['goods_id' => 6798, 'price' => 19, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6798, 'price' => 18.94, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
-        ],
+//        10 => [
+//            ['goods_id' => 6797, 'price' => 9.5, 'quality' => 1, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 6797, 'price' => 9.47, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
+//        ],
+//        20 => [
+//            ['goods_id' => 6798, 'price' => 19, 'quality' => 1, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 6798, 'price' => 18.94, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
+//        ],
         30 => [
             ['goods_id' => 6799, 'price' => 28.5, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6799, 'price' => 28.41, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
@@ -1621,13 +1621,13 @@ $yunchonggong_phone = ['name' => 'yunchonggong', 'store_id' => 87,'qualitys' =>
             ['goods_id' => 6802, 'price' => 189.4, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
         ],
         300 => [
-            ['goods_id' => 6803, 'price' => 285, 'quality' => 1, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 6803, 'price' => 285, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6803, 'price' => 284.1, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
         ],
-        500 => [
-            ['goods_id' => 6804, 'price' => 475, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6804, 'price' => 473.5, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
-        ]
+//        500 => [
+//            ['goods_id' => 6804, 'price' => 475, 'quality' => 1, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 6804, 'price' => 473.5, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
+//        ]
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 
@@ -1850,14 +1850,34 @@ $lechong_phone = ['name' => 'lechong', 'store_id' => 99, 'qualitys' => '1',
 
 $xinhengyang_phone = ['name' => 'xinhengyang', 'store_id' => 100, 'qualitys' => '1',
     'amount' => [
-        10 => [['goods_id' => 6893, 'price' => 9.56, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        20 => [['goods_id' => 6894, 'price' => 19.12, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        30 => [['goods_id' => 6895, 'price' => 28.68, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        50 => [['goods_id' => 6896, 'price' => 47.8, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        100 => [['goods_id' => 6897, 'price' => 95.6, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        200 => [['goods_id' => 6898, 'price' => 191.2, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        300 => [['goods_id' => 6899, 'price' => 286.8, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        500 => [['goods_id' => 6900, 'price' => 478, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']]
+//        10 => [['goods_id' => 6893, 'price' => 9.56, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+//        20 => [['goods_id' => 6894, 'price' => 19.12, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        30 => [
+            ['goods_id' => 6895, 'price' => 28.62, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6895, 'price' => 28.59, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 6895, 'price' => 28.62, 'quality' => 1, 'card_type' => 'chinatelecom']
+        ],
+        50 => [
+            ['goods_id' => 6896, 'price' => 47.7, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6896, 'price' => 47.65, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 6896, 'price' => 47.7, 'quality' => 1, 'card_type' => 'chinatelecom']
+        ],
+        100 => [
+            ['goods_id' => 6897, 'price' => 95.4, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6897, 'price' => 95.3, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 6897, 'price' => 95.4, 'quality' => 1, 'card_type' => 'chinatelecom']
+        ],
+        200 => [
+            ['goods_id' => 6898, 'price' => 190.8, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6898, 'price' => 190.6, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 6898, 'price' => 190.8, 'quality' => 1, 'card_type' => 'chinatelecom']
+        ],
+        300 => [
+            ['goods_id' => 6899, 'price' => 286.2, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6899, 'price' => 285.9, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 6899, 'price' => 286.2, 'quality' => 1, 'card_type' => 'chinatelecom']
+        ],
+//        500 => [['goods_id' => 6900, 'price' => 478, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']]
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 
@@ -1880,27 +1900,27 @@ $miaoxt_phone = ['name' => 'miaoxt', 'store_id' => 101, 'qualitys' => '2',
         ],
         50 => [
             ['goods_id' => 6904, 'price' => 50.1, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6904, 'price' => 50, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 6904, 'price' => 50.2, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6904, 'price' => 50.1, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         100 => [
             ['goods_id' => 6905, 'price' => 100.2, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6905, 'price' => 100, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 6905, 'price' => 100.1, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6905, 'price' => 100.2, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         200 => [
             ['goods_id' => 6906, 'price' => 200.4, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6906, 'price' => 200, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 6906, 'price' => 200.2, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6906, 'price' => 200.4, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         300 => [
             ['goods_id' => 6907, 'price' => 300.6, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6907, 'price' => 300, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 6907, 'price' => 300.3, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6907, 'price' => 300.6, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         500 => [
             ['goods_id' => 6908, 'price' => 501, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6908, 'price' => 500, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 6908, 'price' => 500.5, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6908, 'price' => 501, 'quality' => 2, 'card_type' => 'chinatelecom']
         ]
     ],
@@ -1921,14 +1941,14 @@ $tianyan_phone = ['name' => 'tianyan', 'store_id' => 102, 'qualitys' => '1',
 
 $yunsuoyaoman_phone = ['name' => 'yunsuoyaoman', 'store_id' => 110,'qualitys' => '5',
     'amount' => [
-        10 => [['goods_id' => 6970, 'price' => 9.16, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        20 => [['goods_id' => 6971, 'price' => 18.32, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        30 => [['goods_id' => 6972, 'price' => 27.48, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        50 => [['goods_id' => 6973, 'price' => 45.8, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        100 => [['goods_id' => 6974, 'price' => 91.6, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        200 => [['goods_id' => 6975, 'price' => 183.2, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        300 => [['goods_id' => 6976, 'price' => 274.8, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        500 => [['goods_id' => 6977, 'price' => 458, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']]
+        10 => [['goods_id' => 6970, 'price' => 9.22, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        20 => [['goods_id' => 6971, 'price' => 18.44, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        30 => [['goods_id' => 6972, 'price' => 27.66, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        50 => [['goods_id' => 6973, 'price' => 46.1, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        100 => [['goods_id' => 6974, 'price' => 92.2, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        200 => [['goods_id' => 6975, 'price' => 184.4, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        300 => [['goods_id' => 6976, 'price' => 276.5, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        500 => [['goods_id' => 6977, 'price' => 461, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']]
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 
@@ -2189,22 +2209,22 @@ $yilin_phone = ['name' => 'yilin', 'store_id' => 115, 'qualitys' => '1',
         30 => [
             ['goods_id' => 7005, 'price' => 28.68, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 7005, 'price' => 28.62, 'quality' => 1, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 7005, 'price' => 28.89, 'quality' => 1, 'card_type' => 'chinatelecom']
+            ['goods_id' => 7005, 'price' => 28.83, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         50 => [
             ['goods_id' => 7006, 'price' => 47.8, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 7006, 'price' => 47.7, 'quality' => 1, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 7006, 'price' => 48.15, 'quality' => 1, 'card_type' => 'chinatelecom']
+            ['goods_id' => 7006, 'price' => 48.05, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         100 => [
             ['goods_id' => 7007, 'price' => 95.6, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 7007, 'price' => 95.4, 'quality' => 1, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 7007, 'price' => 96.3, 'quality' => 1, 'card_type' => 'chinatelecom']
+            ['goods_id' => 7007, 'price' => 96.1, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         200 => [
             ['goods_id' => 7008, 'price' => 191.2, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 7008, 'price' => 190.8, 'quality' => 1, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 7008, 'price' => 192.6, 'quality' => 1, 'card_type' => 'chinatelecom']
+            ['goods_id' => 7008, 'price' => 192.2, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         300 => [
             ['goods_id' => 7009, 'price' => 286.8, 'quality' => 1, 'card_type' => 'chinamobile'],
@@ -2377,47 +2397,47 @@ $guochuang_nation_phone = ['name' => 'guochuang_nation', 'store_id' => 121, 'qua
         5  => [
             ['goods_id' => 7055, 'price' => 5.205, 'quality' => 2, 'card_type' => 'chinamobile'],
             ['goods_id' => 7055, 'price' => 5.155, 'quality' => 2, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 7055, 'price' => 5.26, 'quality' => 2, 'card_type' => 'chinatelecom']
+            ['goods_id' => 7055, 'price' => 5.205, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         6  => [
             ['goods_id' => 7056, 'price' => 6.2064, 'quality' => 2, 'card_type' => 'chinamobile'],
             ['goods_id' => 7056, 'price' => 6.186, 'quality' => 2, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 7056, 'price' => 6.312, 'quality' => 2, 'card_type' => 'chinatelecom']
+            ['goods_id' => 7056, 'price' => 6.246, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         7  => [
             ['goods_id' => 7057, 'price' => 7.2072, 'quality' => 2, 'card_type' => 'chinamobile'],
             ['goods_id' => 7057, 'price' => 7.217, 'quality' => 2, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 7057, 'price' => 7.364, 'quality' => 2, 'card_type' => 'chinatelecom']
+            ['goods_id' => 7057, 'price' => 7.287, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         8  => [
             ['goods_id' => 7058, 'price' => 8.208, 'quality' => 2, 'card_type' => 'chinamobile'],
             ['goods_id' => 7058, 'price' => 8.248, 'quality' => 2, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 7058, 'price' => 8.416, 'quality' => 2, 'card_type' => 'chinatelecom']
+            ['goods_id' => 7058, 'price' => 8.328, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         9  => [
             ['goods_id' => 7059, 'price' => 9.2088, 'quality' => 2, 'card_type' => 'chinamobile'],
             ['goods_id' => 7059, 'price' => 9.279, 'quality' => 2, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 7059, 'price' => 9.468, 'quality' => 2, 'card_type' => 'chinatelecom']
+            ['goods_id' => 7059, 'price' => 9.369, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
 
         10 => [
-            ['goods_id' => 7060, 'price' => 10.21, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 7060, 'price' => 10.24, 'quality' => 2, 'card_type' => 'chinamobile'],
             ['goods_id' => 7060, 'price' => 10.07, 'quality' => 2, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 7060, 'price' => 10.21, 'quality' => 2, 'card_type' => 'chinatelecom']
+            ['goods_id' => 7060, 'price' => 10.26, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         20 => [
-            ['goods_id' => 7061, 'price' => 20.22, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 7061, 'price' => 20.09, 'quality' => 2, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 7061, 'price' => 20.22, 'quality' => 2, 'card_type' => 'chinatelecom']
+            ['goods_id' => 7061, 'price' => 20.48, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 7061, 'price' => 20.52, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7061, 'price' => 20.62, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         30 => [
-            ['goods_id' => 7062, 'price' => 30.12, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 7062, 'price' => 30.135, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7062, 'price' => 30.21, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 7062, 'price' => 30.381, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7062, 'price' => 30.39, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         50 => [
             ['goods_id' => 7063, 'price' => 50.2, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 7063, 'price' => 50.225, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7063, 'price' => 50.4, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7063, 'price' => 50.4, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         100 => [
@@ -2480,14 +2500,14 @@ $shimier_phone = ['name' => 'shimier', 'store_id' => 123,'qualitys' => '1',
 
 $zhongst_mix_phone = ['name' => 'zhongst_mix', 'store_id' => 124, 'qualitys' => '2',
     'amount' => [
-        10 => [['goods_id' => 7084, 'price' => 9.95, 'quality' => 2, 'card_type' => 'chinamobile']],
-        20 => [['goods_id' => 7085, 'price' => 19.9, 'quality' => 2, 'card_type' => 'chinamobile']],
-        30 => [['goods_id' => 7086, 'price' => 29.85, 'quality' => 2, 'card_type' => 'chinamobile']],
-        50 => [['goods_id' => 7087, 'price' => 49.75, 'quality' => 2, 'card_type' => 'chinamobile']],
-        100 => [['goods_id' => 7088, 'price' => 99.5, 'quality' => 2, 'card_type' => 'chinamobile']],
-        200 => [['goods_id' => 7089, 'price' => 199, 'quality' => 2, 'card_type' => 'chinamobile']],
-        300 => [['goods_id' => 7090, 'price' => 298.5, 'quality' => 2, 'card_type' => 'chinamobile']],
-        500 => [['goods_id' => 7091, 'price' => 497.5, 'quality' => 2, 'card_type' => 'chinamobile']]
+        10 => [['goods_id' => 7084, 'price' => 9.93, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        20 => [['goods_id' => 7085, 'price' => 19.86, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        30 => [['goods_id' => 7086, 'price' => 29.79, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        50 => [['goods_id' => 7087, 'price' => 49.65, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        100 => [['goods_id' => 7088, 'price' => 99.3, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        200 => [['goods_id' => 7089, 'price' => 198.6, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        300 => [['goods_id' => 7090, 'price' => 297.9, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        500 => [['goods_id' => 7091, 'price' => 496.5, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']]
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 
@@ -2544,35 +2564,35 @@ $hangtong_phone = ['name' => 'hangtong', 'store_id' => 126,'qualitys' => '1',
 $dashang_phone = ['name' => 'dashang', 'store_id' => 127, 'qualitys' => '2',
     'amount' => [
         10 => [
-            ['goods_id' => 7108, 'price' => 9.98, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7108, 'price' => 9.99, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7108, 'price' => 9.98, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         20 => [
-            ['goods_id' => 7109, 'price' => 19.96, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7109, 'price' => 19.98, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7109, 'price' => 19.96, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         30 => [
-            ['goods_id' => 7110, 'price' => 29.94, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7110, 'price' => 29.97, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7110, 'price' => 29.94, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         50 => [
-            ['goods_id' => 7111, 'price' => 49.9, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7111, 'price' => 49.875, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7111, 'price' => 49.9, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         100 => [
-            ['goods_id' => 7112, 'price' => 99.8, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7112, 'price' => 99.75, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7112, 'price' => 99.8, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         200 => [
-            ['goods_id' => 7113, 'price' => 199.6, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7113, 'price' => 199.5, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7113, 'price' => 199.6, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         300 => [
-            ['goods_id' => 7114, 'price' => 299.4, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7114, 'price' => 299.25, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7114, 'price' => 299.4, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         500 => [
-            ['goods_id' => 7115, 'price' => 499, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7115, 'price' => 498.75, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7115, 'price' => 499, 'quality' => 2, 'card_type' => 'chinatelecom']
         ]
     ],
@@ -2688,7 +2708,7 @@ $chizeng_phone = ['name' => 'chizeng', 'store_id' => 133, 'qualitys' => '1',
         30 => [
 //            ['goods_id' => 7149, 'price' => 28.8, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 7149, 'price' => 28.35, 'quality' => 1, 'card_type' => 'chinaunicom'],
-//            ['goods_id' => 7149, 'price' => 28.5, 'quality' => 1, 'card_type' => 'chinatelecom']
+            ['goods_id' => 7149, 'price' => 28.5, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         50 => [
             ['goods_id' => 7150, 'price' => 47.45, 'quality' => 1, 'card_type' => 'chinamobile'],
@@ -2705,11 +2725,11 @@ $chizeng_phone = ['name' => 'chizeng', 'store_id' => 133, 'qualitys' => '1',
             ['goods_id' => 7152, 'price' => 189, 'quality' => 1, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7152, 'price' => 190, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
-        300 => [
+//        300 => [
 //            ['goods_id' => 7153, 'price' => 285.3, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 7153, 'price' => 283.5, 'quality' => 1, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 7153, 'price' => 283.5, 'quality' => 1, 'card_type' => 'chinaunicom'],
 //            ['goods_id' => 7153, 'price' => 284.7, 'quality' => 1, 'card_type' => 'chinatelecom']
-        ],
+//        ],
 //        500 => [
 //            ['goods_id' => 7154, 'price' => 475.5, 'quality' => 1, 'card_type' => 'chinamobile'],
 //            ['goods_id' => 7154, 'price' => 472.5, 'quality' => 1, 'card_type' => 'chinaunicom'],
@@ -2780,10 +2800,22 @@ $xingzy_normal_phone = ['name' => 'xingzy_normal', 'store_id' => 137, 'qualitys'
     'amount' => [
 //        10 => [['goods_id' => 7179, 'price' => 9.55, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']],
 //        20 => [['goods_id' => 7180, 'price' => 19.1, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']],
-        30 => [['goods_id' => 7181, 'price' => 28.65, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']],
-        50 => [['goods_id' => 7182, 'price' => 47.75, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']],
-        100 => [['goods_id' => 7183, 'price' => 95.5, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']],
-        200 => [['goods_id' => 7184, 'price' => 191, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']],
+        30 => [
+            ['goods_id' => 7181, 'price' => 28.65, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7181, 'price' => 28.74, 'quality' => 1, 'card_type' => 'chinatelecom']
+        ],
+        50 => [
+            ['goods_id' => 7182, 'price' => 47.75, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7182, 'price' => 47.9, 'quality' => 1, 'card_type' => 'chinatelecom']
+        ],
+        100 => [
+            ['goods_id' => 7183, 'price' => 95.5, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7183, 'price' => 95.8, 'quality' => 1, 'card_type' => 'chinatelecom']
+        ],
+        200 => [
+            ['goods_id' => 7184, 'price' => 191, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7184, 'price' => 191.6, 'quality' => 1, 'card_type' => 'chinatelecom']
+        ],
 //        300 => [['goods_id' => 7185, 'price' => 286.5, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']],
 //        500 => [['goods_id' => 7186, 'price' => 477.5, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']]
     ],
@@ -2828,6 +2860,87 @@ $dinghui_phone = ['name' => 'dinghui', 'store_id' => 140, 'qualitys' => '5',
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 
+$xiaoniu_hf_phone = ['name' => 'xiaoniu_hf', 'store_id' => 141, 'qualitys' => '3',
+    'amount' => [
+        10 => [['goods_id' => 7211, 'price' => 9.7,  'quality' => 3, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        20 => [['goods_id' => 7212, 'price' => 19.4, 'quality' => 3, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        30 => [['goods_id' => 7213, 'price' => 29.1, 'quality' => 3, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        50 => [['goods_id' => 7214, 'price' => 48.5, 'quality' => 3, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        100 => [['goods_id' => 7215, 'price' => 97, 'quality' => 3, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        200 => [['goods_id' => 7216, 'price' => 194, 'quality' => 3, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        300 => [['goods_id' => 7217, 'price' => 291, 'quality' => 3, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        500 => [['goods_id' => 7218, 'price' => 485, 'quality' => 3, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']]
+    ],
+    'official_sn' => true, 'refill_type' => 'api'];
+
+$shuoruan_phone = ['name' => 'shuoruan', 'store_id' => 142, 'qualitys' => '2',
+    'amount' => [
+//        10 => [['goods_id' => 7219, 'price' => 9.97, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+//        20 => [['goods_id' => 7220, 'price' => 19.94, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+//        30 => [['goods_id' => 7221, 'price' => 29.91, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        50 => [['goods_id' => 7222, 'price' => 49.85, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        100 => [['goods_id' => 7223, 'price' => 99.7, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        200 => [['goods_id' => 7224, 'price' => 199.4, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+//        300 => [['goods_id' => 7225, 'price' => 299.1, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+//        500 => [['goods_id' => 7226, 'price' => 498.5, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']]
+    ],
+    'official_sn' => true, 'refill_type' => 'api'];
+
+$linzhu_phone = ['name' => 'linzhu', 'store_id' => 144,'qualitys' => '1',
+    'amount' => [
+        10 => [['goods_id' => 7235, 'price' => 9.51,  'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        20 => [['goods_id' => 7236, 'price' => 19.02, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        30 => [['goods_id' => 7237, 'price' => 28.53, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        50 => [['goods_id' => 7238, 'price' => 47.55, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        100 => [['goods_id' => 7239, 'price' => 95.1, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        200 => [['goods_id' => 7240, 'price' => 190.20, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        300 => [['goods_id' => 7241, 'price' => 285.30, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        500 => [['goods_id' => 7242, 'price' => 475.50, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']]
+    ],
+    'official_sn' => true, 'refill_type' => 'api'];
+
+$fangxing_phone = ['name' => 'fangxing', 'store_id' => 145, 'qualitys' => '2',
+    'amount' => [
+        10 => [['goods_id' => 7243, 'price' => 9.68, 'quality' => 2, 'card_type' => 'chinamobile']],
+        20 => [['goods_id' => 7244, 'price' => 19.36, 'quality' => 2, 'card_type' => 'chinamobile']],
+        30 => [['goods_id' => 7245, 'price' => 29.04, 'quality' => 2, 'card_type' => 'chinamobile']],
+        50 => [['goods_id' => 7246, 'price' => 48.4, 'quality' => 2, 'card_type' => 'chinamobile']],
+        100 => [['goods_id' => 7247, 'price' => 96.8, 'quality' => 2, 'card_type' => 'chinamobile']],
+        200 => [['goods_id' => 7248, 'price' => 193.6, 'quality' => 2, 'card_type' => 'chinamobile']],
+        300 => [['goods_id' => 7249, 'price' => 290.4, 'quality' => 2, 'card_type' => 'chinamobile']],
+        500 => [['goods_id' => 7250, 'price' => 484, 'quality' => 2, 'card_type' => 'chinamobile']]
+    ],
+    'official_sn' => true, 'refill_type' => 'api'];
+
+$huafutongman_phone = ['name' => 'huafutongman', 'store_id' => 146,'qualitys' => '5',
+    'amount' => [
+//        10 => [
+//            ['goods_id' => 7251, 'price' => 9.13, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom'],
+//        ],
+//        20 => [
+//            ['goods_id' => 7252, 'price' => 18.26, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom'],
+//        ],
+//        30 => [
+//            ['goods_id' => 7253, 'price' => 27.39, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom'],
+//        ],
+        50 => [
+            ['goods_id' => 7254, 'price' => 45.65, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom'],
+        ],
+        100 => [
+            ['goods_id' => 7255, 'price' => 91.3, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom'],
+        ],
+        200 => [
+            ['goods_id' => 7256, 'price' => 182.6, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom'],
+        ],
+//        300 => [
+//            ['goods_id' => 7257, 'price' => 273.9, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom'],
+//        ],
+//        500 => [
+//            ['goods_id' => 7258, 'price' => 456.5, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom'],
+//        ]
+    ],
+    'refill_type' => 'api'];
+
 $phone_providers = [
 //    ['name' => 'beixt', 'cfg' => $beixt_phone],
 //    ['name' => 'bxtwt', 'cfg' => $bxtwt_phone],
@@ -2934,7 +3047,11 @@ $phone_providers = [
     ['name' => 'xingzy_normal', 'cfg' => $xingzy_normal_phone],
     ['name' => 'pushang', 'cfg' => $pushang_phone],
     ['name' => 'huafutong', 'cfg' => $huafutong_phone],
-    ['name' => 'dinghui', 'cfg' => $dinghui_phone]
+    ['name' => 'dinghui', 'cfg' => $dinghui_phone],
+    ['name' => 'xiaoniu_hf', 'cfg' => $xiaoniu_hf_phone],
+    ['name' => 'shuoruan', 'cfg' => $shuoruan_phone],
+    ['name' => 'linzhu', 'cfg' => $linzhu_phone],
+    ['name' => 'huafutongman', 'cfg' => $huafutongman_phone]
 ];
 $config['phone_providers'] = $phone_providers;
 
@@ -2981,7 +3098,7 @@ $config['merchant_retry_times'] = [
         'qualities' => [1 => ['secs' => 1200, 'times' => 100], 2 => ['secs' => 100, 'times' => 5]],
         'lower_ratio' => ['ratio' => 0.9, 'period' => 3600], 'profit_ratio' => 0.003],
     10216 => [ //飘逸-10分
-        'qualities' => [1 => ['secs' => 630, 'times' => 100], 2 => ['secs' => 70, 'times' => 5]],
+        'qualities' => [1 => ['secs' => 530, 'times' => 100], 2 => ['secs' => 70, 'times' => 5]],
         'lower_ratio' => ['ratio' => 0.4, 'period' => 3600], 'profit_ratio' => 0.015],
     10217 => [ //天采-混充50m
         'qualities' => [1 => ['secs' => 2400, 'times' => 200], 2 => ['secs' => 600, 'times' => 20]],
@@ -2989,7 +3106,13 @@ $config['merchant_retry_times'] = [
 
     10231 => [ //汇通-普充2号
         'qualities' => [1 => ['secs' => 1000, 'times' => 200], 2 => ['secs' => 200, 'times' => 20]],
-        'lower_ratio' => ['ratio' => 0.6, 'period' => 3600], 'profit_ratio' => 0.003]
+        'lower_ratio' => ['ratio' => 0.6, 'period' => 3600], 'profit_ratio' => 0.003],
+    10233 => [ //瑾相联-10分
+        'qualities' => [1 => ['secs' => 630, 'times' => 100], 2 => ['secs' => 70, 'times' => 5]],
+        'lower_ratio' => ['ratio' => 0.4, 'period' => 3600], 'profit_ratio' => 0.015],
+    10236 => [ //邀友補充-05號通道
+        'qualities' => [1 => ['secs' => 3300, 'times' => 1000], 2 => ['secs' => 300, 'times' => 5]],
+        'lower_ratio' => ['ratio' => 0.99, 'period' => 3600], 'profit_ratio' => 0.015],
 ];
 
 //// "status": 1 //状态 0:空号;1:实号;2:停机;3:库无;4:沉默号;5:风险号

+ 75 - 0
data/model/refill_task.model.php

@@ -0,0 +1,75 @@
+<?php
+
+defined('InShopNC') or exit('Access Invalid!');
+
+class refill_taskModel extends Model
+{
+    const DisposeState = 2;
+    const FinishState = 3;
+    const ErrState = 4;
+
+    public function __construct()
+    {
+        parent::__construct('refill_task');
+    }
+
+    public function getList($condition, $pagesize = '', $field = '*', $order = 'add_time desc', $limit = '', $master = false): array
+    {
+        $condition['is_del'] = 0;
+        $list = $this->field($field)->where($condition)->page($pagesize)->order($order)->limit($limit)->master($master)->select();
+        if (empty($list)) return [];
+        return $list;
+    }
+
+    public function HashCheck($hash): bool
+    {
+        $condition['is_del'] = 0;
+        $condition['task_hash'] = $hash;
+        return empty($this->where($condition)->find());
+    }
+
+    public function UnDispose($task_type): array
+    {
+        $condition['is_del'] = 0;
+        $condition['task_state'] = 1;
+        $condition['task_type'] = $task_type;
+        $task = $this->where($condition)->order('add_time asc')->find();
+        if (empty($task)) return [];
+        return $task;
+    }
+
+    public function Dispose($task_id)
+    {
+        $condition['is_del'] = 0;
+        $condition['task_id'] = $task_id;
+        return $this->where($condition)->update(
+            ['task_state' => self::DisposeState, 'dispose_time' => time()]
+        );
+    }
+
+    public function DisposeErr($task_id, $err_msg)
+    {
+        $condition['is_del'] = 0;
+        $condition['task_id'] = $task_id;
+        return $this->where($condition)->update(
+            ['task_state' => self::ErrState, 'task_result' => $err_msg, 'finish_time' => time()]
+        );
+    }
+
+    public function DisposeFinish($task_id, $result)
+    {
+        $condition['is_del'] = 0;
+        $condition['task_id'] = $task_id;
+        return $this->where($condition)->update(
+            ['task_state' => self::FinishState, 'task_result' => $result, 'finish_time' => time()]
+        );
+    }
+
+    public function Del($task_id)
+    {
+        $condition['task_id'] = $task_id;
+        return $this->where($condition)->update(
+            ['is_del' => 1]
+        );
+    }
+}

+ 1 - 1
docker/conf/crontab/debug-root

@@ -8,7 +8,7 @@
 0   3   *   *   *   php /var/www/html/crontab/index.php date index
 0   9   *   *   *   php /var/www/html/crontab/index.php date nine_clock
 0   10  *   *   *   php /var/www/html/crontab/index.php date ten_clock
-#*    *   *   *   *   php /var/www/html/crontab/index.php minutes index
+*    *   *   *   *   php /var/www/html/crontab/index.php minutes index
 0   10-20/1 *   *   *   php /var/www/html/crontab/index.php hour index
 0   3   1   */1 *   php /var/www/html/crontab/index.php month index
 *    *   *   *   *   echo "test" >> /var/test.log

+ 1 - 0
global.php

@@ -64,6 +64,7 @@ define('ATTACH_CIRCLE','circle');
 define('ATTACH_CMS','cms');
 define('ATTACH_LIVE','live');
 define('ATTACH_UPFILE','upfile');
+define('ATTACH_TASK','task');
 define('ATTACH_REFILL_EVIDENCE','refill_evidence');
 define('ATTACH_MALBUM', ATTACH_PATH.'/member');
 define('ATTACH_MQRCODE',ATTACH_PATH.'/qrcode');

+ 1 - 1
helper/bonus/BonusAmount.php

@@ -30,7 +30,7 @@ class BonusAmount implements IMoneyCalc
     public function add_bonuses($items)
     {
         foreach ($items as $item) {
-            $bonus = \bonus\user_bonus::create_by_param($item);
+            $bonus = bonus\user_bonus::create_by_param($item);
             $amount = intval($bonus->remain_amount() * 100 + 0.5) / 100;
 
             if ($amount <= 0) continue;

+ 6 - 1
helper/mtopcard/mtopcard.php

@@ -74,7 +74,12 @@ const ProvinceList = [
 
 #空号拦截状态
 const CardState = [
-    '空号','实号','停机','库无','沉默号','风险号'
+    0 => '空号',
+    1 => '实号',
+    2 => '停机',
+    3 => '库无',
+    4 => '沉默号',
+    5 => '风险号'
 ];
 
 function month_stamp($time=null) : int {

+ 4 - 4
helper/refill/CalcMerchantPrice.php

@@ -13,7 +13,6 @@ use Log;
 class CalcMerchantPrice implements ICalc
 {
     private $mPrice;
-
     public function __construct($mchid,$spec,$card_type,$quality,$policy,$other = [])
     {
         if(empty($other) || empty($other['product_code'])) {
@@ -24,10 +23,9 @@ class CalcMerchantPrice implements ICalc
         }
 
         $price = $policy->price($mchid,$spec,$card_type,$quality,$pcode);
-        if($price === false) {
+        if ($price === false) {
             throw new Exception("没有协商商品购买价格.");
-        }
-        else {
+        } else {
             $this->mPrice = $price;
         }
     }
@@ -36,6 +34,7 @@ class CalcMerchantPrice implements ICalc
     {
         return round($this->mPrice,4);
     }
+
     public function calc_vorder_amount($order_info)
     {
         $num = $order_info['quantity'];
@@ -59,6 +58,7 @@ class ZeroMerchantPrice implements ICalc
     {
         return round(0,4);
     }
+
     public function calc_vorder_amount($order_info)
     {
         return round(0,4);

+ 2 - 0
helper/refill/LZRefillFactory.php

@@ -24,6 +24,8 @@ require_once(BASE_HELPER_PATH . '/refill/policy/lingzh/quality_ploy.php');
 require_once(BASE_HELPER_PATH . '/refill/policy/channel_filter.php');
 require_once(BASE_HELPER_PATH . '/refill/policy/mratio_control.php');
 require_once(BASE_HELPER_PATH . '/refill/policy/overload_assigner.php');
+require_once(BASE_HELPER_PATH . '/refill/functional.php');
+
 
 
 use Log;

+ 6 - 1
helper/refill/RefillBase.php

@@ -328,7 +328,7 @@ class RefillBase
             $quality = $order->cur_quality();
 
             [$state, $errmsg, $neterr] = $provider->add($card_no, $card_type, $spec, $params,$net_errno);
-            Log::record(sprintf(" %s add request time=%.6f", $channel_name,microtime(true) - $start), Log::DEBUG);
+            Log::record(sprintf(" %s add request time=%.6f: state={$state} neterr={$neterr},net_errno={$net_errno}", $channel_name,microtime(true) - $start), Log::DEBUG);
 
             if ($state)
             {
@@ -753,4 +753,9 @@ class RefillBase
     {
         $this->mPolicy->update_chspeeds($speeds);
     }
+    public function need_intercept($mchid,$card_type,$card_state,$is_transfer)
+    {
+        return $this->mPolicy->need_intercept($mchid,$card_type,$card_state,$is_transfer);
+
+    }
 }

+ 2 - 0
helper/refill/XYZRefillFactory.php

@@ -28,6 +28,8 @@ require_once(BASE_HELPER_PATH . '/refill/policy/mgroup.php');
 require_once(BASE_HELPER_PATH . '/refill/policy/channel_filter.php');
 require_once(BASE_HELPER_PATH . '/refill/policy/mratio_control.php');
 require_once(BASE_HELPER_PATH . '/refill/policy/overload_assigner.php');
+require_once(BASE_HELPER_PATH . '/refill/functional.php');
+
 
 use Log;
 use StatesHelper;

+ 5 - 2
helper/refill/api/test/qianqian/RefillPhone.php

@@ -26,8 +26,11 @@ class RefillPhone extends refill\IRefillPhone
 
     public function add($card_no, $card_type, $amount, $params,&$net_errno = 0)
     {
-        refill\util::send_normal($params['order_sn']);
-        return [true , '',false];
+        $net_errno = "HTTP-504";
+        return [false, '网络错误', true];
+
+//        refill\util::send_normal($params['order_sn']);
+//        return [true , '',false];
     }
 
     public function query($refill_info)

+ 140 - 140
helper/refill/api/xyz/bingdht/RefillPhone.php

@@ -1,141 +1,141 @@
-<?php
-
-namespace refill\bingdht;
-
-require_once(BASE_HELPER_RAPI_PATH . '/bingdht/config.php');
-
-use refill;
-use Log;
-
-class RefillPhone extends refill\IRefillPhone
-{
-    public function __construct($cfgs)
-    {
-        parent::__construct($cfgs);
-    }
-
-    private function req_params(int $phone, int $amount, int $card_type, string $order_sn)
-    {
-        $params['szAgentId'] = config::USER_ID;
-        $params['szOrderId'] = $order_sn;
-        $params['szPhoneNum'] = $phone;
-        $params['nMoney'] = $amount;
-        $params['nSortType'] = config::operator[$card_type];
-        $params['nProductClass'] = 1;
-        $params['nProductType'] = 1;
-        $params['szTimeStamp'] = date("Y-m-d H:i:s");
-        $params['szNotifyUrl'] = config::NOTIFY_URL;
-        return $params;
-    }
-
-    public function add($card_no, $card_type, $amount, $params,&$net_errno = 0)
-    {
-        $order_sn = $params['order_sn'];
-        $params = $this->req_params($card_no, $amount, $card_type, $order_sn);
-
-        $sign = $this->sign($params);
-        $params['szVerifyString'] = $sign;
-
-        $resp = http_request(config::ORDER_URL, $params, 'POST', false, config::ExtHeaders, $net_errno);
-
-        if (empty($resp)) {
-            return [false, '网络错误', true];
-        }
-        else
-        {
-            Log::record($resp, Log::DEBUG);
-            $resp = json_decode($resp, true);
-
-            $nRtn = $resp['nRtn'];
-            if (empty($resp)) {
-                return [false, '网络错误', true];
-            } elseif ($nRtn === 0) {
-                return [true, '', false];
-            } elseif (in_array($nRtn, config::ERR_NOS, true)) {
-                return [false, $resp['szRtnCode'], false];
-            } elseif (in_array($nRtn, [2050, 999], true)) {
-                $net_errno = "HTTP-{$nRtn}";
-                return [false, $resp['szRtnCode'], false];
-            } else {
-                $err = 998;
-                $net_errno = "HTTP-{$err}";
-                return [false, $resp['szRtnCode'], false];
-            }
-        }
-    }
-
-    public function query($refill_info)
-    {
-        $params['szAgentId'] = config::USER_ID;
-        $params['szOrderId'] = $refill_info['order_sn'];
-        $key = config::KEY;
-        $content = "szAgentId={$params['szAgentId']}&szOrderId={$params['szOrderId']}&szKey={$key}";
-        $params['szVerifyString'] = md5($content);
-
-        $resp = http_request(config::QUERY_URL, $params, 'POST', false, config::ExtHeaders);
-
-        if (empty($resp)) {
-            return [false, '网络错误'];
-        }
-        else
-        {
-            Log::record($resp, Log::DEBUG);
-            $resp = json_decode($resp, true);
-            if (empty($resp)) {
-                return [false, '网络错误'];
-            }
-
-            $status = $resp['nRtn'];
-            if ($status === 5012) {
-                $updata['official_sn'] = $resp['szRtnMsg'];
-                Model('refill_order')->edit($refill_info['order_id'], $updata);
-                $order_state = ORDER_STATE_SUCCESS;
-            } elseif ($status === 5013) {
-                $order_state = ORDER_STATE_CANCEL;
-            } elseif (in_array($status, [5011,5019],true)) {
-                $order_state = ORDER_STATE_SEND;
-            } elseif ($status === 5005 && (time() - $refill_info['commit_time'] >= 300)) {
-                $order_state = ORDER_STATE_NOEXIST;
-            } else {
-                return [false, $resp['szRtnMsg']];
-            }
-
-            return [true, $order_state];
-        }
-    }
-
-    public function balance()
-    {
-        $params['szAgentId'] = config::USER_ID;
-        $key = config::KEY;
-        $content = "szAgentId={$params['szAgentId']}&szKey={$key}";
-        $params['szVerifyString'] = md5($content);
-
-        $resp = http_request(config::BALANCE_URL, $params, 'POST', false, config::ExtHeaders);
-
-        if (empty($resp)) {
-            return [false, '网络错误'];
-        }
-        else
-        {
-            Log::record($resp, Log::DEBUG);
-            $resp = json_decode($resp, true);
-            if (empty($resp)) {
-                return [false, '网络错误'];
-            } elseif ($resp['nRtn'] === 0) {
-                return [true, $resp['fBalance']];
-            } else {
-                return [false, $resp['szRtnCode']];
-            }
-        }
-    }
-
-    private function sign($params)
-    {
-        $userid = config::USER_ID;
-        $key = config::KEY;
-        $content = "szAgentId={$userid}&szOrderId={$params['szOrderId']}&szPhoneNum={$params['szPhoneNum']}&nMoney={$params['nMoney']}&nSortType={$params['nSortType']}";
-        $content .= "&nProductClass={$params['nProductClass']}&nProductType={$params['nProductType']}&szTimeStamp={$params['szTimeStamp']}&szKey={$key}";
-        return md5($content);
-    }
+<?php
+
+namespace refill\bingdht;
+
+require_once(BASE_HELPER_RAPI_PATH . '/bingdht/config.php');
+
+use refill;
+use Log;
+
+class RefillPhone extends refill\IRefillPhone
+{
+    public function __construct($cfgs)
+    {
+        parent::__construct($cfgs);
+    }
+
+    private function req_params(int $phone, int $amount, int $card_type, string $order_sn)
+    {
+        $params['szAgentId'] = config::USER_ID;
+        $params['szOrderId'] = $order_sn;
+        $params['szPhoneNum'] = $phone;
+        $params['nMoney'] = $amount;
+        $params['nSortType'] = config::operator[$card_type];
+        $params['nProductClass'] = 1;
+        $params['nProductType'] = 1;
+        $params['szTimeStamp'] = date("Y-m-d H:i:s");
+        $params['szNotifyUrl'] = config::NOTIFY_URL;
+        return $params;
+    }
+
+    public function add($card_no, $card_type, $amount, $params,&$net_errno = 0)
+    {
+        $order_sn = $params['order_sn'];
+        $params = $this->req_params($card_no, $amount, $card_type, $order_sn);
+
+        $sign = $this->sign($params);
+        $params['szVerifyString'] = $sign;
+
+        $resp = http_request(config::ORDER_URL, $params, 'POST', false, config::ExtHeaders, $net_errno);
+
+        if (empty($resp)) {
+            return [false, '网络错误', true];
+        }
+        else
+        {
+            Log::record($resp, Log::DEBUG);
+            $resp = json_decode($resp, true);
+
+            $nRtn = $resp['nRtn'];
+            if (empty($resp)) {
+                return [false, '网络错误', true];
+            } elseif ($nRtn === 0) {
+                return [true, '', false];
+            } elseif (in_array($nRtn, config::ERR_NOS, true)) {
+                return [false, $resp['szRtnCode'], false];
+            } elseif (in_array($nRtn, [2050, 999], true)) {
+                $net_errno = "HTTP-{$nRtn}";
+                return [false, $resp['szRtnCode'], true];
+            } else {
+                $err = 998;
+                $net_errno = "HTTP-{$err}";
+                return [false, $resp['szRtnCode'], true];
+            }
+        }
+    }
+
+    public function query($refill_info)
+    {
+        $params['szAgentId'] = config::USER_ID;
+        $params['szOrderId'] = $refill_info['order_sn'];
+        $key = config::KEY;
+        $content = "szAgentId={$params['szAgentId']}&szOrderId={$params['szOrderId']}&szKey={$key}";
+        $params['szVerifyString'] = md5($content);
+
+        $resp = http_request(config::QUERY_URL, $params, 'POST', false, config::ExtHeaders);
+
+        if (empty($resp)) {
+            return [false, '网络错误'];
+        }
+        else
+        {
+            Log::record($resp, Log::DEBUG);
+            $resp = json_decode($resp, true);
+            if (empty($resp)) {
+                return [false, '网络错误'];
+            }
+
+            $status = $resp['nRtn'];
+            if ($status === 5012) {
+                $updata['official_sn'] = $resp['szRtnMsg'];
+                Model('refill_order')->edit($refill_info['order_id'], $updata);
+                $order_state = ORDER_STATE_SUCCESS;
+            } elseif ($status === 5013) {
+                $order_state = ORDER_STATE_CANCEL;
+            } elseif (in_array($status, [5011,5019],true)) {
+                $order_state = ORDER_STATE_SEND;
+            } elseif ($status === 5005 && (time() - $refill_info['commit_time'] >= 300)) {
+                $order_state = ORDER_STATE_NOEXIST;
+            } else {
+                return [false, $resp['szRtnMsg']];
+            }
+
+            return [true, $order_state];
+        }
+    }
+
+    public function balance()
+    {
+        $params['szAgentId'] = config::USER_ID;
+        $key = config::KEY;
+        $content = "szAgentId={$params['szAgentId']}&szKey={$key}";
+        $params['szVerifyString'] = md5($content);
+
+        $resp = http_request(config::BALANCE_URL, $params, 'POST', false, config::ExtHeaders);
+
+        if (empty($resp)) {
+            return [false, '网络错误'];
+        }
+        else
+        {
+            Log::record($resp, Log::DEBUG);
+            $resp = json_decode($resp, true);
+            if (empty($resp)) {
+                return [false, '网络错误'];
+            } elseif ($resp['nRtn'] === 0) {
+                return [true, $resp['fBalance']];
+            } else {
+                return [false, $resp['szRtnCode']];
+            }
+        }
+    }
+
+    private function sign($params)
+    {
+        $userid = config::USER_ID;
+        $key = config::KEY;
+        $content = "szAgentId={$userid}&szOrderId={$params['szOrderId']}&szPhoneNum={$params['szPhoneNum']}&nMoney={$params['nMoney']}&nSortType={$params['nSortType']}";
+        $content .= "&nProductClass={$params['nProductClass']}&nProductType={$params['nProductType']}&szTimeStamp={$params['szTimeStamp']}&szKey={$key}";
+        return md5($content);
+    }
 }

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

@@ -47,7 +47,7 @@ class RefillCallBack implements refill\IRefillCallBack
 
     public function notify($params)
     {
-        $status = $params['code'];
+        $status = intval($params['code']);
         $order_sn = $params['tmporder'];
         $order_info = Model('vr_order')->getOrderInfo(['order_sn' => $order_sn]);
         if (empty($order_info)) {

+ 14 - 16
helper/refill/api/xyz/chizeng/RefillCallBack.php

@@ -9,7 +9,7 @@ class RefillCallBack implements refill\IRefillCallBack
     public function verify($params): bool
     {
         $sign = $this->sign($params);
-        if ($params['szVerifyString'] == $sign) {
+        if ($params['sign'] == $sign) {
             return true;
         } else {
             return false;
@@ -20,31 +20,29 @@ class RefillCallBack implements refill\IRefillCallBack
     {
         $userid = config::USER_ID;
         $key = config::KEY;
-        $content = "szAgentId={$userid}&szOrderId={$params['szOrderId']}&szPhoneNum={$params['szPhoneNum']}&nDemo={$params['nDemo']}&fSalePrice={$params['fSalePrice']}";
-        $content .= "&nFlag={$params['nFlag']}&szKey={$key}";
-        return md5($content);
+        $content = "userid={$userid}&orderid={$params['orderid']}&sporderid={$params['sporderid']}&merchantsubmittime={$params['merchantsubmittime']}";
+        $content .= "&resultno={$params['resultno']}&key={$key}";
+        return strtoupper(md5($content));
     }
 
     public function notify($params)
     {
-        $status = intval($params['nFlag']);
-        $order_sn = $params['szOrderId'];
+        $status = intval($params['resultno']);
+        $order_sn = $params['sporderid'];
         $order_info = Model('vr_order')->getOrderInfo(['order_sn' => $order_sn]);
         if (empty($order_info)) {
             return [false, false, false,false];
         }
-        $order_id = $order_info['order_id'];
 
-        if ($status === 2) {
-            $data['official_sn'] = strtolower($params['szRtnMsg']) == 'null' ? '' : $params['szRtnMsg'];
+        $order_id = $order_info['order_id'];
+        if ($status === 1) {
+            $data['official_sn'] = strtolower($params['remark1']) == 'null' ? '' : $params['remark1'];
             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 === 9) {
+            return [$order_id, false, true, true];
+        } else {
+            return [$order_id, false, false, false];
         }
     }
 }

+ 154 - 140
helper/refill/api/xyz/chizeng/RefillPhone.php

@@ -1,141 +1,155 @@
-<?php
-
-namespace refill\chizeng;
-
-require_once(BASE_HELPER_RAPI_PATH . '/chizeng/config.php');
-
-use refill;
-use Log;
-
-class RefillPhone extends refill\IRefillPhone
-{
-    public function __construct($cfgs)
-    {
-        parent::__construct($cfgs);
-    }
-
-    private function req_params(int $phone, int $amount, int $card_type, string $order_sn)
-    {
-        $params['szAgentId'] = config::USER_ID;
-        $params['szOrderId'] = $order_sn;
-        $params['szPhoneNum'] = $phone;
-        $params['nMoney'] = $amount;
-        $params['nSortType'] = config::operator[$card_type];
-        $params['nProductClass'] = 1;
-        $params['nProductType'] = 1;
-        $params['szTimeStamp'] = date("Y-m-d H:i:s");
-        $params['szNotifyUrl'] = config::NOTIFY_URL;
-        return $params;
-    }
-
-    public function add($card_no, $card_type, $amount, $params,&$net_errno = 0)
-    {
-        $order_sn = $params['order_sn'];
-        $params = $this->req_params($card_no, $amount, $card_type, $order_sn);
-
-        $sign = $this->sign($params);
-        $params['szVerifyString'] = $sign;
-
-        $resp = http_request(config::ORDER_URL, $params, 'POST', false, config::ExtHeaders, $net_errno);
-
-        if (empty($resp)) {
-            return [false, '网络错误', true];
-        }
-        else
-        {
-            Log::record($resp, Log::DEBUG);
-            $resp = json_decode($resp, true);
-
-            $nRtn = $resp['nRtn'];
-            if (empty($resp)) {
-                return [false, '网络错误', true];
-            } elseif ($nRtn === 0) {
-                return [true, '', false];
-            } elseif (in_array($nRtn, config::ERR_NOS, true)) {
-                return [false, $resp['szRtnCode'], false];
-            } elseif (in_array($nRtn, [2050, 999], true)) {
-                $net_errno = "HTTP-{$nRtn}";
-                return [false, $resp['szRtnCode'], false];
-            } else {
-                $err = 998;
-                $net_errno = "HTTP-{$err}";
-                return [false, $resp['szRtnCode'], false];
-            }
-        }
-    }
-
-    public function query($refill_info)
-    {
-        $params['szAgentId'] = config::USER_ID;
-        $params['szOrderId'] = $refill_info['order_sn'];
-        $key = config::KEY;
-        $content = "szAgentId={$params['szAgentId']}&szOrderId={$params['szOrderId']}&szKey={$key}";
-        $params['szVerifyString'] = md5($content);
-
-        $resp = http_request(config::QUERY_URL, $params, 'POST', false, config::ExtHeaders);
-
-        if (empty($resp)) {
-            return [false, '网络错误'];
-        }
-        else
-        {
-            Log::record($resp, Log::DEBUG);
-            $resp = json_decode($resp, true);
-            if (empty($resp)) {
-                return [false, '网络错误'];
-            }
-
-            $status = $resp['nRtn'];
-            if ($status === 5012) {
-                $updata['official_sn'] = $resp['szRtnMsg'];
-                Model('refill_order')->edit($refill_info['order_id'], $updata);
-                $order_state = ORDER_STATE_SUCCESS;
-            } elseif ($status === 5013) {
-                $order_state = ORDER_STATE_CANCEL;
-            } elseif (in_array($status, [5011,5019],true)) {
-                $order_state = ORDER_STATE_SEND;
-            } elseif ($status === 5005 && (time() - $refill_info['commit_time'] >= 300)) {
-                $order_state = ORDER_STATE_NOEXIST;
-            } else {
-                return [false, $resp['szRtnMsg']];
-            }
-
-            return [true, $order_state];
-        }
-    }
-
-    public function balance()
-    {
-        $params['szAgentId'] = config::USER_ID;
-        $key = config::KEY;
-        $content = "szAgentId={$params['szAgentId']}&szKey={$key}";
-        $params['szVerifyString'] = md5($content);
-
-        $resp = http_request(config::BALANCE_URL, $params, 'POST', false, config::ExtHeaders);
-
-        if (empty($resp)) {
-            return [false, '网络错误'];
-        }
-        else
-        {
-            Log::record($resp, Log::DEBUG);
-            $resp = json_decode($resp, true);
-            if (empty($resp)) {
-                return [false, '网络错误'];
-            } elseif ($resp['nRtn'] === 0) {
-                return [true, $resp['fBalance']];
-            } else {
-                return [false, $resp['szRtnCode']];
-            }
-        }
-    }
-
-    private function sign($params)
-    {
-        $userid = config::USER_ID;
-        $key = config::KEY;
-        $content = "szAgentId={$userid}&szOrderId={$params['szOrderId']}&szPhoneNum={$params['szPhoneNum']}&nMoney={$params['nMoney']}&nSortType={$params['nSortType']}";
-        $content .= "&nProductClass={$params['nProductClass']}&nProductType={$params['nProductType']}&szTimeStamp={$params['szTimeStamp']}&szKey={$key}";
-        return md5($content);
-    }
+<?php
+
+namespace refill\chizeng;
+
+require_once(BASE_HELPER_RAPI_PATH . '/chizeng/config.php');
+
+use refill;
+use Log;
+
+class RefillPhone extends refill\IRefillPhone
+{
+    public function __construct($cfgs)
+    {
+        parent::__construct($cfgs);
+    }
+
+    private function req_params(int $phone, int $amount, $card_type, string $order_sn)
+    {
+        $params['userid'] = config::USER_ID;
+        $params['productid'] = '';
+        $params['price'] = $amount;
+        $params['num'] = 1;
+        $params['mobile'] = $phone;
+        $params['spordertime'] = date("YmdHis");
+        $params['sporderid'] = $order_sn;
+        $params['back_url'] = config::NOTIFY_URL;
+        $params['paytype'] = config::operator[$card_type];
+
+        return $params;
+    }
+
+    public function add($card_no, $card_type, $amount, $params,&$net_errno = 0)
+    {
+        $order_sn = $params['order_sn'];
+        $params = $this->req_params($card_no, $amount, $card_type, $order_sn);
+
+        $sign = $this->sign($params);
+        $params['sign'] = $sign;
+
+        $resp = http_request(config::ORDER_URL, $params, 'POST', false, config::ExtHeaders, $net_errno);
+
+        if (empty($resp)) {
+            return [false, '网络错误', true];
+        }
+        else
+        {
+            Log::record($resp, Log::DEBUG);
+            $resp = $this->xmlToArray($resp);
+            if (empty($resp)) {
+                return [false, '网络错误', true];
+            }
+
+            $resultno = $resp['resultno'];
+            if (in_array($resultno, ['0', '2'], true)) {
+                return [true, $resp['orderid'], false];
+            } elseif (in_array($resultno, config::ERR_NOS, true)) {
+                return [false, $resultno, false];
+            } elseif ($resultno === '9999' || $resultno === '5006') {
+                $net_errno = "HTTP-{$resultno}";
+                return [false, $resultno, true];
+            } else {
+                //未知结果码
+                $err = 998;
+                $net_errno = "HTTP-{$err}";
+                return [false, $resultno, true];
+            }
+        }
+    }
+
+    public function query($refill_info)
+    {
+        $params['userid'] = config::USER_ID;
+        $params['sporderid'] = $refill_info['order_sn'];
+        $key = config::KEY;
+        $content = "userid={$params['userid']}&sporderid={$params['sporderid']}&key={$key}";
+        $params['sign'] = strtoupper(md5($content));
+
+        $resp = http_request(config::QUERY_URL, $params, 'POST', false, config::ExtHeaders);
+
+        if (empty($resp)) {
+            return [false, '网络错误'];
+        }
+        else
+        {
+            Log::record($resp, Log::DEBUG);
+            $resp = $this->xmlToArray($resp);
+            if (empty($resp))
+            {
+                return [false, '网络错误'];
+            }
+            else
+            {
+                $resultno = $resp['resultno'];
+                if ($resultno === '1') {
+                    $updata['official_sn'] = $resp['remark1'];
+                    Model('refill_order')->edit($refill_info['order_id'], $updata);
+                    $order_state = ORDER_STATE_SUCCESS;
+                } elseif ($resultno === '9') {
+                    $order_state = ORDER_STATE_CANCEL;
+                } elseif (in_array($resultno, ['0','2'], true)) {
+                    $order_state = ORDER_STATE_SEND;
+                } elseif ($resultno === '5007' && (time() - $refill_info['commit_time'] > 600)) {
+                    $order_state = ORDER_STATE_NOEXIST;
+                } else {
+                    return [false, $resultno];
+                }
+
+                return [true, $order_state];
+            }
+        }
+    }
+
+    public function balance()
+    {
+        $params['userid'] = config::USER_ID;
+        $key = config::KEY;
+        $content = "userid={$params['userid']}&key={$key}";
+        $params['sign'] = strtoupper(md5($content));
+
+        $resp = http_request(config::BALANCE_UTL, $params, 'POST', false, config::ExtHeaders);
+
+        if (empty($resp)) {
+            return [false, '网络错误'];
+        }
+        else
+        {
+            Log::record($resp, Log::DEBUG);
+            $resp = $this->xmlToArray($resp);
+            if (empty($resp)) {
+                return [false, '网络错误'];
+            } elseif ($resp['resultno'] === '1') {
+                return [true, $resp['balance']];
+            } else {
+                return [false, $resp['resultno']];
+            }
+        }
+    }
+
+    private function sign($params)
+    {
+        $userid = config::USER_ID;
+        $key = config::KEY;
+        $content = "userid={$userid}&productid={$params['productid']}&price={$params['price']}&num={$params['num']}&mobile={$params['mobile']}&spordertime={$params['spordertime']}";
+        $content .= "&sporderid={$params['sporderid']}&key={$key}";
+        return strtoupper(md5($content));
+    }
+
+    public function xmlToArray($xml)
+    {
+        $replace_str = str_replace(' ','','encoding="gb2312"');
+        $xml = mb_convert_encoding($xml,"UTF-8","gb2312");
+        $xml = str_replace($replace_str, "encoding='utf-8'", $xml);
+        return json_decode(json_encode(simplexml_load_string($xml, 'SimpleXMLElement', LIBXML_NOCDATA)), true);
+    }
 }

+ 0 - 20
helper/refill/api/xyz/chizeng/api.txt

@@ -1,20 +0,0 @@
-正式环境:
-
-话费下单地址:http://120.27.219.88:10186/plat/api/old/submitorder
-
-
-查询地址:http://120.27.219.88:10186/plat/api/old/queryorder
-
-
-查询余额地址:http://120.27.219.88:10186/plat/api/old/queryBalance
-
-
-
-ID:200017
-秘钥:dd514d9c1c954f2b90d7faf25e2a7747
-
-
-对接文档地址:https://docs.qq.com/doc/DWkV1VkxQVk13eEtQ
-
-账号:yezi
-密码: 123456

+ 11 - 11
helper/refill/api/xyz/chizeng/config.php

@@ -6,21 +6,21 @@ namespace refill\chizeng;
 use mtopcard;
 class config
 {
-    const ORDER_URL = 'http://120.27.219.88:10186/plat/api/old/submitorder';
-    const QUERY_URL= 'http://120.27.219.88:10186/plat/api/old/queryorder';
-    const BALANCE_URL= 'http://120.27.219.88:10186/plat/api/old/queryBalance';
+    //https://www.showdoc.com.cn/AQL666666/
+    const ORDER_URL = 'http://123.60.208.38:9086/onlinepay.do';
+    const QUERY_URL= 'http://123.60.208.38:9086/searchpay.do';
+    const BALANCE_UTL = 'http://123.60.208.38:9086/searchbalance.do';
 
-    const USER_ID= '200017';
-    const KEY = 'dd514d9c1c954f2b90d7faf25e2a7747';
+    const USER_ID= '10002523';
+    const KEY = 'BASm8ACwBZxjewFcrQssFxz6P8ydDHfc';
     const NOTIFY_URL = BASE_SITE_URL . "/mobile/callback/refill_chizeng.php";
     const operator = [
-        mtopcard\ChinaMobileCard  => 1,
-        mtopcard\ChinaUnicomCard  => 2,
-        mtopcard\ChinaTelecomCard => 3
+        mtopcard\ChinaMobileCard  => 'yd',
+        mtopcard\ChinaUnicomCard  => 'lt',
+        mtopcard\ChinaTelecomCard => 'dx'
     ];
-    const ExtHeaders = ['Content-Type:application/x-www-form-urlencoded;charset=utf-8'];
-
     const ERR_NOS = [
-        1000,1001,1003,1004,2001,2002,2003,2020,2021,1006,2030,3003
+        '5001','5002','5003','5004','5005','5008','5009','5010','5011','5012'
     ];
+    const ExtHeaders = ['Content-Type:application/x-www-form-urlencoded;'];
 }

+ 19 - 0
helper/refill/api/xyz/chizeng/对接文档-yezi.txt

@@ -0,0 +1,19 @@
+登录地址:http://123.60.208.38:7080/login.jsp
+
+账户名:yezi1
+
+密码:ye_feng21
+
+id:10002523
+
+idkey:BASm8ACwBZxjewFcrQssFxz6P8ydDHfc
+
+下单地址:http://123.60.208.38:9086/onlinepay.do
+
+查询地址:http://123.60.208.38:9086/searchpay.do
+
+余额地址:http://123.60.208.38:9086/searchbalance.do
+
+
+
+对接文档:https://www.showdoc.com.cn/AQL666666/

+ 1 - 1
helper/refill/api/xyz/dashang/RefillPhone.php

@@ -56,7 +56,7 @@ class RefillPhone extends refill\IRefillPhone
                 return [true, $resp['bizOrderId'], false];
             } elseif (in_array($code, [23, 31])) {
                 $net_errno = "HTTP-{$code}";
-                return [false, $code, false];
+                return [false, $code, true];
             } else {
                 return [false, $code, false];
             }

+ 1 - 1
helper/refill/api/xyz/dianchong/RefillPhone.php

@@ -47,7 +47,7 @@ class RefillPhone extends refill\IRefillPhone
                 return [true, $resp['orderno'], false];
             } elseif ($resp['code'] === 'R0009') {
                 $net_errno = $resp['code'];
-                return [false, $resp['msg'], false];
+                return [false, $resp['msg'], true];
             } else {
                 return [false, $resp['msg'], false];
             }

+ 14 - 2
helper/refill/api/xyz/dinghui/RefillPhone.php

@@ -31,7 +31,7 @@ class RefillPhone extends refill\IRefillPhone
         $params['sign'] = $sign;
 
         $url = config::API_URL;
-        return http_request($url, $params, 'POST', false, [], $net_errno);
+        return http_request($url, $params, 'POST', false, []);
     }
 
     private function req_params(int $phone, int $card_type, int $amount, string $order_sn)
@@ -58,7 +58,19 @@ class RefillPhone extends refill\IRefillPhone
         $params = $this->req_params($card_no, $card_type, $amount, $params['order_sn']);
 
         $message = $this->pub_message($params);
-        $resp = $this->url_request($message,'order.charge.query');
+
+        $req['msgtype'] = 'request_msg';
+        $req['format'] = 'json';
+        $req['version'] = '1.0';
+        $req['app_id'] = config::APP_ID;
+        $req['timestamp'] = $this->getMillisecond();
+        $req['method'] = 'order.charge.query';
+        $req['channel'] = 'wap';
+        $req['request_id'] = "REQ".$params['timestamp'];
+        $req['message'] = $message;
+        $sign = $this->sign($req);
+        $req['sign'] = $sign;
+        $resp = http_request(config::API_URL, $req, 'POST', false, [], $net_errno);
 
         if (empty($resp)) {
             return [false, '系统错误', true];

+ 1 - 1
helper/refill/api/xyz/dingxin/RefillPhone.php

@@ -51,7 +51,7 @@ class RefillPhone extends refill\IRefillPhone
                 return [true, $resp['Porderid'], false];
             } elseif ($resp['error'] === '9999') {
                 $net_errno = "HTTP-{$resp['error']}";
-                return [false, $resp['error'], false];
+                return [false, $resp['error'], true];
             } else {
                 return [false, $resp['error'], false];
             }

+ 47 - 0
helper/refill/api/xyz/fangxing/RefillCallBack.php

@@ -0,0 +1,47 @@
+<?php
+
+
+namespace refill\fangxing;
+
+require_once(BASE_HELPER_RAPI_PATH . '/fangxing/config.php');
+
+use refill;
+
+class RefillCallBack implements refill\IRefillCallBack
+{
+    public function verify($params): bool
+    {
+        $sign = $this->sign($params);
+        if ($params['sign'] == $sign) {
+            return true;
+        } else {
+            return false;
+        }
+    }
+
+    private function sign($params)
+    {
+        $content = $params['orderId'] . $params['transNo'] . $params['respCode'] . config::APP_SECRET;
+        return strtoupper(md5($content));
+    }
+
+
+    public function notify($params)
+    {
+        $status = $params['respCode'];
+        $order_sn = $params['transNo'];
+        $order_info = Model('vr_order')->getOrderInfo(['order_sn' => $order_sn]);
+        if (empty($order_info)) {
+            return [false, false, false,false];
+        }
+
+        $order_id = $order_info['order_id'];
+        if ($status === '10003') {
+            return [$order_id, true, false, true];
+        } elseif ($status === '10002') {
+            return [$order_id, false, true, true];
+        } else {
+            return [$order_id, false, false, false];
+        }
+    }
+}

+ 132 - 0
helper/refill/api/xyz/fangxing/RefillPhone.php

@@ -0,0 +1,132 @@
+<?php
+
+namespace refill\fangxing;
+
+require_once(BASE_HELPER_RAPI_PATH . '/fangxing/config.php');
+
+use refill;
+use Log;
+use QueueClient;
+
+class RefillPhone extends refill\IRefillPhone
+{
+    public function __construct($cfgs)
+    {
+        parent::__construct($cfgs);
+    }
+
+    private function req_params(int $phone, int $amount, string $order_sn)
+    {
+        $params['appKey'] = config::APP_KEY;
+        $params['ts'] = date("YmdHis").$this->get_millisecond();
+        $params['phoneNo'] = $phone;
+        $params['prodCode'] = $amount;
+        $params['prodId'] = '1';
+        $params['range'] = '0';
+        $params['backUrl'] = config::NOTIFY_URL;
+        $params['transNo'] = $order_sn;
+
+        return $params;
+    }
+
+    public function add($card_no, $card_type, $amount, $params,&$net_errno = 0)
+    {
+        $order_id = $params['order_id'];
+        $params = $this->req_params($card_no, $amount, $params['order_sn']);
+        $sign = $this->sign($params);
+        $params['sign'] = $sign;
+
+        $resp = http_request(config::ORDER_URL, $params, 'GET', false, [], $net_errno);
+
+        if (empty($resp)) {
+            return [false, '系统错误', true];
+        }
+        else
+        {
+            Log::record($resp, Log::DEBUG);
+            $resp = json_decode($resp, true);
+            if (empty($resp)) {
+                return [false, '系统错误', true];
+            } elseif ($resp['respCode'] === '10001' || $resp['respCode'] === '10005') {
+                return [true, $resp['orderId'], false];
+            } elseif ($resp['respCode'] === '10003') {
+                QueueClient::async_push("QueryRefillState",['order_id' => $order_id],5);
+                return [true, $resp['orderId'], false];
+            } else {
+                return [false, $resp['respMsg'], false];
+            }
+        }
+    }
+
+    public function query($refill_info)
+    {
+        $params['appKey'] = config::APP_KEY;
+        $params['ts'] = date("YmdHis").$this->get_millisecond();
+        $params['orderId'] = $refill_info['order_sn'];
+        $appSecret = config::APP_SECRET;
+        $content = "appSecret={$appSecret}&orderId={$params['orderId']}&ts={$params['ts']}";
+        $params['sign'] = strtoupper(md5($content));
+
+        $resp = http_request(config::QUERY_URL, $params);
+        if (empty($resp)) {
+            return [false, '系统错误'];
+        }
+        else
+        {
+            Log::record($resp, Log::DEBUG);
+            $resp = json_decode($resp, true);
+            if (empty($resp)) {
+                return [false, '系统错误'];
+            } elseif ($resp['respCode'] === '10003') {
+                $order_state = ORDER_STATE_SUCCESS;
+            } elseif ($resp['respCode'] === '10002') {
+                $order_state = ORDER_STATE_CANCEL;
+            } elseif ($resp['respCode'] === '10001') {
+                $order_state = ORDER_STATE_SEND;
+            } else {
+                return [false, $resp['respMsg']];
+            }
+            return [true, $order_state];
+        }
+    }
+
+    public function balance()
+    {
+        $params['appKey'] = config::APP_KEY;
+        $params['ts'] = date("YmdHis").$this->get_millisecond();
+        $appSecret = config::APP_SECRET;
+        $content = "appSecret={$appSecret}&ts={$params['ts']}";
+        $params['sign'] = strtoupper(md5($content));
+
+        $resp = http_request(config::BALANCE_URL, $params);
+
+        if (empty($resp)) {
+            return [false, '系统错误'];
+        }
+        else
+        {
+            Log::record($resp, Log::DEBUG);
+            $resp = json_decode($resp, true);
+            if (empty($resp)) {
+                return [false, '系统错误'];
+            } elseif ($resp['respCode'] === '0000') {
+                return [true, $resp['balance']];
+            } else {
+                return [false, $resp['respMsg']];
+            }
+        }
+    }
+
+    private function sign($params)
+    {
+        $appSecret = config::APP_SECRET;
+        $content = "appSecret={$appSecret}&backUrl={$params['backUrl']}&phoneNo={$params['phoneNo']}&prodCode={$params['prodCode']}&prodId={$params['prodId']}&transNo={$params['transNo']}&ts={$params['ts']}";
+        return strtoupper(md5($content));
+    }
+
+    private function get_millisecond()
+    {
+        list($usec, $sec) = explode(" ", microtime());
+        return round($usec*1000);
+    }
+}

+ 15 - 0
helper/refill/api/xyz/fangxing/config.php

@@ -0,0 +1,15 @@
+<?php
+
+
+namespace refill\fangxing;
+
+class config
+{
+    const ORDER_URL = 'http://47.92.109.196/ht/order';
+    const QUERY_URL = 'http://47.92.109.196/ht/query';
+    const BALANCE_URL = 'http://47.92.109.196/ht/queryBalance';
+
+    const APP_KEY = 'bf708c9ff35f8b6eae12f2b088dcadc89c5755ff';
+    const APP_SECRET = '00ec6742c26efce3792dbc305cb870cdb1ad38b4';
+    const NOTIFY_URL = BASE_SITE_URL . "/mobile/callback/refill_fangxing.php";
+}

二进制
helper/refill/api/xyz/fangxing/开发接口文档V1.2.4.pdf


+ 12 - 0
helper/refill/api/xyz/fangxing/账号.txt

@@ -0,0 +1,12 @@
+接口地址 http://47.92.109.196/ht/
+管理后台地址 
+http://47.92.161.74:8091/login_toLogin
+账号 guoyanflfs
+密码 123456
+备注:开发者密钥请至后台“用户中心-账户设置”输入支付密码后查看,支付密码默认为登录密码
+
+appKey:
+bf708c9ff35f8b6eae12f2b088dcadc89c5755ff
+
+secretKey:
+00ec6742c26efce3792dbc305cb870cdb1ad38b4

二进制
helper/refill/api/xyz/guochuang/20211022黑龙江移动.png


二进制
helper/refill/api/xyz/guochuang/20211025辽宁移动.png


二进制
helper/refill/api/xyz/guochuang/20211027内蒙古调价函.png


二进制
helper/refill/api/xyz/guochuang/20211029辽宁移动.png


二进制
helper/refill/api/xyz/guochuang/20211101福建移动调价函.png


二进制
helper/refill/api/xyz/guochuang/20211101重庆移动调价.png


+ 206 - 196
helper/refill/api/xyz/guochuang/RefillPhone.php

@@ -1,197 +1,207 @@
-<?php
-
-namespace refill\guochuang;
-
-require_once(BASE_HELPER_RAPI_PATH . '/guochuang/config.php');
-
-use refill;
-use Log;
-
-class RefillPhone extends refill\IRefillPhone
-{
-    public function __construct($cfgs)
-    {
-        parent::__construct($cfgs);
-    }
-
-    public function goods($quality,int $amount,int $card_type,$regin_no,$other)
-    {
-        [$goods_id, $price] = parent::goods($quality,$amount,$card_type,$regin_no,$other);
-        if($goods_id <= 0) return [0,0];
-        $key = "{$card_type}-{$amount}-{$regin_no}";
-        $price = config::Price[$key];
-        if(empty($price)) {
-            Log::record("channel cannot find price where name={$this->mName}, goods_id = {$goods_id} card_type={$card_type} amount={$amount} regin_no={$regin_no}",Log::ERR);
-            return [0,0];
-        } else {
-            return [$goods_id,ncPriceFormat($price)];
-        }
-    }
-
-    private function req_params(int $phone, int $amount, int $card_type, string $order_sn)
-    {
-        $params['phone'] = $phone;
-        $params['phoneType'] = config::operator[$card_type];
-        $params['money'] = $amount;
-        $params['outerId'] = $order_sn;
-        $params['callBackUrl'] = config::NOTIFY_URL;
-        $params['speed'] = 0;
-
-        return $params;
-    }
-
-    //统一请求
-    private function url_request($params,$service)
-    {
-        $get_params['service'] = $service;
-        $get_params['userId'] = config::UserId;
-        $get_params['ts'] = $this->getMillisecond();
-
-        $sign = $this->sign($params,$get_params);
-        $get_params['sign'] = $sign;
-
-        $url = config::API_URL;
-        $url = $url . (strpos($url, '?') ? '&' : '?') . (is_array($get_params) ? http_build_query($get_params) : $get_params);
-        return http_request($url, $params, 'POST', false, [], $net_errno);
-    }
-
-    public function add($card_no, $card_type, $amount, $params,&$net_errno = 0)
-    {
-        $order_sn = $params['order_sn'];
-        $regin_no = $params['regin_no'] ?? -1;
-
-        if($regin_no <= 0) {
-            return [false, '省份获取错误', false];
-        }
-
-        $params = $this->req_params($card_no, $amount, $card_type, $order_sn);
-        $params['provId'] = config::ProvinceMap[$regin_no];
-        if(empty($params['provId'])) {
-            return [false, '省份获取错误', false];
-        }
-
-        $resp = $this->url_request($params,'order.phone.charge');
-        if (empty($resp)) {
-            return [false, '系统错误', true];
-        }
-        else
-        {
-            Log::record($resp, Log::DEBUG);
-
-            $resp = json_decode($resp ,true);
-            $code = $resp['code'];
-            if (empty($resp)) {
-                return [false, '系统错误', true];
-            } elseif ($code == 'SUCCESS') {
-                return [true, $resp['id'], false];
-            } elseif (in_array($code, config::ORDER_ERR_CODE)) {
-                return [false, $code, false];
-            } elseif (in_array($code, ['SYSTEM_ERROR', 'ORDER_ID_EXIST'])) {
-                $net_errno = "HTTP-{$code}";
-                return [false, $code, false];
-            } else {
-                $err = 998;
-                $net_errno = "HTTP-{$err}";
-                return [false, $code, false];
-            }
-        }
-    }
-
-    public function query($refill_info)
-    {
-        //上游单号,可以为空,但需参与签名
-        $params['id'] = '';
-        $params['outerId'] = $refill_info['order_sn'];
-
-        $resp = $this->url_request($params,'order.status.query');
-
-        if (empty($resp)) {
-            return [false, '系统错误'];
-        }
-        else
-        {
-            Log::record($resp, Log::DEBUG);
-            $resp = json_decode($resp, true);
-            $code = $resp['code'];
-            if (empty($resp))
-            {
-                return [false, '系统错误'];
-            }
-            elseif ($code == 'SUCCESS')
-            {
-                $status = $resp['status'];
-
-                if ($status === 'SUCCESS') {
-                    $order_state = ORDER_STATE_SUCCESS;
-                    $save['official_sn'] = strtolower($resp['evidence']) == 'null' ? '' : $resp['evidence'];
-                    Model('refill_order')->edit($refill_info['order_id'], $save);
-                } elseif ($status === 'FAIL') {
-                    $order_state = ORDER_STATE_CANCEL;
-                } elseif ($status === 'PROCESSING') {
-                    $order_state = ORDER_STATE_SEND;
-                } elseif ($status === 'ORDER_NOT_EXIST' && (time() - $refill_info['commit_time'] >= 600)) {
-                    $order_state = ORDER_STATE_NOEXIST;
-                } else {
-                    return [false, $code];
-                }
-
-                return [true, $order_state];
-            }
-            else
-            {
-                return [false, "code={$code}"];
-            }
-        }
-    }
-
-    public function balance()
-    {
-        $resp = $this->url_request([],'user.balance.query');
-
-        if (empty($resp)) {
-            return [false, '系统错误'];
-        }
-        else
-        {
-            Log::record($resp, Log::DEBUG);
-            $resp = json_decode($resp, true);
-            if (empty($resp))
-            {
-                return [false, '系统错误'];
-            }
-            elseif ($resp['code'] == 'SUCCESS')
-            {
-                return [true, $resp['balance']];
-            }
-            else
-            {
-                return [false, $resp['code']];
-            }
-        }
-    }
-
-    private function sign($params,$get_params)
-    {
-        $userId = config::UserId;
-        $api_key = config::ApiKey;
-        $content = "service={$get_params['service']}&userId={$userId}&ts={$get_params['ts']}&";
-        if(!empty($params)) {
-            foreach ($params as $key => $value){
-                $content .= "{$key}={$value}&";
-            }
-            $content = rtrim($content, '&');
-        }
-        $content .= "&key={$api_key}";
-        return strtoupper(md5($content));
-    }
-
-    /**
-     * 获取毫秒级别的时间戳
-     */
-    private function getMillisecond()
-    {
-        $cur = microtime (true);
-        $cur = intval($cur * 1000);
-        return $cur;
-    }
+<?php
+
+namespace refill\guochuang;
+
+require_once(BASE_HELPER_RAPI_PATH . '/guochuang/config.php');
+
+use refill;
+use Log;
+
+class RefillPhone extends refill\IRefillPhone
+{
+    public function __construct($cfgs)
+    {
+        parent::__construct($cfgs);
+    }
+
+    public function goods($quality,int $amount,int $card_type,$regin_no,$other)
+    {
+        [$goods_id, $price] = parent::goods($quality,$amount,$card_type,$regin_no,$other);
+        if($goods_id <= 0) return [0,0];
+        $key = "{$card_type}-{$amount}-{$regin_no}";
+        $price = config::Price[$key];
+        if(empty($price)) {
+            Log::record("channel cannot find price where name={$this->mName}, goods_id = {$goods_id} card_type={$card_type} amount={$amount} regin_no={$regin_no}",Log::ERR);
+            return [0,0];
+        } else {
+            return [$goods_id,ncPriceFormat($price)];
+        }
+    }
+
+    private function add_params(int $phone, int $amount, int $card_type, string $order_sn,$regin_no)
+    {
+        $params['phone'] = $phone;
+        $params['phoneType'] = config::operator[$card_type];
+        $params['money'] = $amount;
+        $params['outerId'] = $order_sn;
+        $params['callBackUrl'] = config::NOTIFY_URL;
+        $params['speed'] = 0;
+        $params['provId'] = config::ProvinceMap[$regin_no];
+
+        if(empty($params['provId'])) {
+            return false;
+        }
+        else {
+            return $params;
+        }
+    }
+
+    private function form_uri($params, $service)
+    {
+        $get_params['service'] = $service;
+        $get_params['userId'] = config::UserId;
+        $get_params['ts'] = $this->getMillisecond();
+
+        $sign = $this->sign($params,$get_params);
+        $get_params['sign'] = $sign;
+
+        $url = config::API_URL;
+        $uri = $url . (strpos($url, '?') ? '&' : '?') . (is_array($get_params) ? http_build_query($get_params) : $get_params);
+
+        return $uri;
+    }
+
+    public function add($card_no, $card_type, $amount, $input, &$net_errno = 0)
+    {
+        $order_sn = $input['order_sn'];
+        $regin_no = $input['regin_no'] ?? -1;
+        if($regin_no <= 0) {
+            return [false, '省份获取错误', false];
+        }
+
+        $params = $this->add_params($card_no, $amount, $card_type, $order_sn,$regin_no);
+        if($params === false) {
+            return [false, '省份信息错误', false];
+        }
+
+        $uri = $this->form_uri($params,'order.phone.charge');
+        $resp = http_request($uri, $params, 'POST', false, [], $net_errno);
+
+        if (empty($resp)) {
+            return [false, '系统错误', true];
+        }
+        else
+        {
+            Log::record($resp, Log::DEBUG);
+
+            $resp = json_decode($resp ,true);
+            $code = $resp['code'];
+            if (empty($resp)) {
+                return [false, '系统错误', true];
+            } elseif ($code === 'SUCCESS') {
+                return [true, $resp['id'], false];
+            } elseif (in_array($code, config::ORDER_ERR_CODE)) {
+                return [false, $code, false];
+            } elseif (in_array($code, ['SYSTEM_ERROR', 'ORDER_ID_EXIST'])) {
+                $net_errno = "HTTP-{$code}";
+                return [false, $code, true];
+            } else {
+                $err = 998;
+                $net_errno = "HTTP-{$err}";
+                return [false, $code, true];
+            }
+        }
+    }
+
+    public function query($refill_info)
+    {
+        //上游单号,可以为空,但需参与签名
+        $params['id'] = '';
+        $params['outerId'] = $refill_info['order_sn'];
+
+        $uri = $this->form_uri($params,'order.status.query');
+        $resp = http_request($uri, $params, 'POST');
+
+        if (empty($resp)) {
+            return [false, '系统错误'];
+        }
+        else
+        {
+            Log::record($resp, Log::DEBUG);
+            $resp = json_decode($resp, true);
+            $code = $resp['code'];
+            if (empty($resp))
+            {
+                return [false, '系统错误'];
+            }
+            elseif ($code === 'SUCCESS')
+            {
+                $status = $resp['status'];
+
+                if ($status === 'SUCCESS') {
+                    $order_state = ORDER_STATE_SUCCESS;
+                    $save['official_sn'] = strtolower($resp['evidence']) == 'null' ? '' : $resp['evidence'];
+                    Model('refill_order')->edit($refill_info['order_id'], $save);
+                } elseif ($status === 'FAIL') {
+                    $order_state = ORDER_STATE_CANCEL;
+                } elseif ($status === 'PROCESSING') {
+                    $order_state = ORDER_STATE_SEND;
+                } elseif ($status === 'ORDER_NOT_EXIST' && (time() - $refill_info['commit_time'] >= 600)) {
+                    $order_state = ORDER_STATE_NOEXIST;
+                } else {
+                    return [false, $code];
+                }
+
+                return [true, $order_state];
+            }
+            else
+            {
+                return [false, "code={$code}"];
+            }
+        }
+    }
+
+    public function balance()
+    {
+        $uri = $this->form_uri([],'user.balance.query');
+        $resp = http_request($uri, [], 'POST');
+
+        if (empty($resp)) {
+            return [false, '系统错误'];
+        }
+        else
+        {
+            Log::record($resp, Log::DEBUG);
+            $resp = json_decode($resp, true);
+            if (empty($resp))
+            {
+                return [false, '系统错误'];
+            }
+            elseif ($resp['code'] === 'SUCCESS')
+            {
+                return [true, $resp['balance']];
+            }
+            else
+            {
+                return [false, $resp['code']];
+            }
+        }
+    }
+
+    private function sign($params,$get_params)
+    {
+        $userId = config::UserId;
+        $api_key = config::ApiKey;
+        $content = "service={$get_params['service']}&userId={$userId}&ts={$get_params['ts']}&";
+        if(!empty($params))
+        {
+            foreach ($params as $key => $value){
+                $content .= "{$key}={$value}&";
+            }
+            $content = rtrim($content, '&');
+        }
+
+        $content .= "&key={$api_key}";
+        return strtoupper(md5($content));
+    }
+
+    /**
+     * 获取毫秒级别的时间戳
+     */
+    private function getMillisecond()
+    {
+        $cur = microtime (true);
+        $cur = intval($cur * 1000);
+        return $cur;
+    }
 }

+ 5 - 5
helper/refill/api/xyz/guochuang/config.php

@@ -64,18 +64,18 @@ class config
     const Price = [
         //移动
         "4-10-2" => 9.94, "4-20-2" => 19.88, "4-30-2" => 29.82, "4-50-2" => 49.7, "4-100-2" => 99.4, "4-200-2" => 198.8, "4-300-2" => 298.2, "4-500-2" => 497,//天津 2
-        "4-10-6" => 9.72, "4-20-6" => 19.44, "4-30-6" => 29.16, "4-50-6" => 48.6, "4-100-6" => 97.2, "4-200-6" => 194.4, "4-300-6" => 291.6, "4-500-6" => 486,//辽宁 6
+        "4-10-6" => 9.725, "4-20-6" => 19.45, "4-30-6" => 29.175, "4-50-6" => 48.625, "4-100-6" => 97.25, "4-200-6" => 194.5, "4-300-6" => 291.75, "4-500-6" => 486.25,//辽宁 6
         "4-10-9" => 9.93, "4-20-9" => 19.86, "4-30-9" => 29.79, "4-50-9" => 49.65, "4-100-9" => 99.3,//上海 9
-        "4-10-8" => 9.995, "4-20-8" => 19.99, "4-30-8" => 29.985, "4-50-8" => 49.975, "4-100-8" => 99.95, "4-200-8" => 199.9, "4-300-8" => 299.85, "4-500-8" => 499.75,//黑龙江 8
+        "4-10-8" => 10.012, "4-20-8" => 20.024, "4-30-8" => 30.036, "4-50-8" => 50.06, "4-100-8" => 100.12, "4-200-8" => 200.24, "4-300-8" => 300.36, "4-500-8" => 500.6,//黑龙江 8
         "4-10-29" => 9.82, "4-20-29" => 19.64, "4-30-29" => 29.46, "4-50-29" => 49.1, "4-100-29" => 98.2, "4-200-29" => 196.4, "4-300-29" => 294.6, "4-500-29" => 491,//青海 29
         "4-10-28" => 9.925, "4-20-28" => 19.85, "4-30-28" => 29.775, "4-50-28" => 49.625, "4-100-28" => 99.25, "4-200-28" => 198.5, "4-300-28" => 297.75, "4-500-28" => 496.25,//甘肃 28
-        "4-10-13" => 10.02, "4-20-13" => 20.04, "4-30-13" => 30.06, "4-50-13" => 51, "4-100-13" => 100.2, "4-200-13" => 200.4, "4-300-13" => 300.6, "4-500-13" => 501,//福建 13
-        "4-10-5" => 9.965, "4-20-5" => 19.93, "4-30-5" => 29.895, "4-50-5" => 49.825, "4-100-5" => 99.65, "4-200-5" => 199.3, "4-300-5" => 298.95, "4-500-5" => 498.25,//内蒙古 5
+        "4-10-13" => 10.03, "4-20-13" => 20.06, "4-30-13" => 30.09, "4-50-13" => 50.15, "4-100-13" => 100.3, "4-200-13" => 200.6, "4-300-13" => 300.9, "4-500-13" => 501.5,//福建 13
+        "4-10-5" => 10, "4-20-5" => 20, "4-30-5" => 30, "4-50-5" => 50, "4-100-5" => 100, "4-200-5" => 200, "4-300-5" => 300, "4-500-5" => 500,//内蒙古 5
         "4-30-18" => 29.835, "4-50-18" => 49.725, "4-100-18" => 99.45, "4-200-18" => 198.3,//湖南 18
         "4-10-19" => 9.965, "4-20-19" => 19.93, "4-30-19" => 29.895, "4-50-19" => 49.825, "4-100-19" => 99.65, "4-200-19" => 199.3, "4-300-19" => 298.95, "4-500-19" => 498.25,//广东 19
         "4-10-7" => 9.885, "4-20-7" => 19.77, "4-30-7" => 29.655, "4-50-7" => 49.425, "4-100-7" => 98.85, "4-200-7" => 197.7, "4-300-7" => 296.55, "4-500-7" => 494.25,//吉林 7
         "4-10-1" => 9.99, "4-20-1" => 19.98, "4-30-1" => 29.97, "4-50-1" => 49.95, "4-100-1" => 99.9, "4-200-1" => 199.8, "4-300-1" => 299.7, "4-500-1" => 499.5,//北京 1
-        "4-20-22" => 20.01, "4-30-22" => 30.015, "4-50-22" => 50.025, "4-100-22" => 100.05, "4-200-22" => 200.1, "4-300-22" => 300.15, "4-500-22" => 500.25,//重庆 22
+        "4-10-22" => 10.015, "4-20-22" => 20.03, "4-30-22" => 30.045, "4-50-22" => 50.075, "4-100-22" => 100.15, "4-200-22" => 200.3, "4-300-22" => 300.45, "4-500-22" => 500.75,//重庆 22
         "4-10-15" => 9.945, "4-20-15" => 19.89, "4-30-15" => 29.835, "4-50-15" => 49.725, "4-100-15" => 99.45, "4-200-15" => 198.9, "4-300-15" => 298.35, "4-500-15" => 497.25,//山东 15
         "4-10-10" => 9.945, "4-20-10" => 19.89, "4-30-10" => 29.835, "4-50-10" => 49.725, "4-100-10" => 99.45, "4-200-10" => 198.9, "4-300-10" => 298.35, "4-500-10" => 497.25,//江苏 10
         "4-10-11" => 9.945, "4-20-11" => 19.89, "4-30-11" => 29.835, "4-50-11" => 49.725, "4-100-11" => 99.45, "4-200-11" => 198.9, "4-300-11" => 298.35, "4-500-11" => 497.25,//浙江 11

二进制
helper/refill/api/xyz/guochuang_nation/20211028电信5-9调价.png


二进制
helper/refill/api/xyz/guochuang_nation/20211102电信.png


二进制
helper/refill/api/xyz/guochuang_nation/20211102移动30,50.png


+ 187 - 182
helper/refill/api/xyz/guochuang_nation/RefillPhone.php

@@ -1,183 +1,188 @@
-<?php
-
-namespace refill\guochuang_nation;
-
-require_once(BASE_HELPER_RAPI_PATH . '/guochuang_nation/config.php');
-
-use refill;
-use Log;
-
-class RefillPhone extends refill\IRefillPhone
-{
-    public function __construct($cfgs)
-    {
-        parent::__construct($cfgs);
-    }
-
-    private function req_params(int $phone, int $amount, int $card_type, string $order_sn)
-    {
-        $params['phone'] = $phone;
-        $params['phoneType'] = config::operator[$card_type];
-        $params['money'] = $amount;
-        $params['outerId'] = $order_sn;
-        $params['callBackUrl'] = config::NOTIFY_URL;
-        $params['speed'] = 0;
-
-        return $params;
-    }
-
-    //统一请求
-    private function url_request($params,$service)
-    {
-        $get_params['service'] = $service;
-        $get_params['userId'] = config::UserId;
-        $get_params['ts'] = $this->getMillisecond();
-
-        $sign = $this->sign($params,$get_params);
-        $get_params['sign'] = $sign;
-
-        $url = config::API_URL;
-        $url = $url . (strpos($url, '?') ? '&' : '?') . (is_array($get_params) ? http_build_query($get_params) : $get_params);
-        return http_request($url, $params, 'POST', false, [], $net_errno);
-    }
-
-    public function add($card_no, $card_type, $amount, $params,&$net_errno = 0)
-    {
-        $order_sn = $params['order_sn'];
-        $regin_no = $params['regin_no'] ?? -1;
-
-        if($regin_no <= 0) {
-            return [false, '省份获取错误', false];
-        }
-
-        $params = $this->req_params($card_no, $amount, $card_type, $order_sn);
-        $params['provId'] = config::ProvinceMap[$regin_no];
-        if(empty($params['provId'])) {
-            return [false, '省份获取错误', false];
-        }
-
-        $resp = $this->url_request($params,'order.phone.charge');
-        if (empty($resp)) {
-            return [false, '系统错误', true];
-        }
-        else
-        {
-            Log::record($resp, Log::DEBUG);
-
-            $resp = json_decode($resp ,true);
-            $code = $resp['code'];
-            if (empty($resp)) {
-                return [false, '系统错误', true];
-            } elseif ($code == 'SUCCESS') {
-                return [true, $resp['id'], false];
-            } elseif (in_array($code, config::ORDER_ERR_CODE)) {
-                return [false, $code, false];
-            } elseif (in_array($code, ['SYSTEM_ERROR', 'ORDER_ID_EXIST'])) {
-                $net_errno = "HTTP-{$code}";
-                return [false, $code, false];
-            } else {
-                $err = 998;
-                $net_errno = "HTTP-{$err}";
-                return [false, $code, false];
-            }
-        }
-    }
-
-    public function query($refill_info)
-    {
-        //上游单号,可以为空,但需参与签名
-        $params['id'] = '';
-        $params['outerId'] = $refill_info['order_sn'];
-
-        $resp = $this->url_request($params,'order.status.query');
-
-        if (empty($resp)) {
-            return [false, '系统错误'];
-        }
-        else
-        {
-            Log::record($resp, Log::DEBUG);
-            $resp = json_decode($resp, true);
-            $code = $resp['code'];
-            if (empty($resp))
-            {
-                return [false, '系统错误'];
-            }
-            elseif ($code == 'SUCCESS')
-            {
-                $status = $resp['status'];
-
-                if ($status === 'SUCCESS') {
-                    $order_state = ORDER_STATE_SUCCESS;
-                    $save['official_sn'] = strtolower($resp['evidence']) == 'null' ? '' : $resp['evidence'];
-                    Model('refill_order')->edit($refill_info['order_id'], $save);
-                } elseif ($status === 'FAIL') {
-                    $order_state = ORDER_STATE_CANCEL;
-                } elseif ($status === 'PROCESSING') {
-                    $order_state = ORDER_STATE_SEND;
-                } elseif ($status === 'ORDER_NOT_EXIST' && (time() - $refill_info['commit_time'] >= 600)) {
-                    $order_state = ORDER_STATE_NOEXIST;
-                } else {
-                    return [false, $code];
-                }
-
-                return [true, $order_state];
-            }
-            else
-            {
-                return [false, "code={$code}"];
-            }
-        }
-    }
-
-    public function balance()
-    {
-        $resp = $this->url_request([],'user.balance.query');
-
-        if (empty($resp)) {
-            return [false, '系统错误'];
-        }
-        else
-        {
-            Log::record($resp, Log::DEBUG);
-            $resp = json_decode($resp, true);
-            if (empty($resp))
-            {
-                return [false, '系统错误'];
-            }
-            elseif ($resp['code'] == 'SUCCESS')
-            {
-                return [true, $resp['balance']];
-            }
-            else
-            {
-                return [false, $resp['code']];
-            }
-        }
-    }
-
-    private function sign($params,$get_params)
-    {
-        $userId = config::UserId;
-        $api_key = config::ApiKey;
-        $content = "service={$get_params['service']}&userId={$userId}&ts={$get_params['ts']}&";
-        if(!empty($params)) {
-            foreach ($params as $key => $value){
-                $content .= "{$key}={$value}&";
-            }
-            $content = rtrim($content, '&');
-        }
-        $content .= "&key={$api_key}";
-        return strtoupper(md5($content));
-    }
-
-    /**
-     * 获取毫秒级别的时间戳
-     */
-    private function getMillisecond()
-    {
-        $cur = microtime (true);
-        $cur = intval($cur * 1000);
-        return $cur;
-    }
+<?php
+
+namespace refill\guochuang_nation;
+
+require_once(BASE_HELPER_RAPI_PATH . '/guochuang_nation/config.php');
+
+use refill;
+use Log;
+
+class RefillPhone extends refill\IRefillPhone
+{
+    public function __construct($cfgs)
+    {
+        parent::__construct($cfgs);
+    }
+
+    private function add_params(int $phone, int $amount, int $card_type, string $order_sn,$regin_no)
+    {
+        $params['phone'] = $phone;
+        $params['phoneType'] = config::operator[$card_type];
+        $params['money'] = $amount;
+        $params['outerId'] = $order_sn;
+        $params['callBackUrl'] = config::NOTIFY_URL;
+        $params['speed'] = 0;
+        $params['provId'] = config::ProvinceMap[$regin_no];
+
+        if(empty($params['provId'])) {
+            return false;
+        }
+        else {
+            return $params;
+        }
+    }
+
+    private function form_uri($params, $service)
+    {
+        $get_params['service'] = $service;
+        $get_params['userId'] = config::UserId;
+        $get_params['ts'] = $this->getMillisecond();
+
+        $sign = $this->sign($params,$get_params);
+        $get_params['sign'] = $sign;
+
+        $url = config::API_URL;
+        $uri = $url . (strpos($url, '?') ? '&' : '?') . (is_array($get_params) ? http_build_query($get_params) : $get_params);
+
+        return $uri;
+    }
+
+    public function add($card_no, $card_type, $amount, $input, &$net_errno = 0)
+    {
+        $order_sn = $input['order_sn'];
+        $regin_no = $input['regin_no'] ?? -1;
+        if($regin_no <= 0) {
+            return [false, '省份获取错误', false];
+        }
+
+        $params = $this->add_params($card_no, $amount, $card_type, $order_sn,$regin_no);
+        if($params === false) {
+            return [false, '省份信息错误', false];
+        }
+
+        $uri = $this->form_uri($params,'order.phone.charge');
+        $resp = http_request($uri, $params, 'POST', false, [], $net_errno);
+
+        if (empty($resp)) {
+            return [false, '系统错误', true];
+        }
+        else
+        {
+            Log::record($resp, Log::DEBUG);
+
+            $resp = json_decode($resp ,true);
+            $code = $resp['code'];
+            if (empty($resp)) {
+                return [false, '系统错误', true];
+            } elseif ($code === 'SUCCESS') {
+                return [true, $resp['id'], false];
+            } elseif (in_array($code, config::ORDER_ERR_CODE)) {
+                return [false, $code, false];
+            } elseif (in_array($code, ['SYSTEM_ERROR', 'ORDER_ID_EXIST'])) {
+                $net_errno = "HTTP-{$code}";
+                return [false, $code, true];
+            } else {
+                $err = 998;
+                $net_errno = "HTTP-{$err}";
+                return [false, $code, true];
+            }
+        }
+    }
+
+    public function query($refill_info)
+    {
+        //上游单号,可以为空,但需参与签名
+        $params['id'] = '';
+        $params['outerId'] = $refill_info['order_sn'];
+
+        $uri = $this->form_uri($params,'order.status.query');
+        $resp = http_request($uri, $params, 'POST');
+
+        if (empty($resp)) {
+            return [false, '系统错误'];
+        }
+        else
+        {
+            Log::record($resp, Log::DEBUG);
+            $resp = json_decode($resp, true);
+            $code = $resp['code'];
+            if (empty($resp))
+            {
+                return [false, '系统错误'];
+            }
+            elseif ($code === 'SUCCESS')
+            {
+                $status = $resp['status'];
+
+                if ($status === 'SUCCESS') {
+                    $order_state = ORDER_STATE_SUCCESS;
+                    $save['official_sn'] = strtolower($resp['evidence']) == 'null' ? '' : $resp['evidence'];
+                    Model('refill_order')->edit($refill_info['order_id'], $save);
+                } elseif ($status === 'FAIL') {
+                    $order_state = ORDER_STATE_CANCEL;
+                } elseif ($status === 'PROCESSING') {
+                    $order_state = ORDER_STATE_SEND;
+                } elseif ($status === 'ORDER_NOT_EXIST' && (time() - $refill_info['commit_time'] >= 600)) {
+                    $order_state = ORDER_STATE_NOEXIST;
+                } else {
+                    return [false, $code];
+                }
+
+                return [true, $order_state];
+            }
+            else
+            {
+                return [false, "code={$code}"];
+            }
+        }
+    }
+
+    public function balance()
+    {
+        $uri = $this->form_uri([],'user.balance.query');
+        $resp = http_request($uri, [], 'POST');
+
+        if (empty($resp)) {
+            return [false, '系统错误'];
+        }
+        else
+        {
+            Log::record($resp, Log::DEBUG);
+            $resp = json_decode($resp, true);
+            if (empty($resp)) {
+                return [false, '系统错误'];
+            } elseif ($resp['code'] === 'SUCCESS') {
+                return [true, $resp['balance']];
+            } else {
+                return [false, $resp['code']];
+            }
+        }
+    }
+
+    private function sign($params,$get_params)
+    {
+        $userId = config::UserId;
+        $api_key = config::ApiKey;
+        $content = "service={$get_params['service']}&userId={$userId}&ts={$get_params['ts']}&";
+        if(!empty($params))
+        {
+            foreach ($params as $key => $value){
+                $content .= "{$key}={$value}&";
+            }
+            $content = rtrim($content, '&');
+        }
+
+        $content .= "&key={$api_key}";
+        return strtoupper(md5($content));
+    }
+
+    /**
+     * 获取毫秒级别的时间戳
+     */
+    private function getMillisecond()
+    {
+        $cur = microtime (true);
+        $cur = intval($cur * 1000);
+        return $cur;
+    }
 }

+ 1 - 1
helper/refill/api/xyz/hongxudagy/RefillPhone.php

@@ -51,7 +51,7 @@ class RefillPhone extends refill\IRefillPhone
                 return [true, $resp['data']['supply_id'], false];
             } elseif ($resp['code'] == 999) {
                 $net_errno = "HTTP-999";
-                return [false, $resp['msg'], false];
+                return [false, $resp['msg'], true];
             } else {
                 return [false, $resp['msg'], false];
             }

+ 1 - 1
helper/refill/api/xyz/hongxudagy996/RefillPhone.php

@@ -51,7 +51,7 @@ class RefillPhone extends refill\IRefillPhone
                 return [true, $resp['data']['supply_id'], false];
             } elseif ($resp['code'] == 999) {
                 $net_errno = "HTTP-999";
-                return [false, $resp['msg'], false];
+                return [false, $resp['msg'], true];
             } else {
                 return [false, $resp['msg'], false];
             }

+ 1 - 1
helper/refill/api/xyz/hongxudayz/RefillPhone.php

@@ -51,7 +51,7 @@ class RefillPhone extends refill\IRefillPhone
                 return [true, $resp['data']['supply_id'], false];
             } elseif ($resp['code'] == 999) {
                 $net_errno = "HTTP-999";
-                return [false, $resp['msg'], false];
+                return [false, $resp['msg'], true];
             } else {
                 return [false, $resp['msg'], false];
             }

+ 1 - 1
helper/refill/api/xyz/hongxudayz996/RefillPhone.php

@@ -51,7 +51,7 @@ class RefillPhone extends refill\IRefillPhone
                 return [true, $resp['data']['supply_id'], false];
             } elseif ($resp['code'] == 999) {
                 $net_errno = "HTTP-999";
-                return [false, $resp['msg'], false];
+                return [false, $resp['msg'], true];
             } else {
                 return [false, $resp['msg'], false];
             }

+ 5 - 5
helper/refill/api/xyz/huafutong/RefillPhone.php

@@ -73,13 +73,13 @@ class RefillPhone extends refill\IRefillPhone
             if (empty($resp)) {
                 return [false, '系统错误'];
             }
-            elseif (intval($resp['code']) === 3)
+            elseif ($resp['code'] === '3')
             {
-                $status = intval($resp['data']['status']);
+                $status = $resp['data']['status'];
                 if ($status === 3) {
                     Model('refill_order')->edit($refill_info['order_id'], ['official_sn' => $resp['data']['certificate']]);
                     $order_state = ORDER_STATE_SUCCESS;
-                } elseif (in_array($status, [0, 2])) {
+                } elseif (in_array($status, [0, 2], true)) {
                     $order_state = ORDER_STATE_CANCEL;
                 } elseif ($status === 1) {
                     $order_state = ORDER_STATE_SEND;
@@ -89,7 +89,7 @@ class RefillPhone extends refill\IRefillPhone
 
                 return [true, $order_state];
             }
-            elseif (intval($resp['code']) === 2) {
+            elseif ($resp['code'] === '2' && time() - $refill_info['commit_time'] > 600) {
                 return [true, ORDER_STATE_NOEXIST];
             }
             else {
@@ -111,7 +111,7 @@ class RefillPhone extends refill\IRefillPhone
         $resp = json_decode($resp, true);
         if (empty($resp)) {
             return [false, '系统错误'];
-        } elseif (intval($resp['code']) === 3) {
+        } elseif ($resp['code'] === '3') {
             return [true, $resp['data']['money']];
         } else {
             return [false, $resp['msg']];

+ 46 - 0
helper/refill/api/xyz/huafutongman/RefillCallBack.php

@@ -0,0 +1,46 @@
+<?php
+namespace refill\huafutongman;
+
+require_once(BASE_HELPER_RAPI_PATH . '/huafutongman/config.php');
+
+use refill;
+class RefillCallBack implements refill\IRefillCallBack
+{
+    public function verify($params): bool
+    {
+        return true;
+    }
+
+    public function aes_decrypt($data)
+    {
+        $data = str_replace(' ','+',$data);
+        $data = base64_decode($data);
+        $data = openssl_decrypt($data, 'AES-128-CBC', config::UserKey, OPENSSL_NO_PADDING, config::aesIV);
+        return strstr($data,'}',true) . "}";
+    }
+
+    public function notify($params)
+    {
+        $decrypt = $this->aes_decrypt($params['PostData']);
+        $data = json_decode($decrypt, true);
+
+        $status = intval($data['Status']);
+        $order_sn = $data['OrderNo'];
+        $order_info = Model('vr_order')->getOrderInfo(['order_sn' => $order_sn]);
+        if (empty($order_info)) {
+            return [false, false, false,false];
+        }
+        $order_id = $order_info['order_id'];
+
+        if ($status === 3) {
+            Model('refill_order')->edit($order_id, ['official_sn' => $data['OperatorSerialNumber']]);
+            return [$order_id, true, false,true];
+        }
+        elseif (in_array($status, [0, 2])) {
+            return [$order_id, false, true,true];
+        }
+        else {
+            return [$order_id, false, false,false];
+        }
+    }
+}

+ 126 - 0
helper/refill/api/xyz/huafutongman/RefillPhone.php

@@ -0,0 +1,126 @@
+<?php
+
+namespace refill\huafutongman;
+
+require_once(BASE_HELPER_RAPI_PATH . '/huafutongman/config.php');
+
+use refill;
+use Log;
+
+class RefillPhone extends refill\IRefillPhone
+{
+    public function __construct($cfgs)
+    {
+        parent::__construct($cfgs);
+    }
+
+    private function req_params(int $phone, int $card_type, int $amount, string $order_sn)
+    {
+        $data['ChargeAccount'] = $phone;
+        $data['SupBuyNum'] = 1;
+        $data['ChargeValue'] = $amount;
+        $data['OrderType'] = 1;
+        $data['ChargeType'] = config::operator[$card_type];
+        $data['Id'] = $order_sn;
+
+        $params['mchid'] = config::MCH_ID;
+        $params['notifyurl'] = config::NOTIFY_URL;
+        $params['data'] = $this->aes_encrypt($data);
+        return $params;
+    }
+
+    public function add($card_no, $card_type, $amount, $params,&$net_errno = 0)
+    {
+        $params = $this->req_params($card_no, $card_type, $amount, $params['order_sn']);
+
+        $resp = http_request(config::ORDER_URL, $params, 'POST', false, config::ExtHeaders, $net_errno);
+
+        if (empty($resp)) {
+            return [false, '系统错误', true];
+        }
+        else
+        {
+            Log::record($resp, Log::DEBUG);
+            $resp = json_decode($resp, true);
+            if (empty($resp)) {
+                return [false, '系统错误', true];
+            } elseif ($resp['code'] === 'success') {
+                return [true, $resp['data']['trans_sn'], false];
+            } else {
+                return [false, $resp['msg'], false];
+            }
+        }
+    }
+
+    public function query($refill_info)
+    {
+        $params['mchid'] = config::MCH_ID;
+        $params['order_id'] = $refill_info['order_sn'];
+        $params['time'] = time();
+        $content = "{$params['mchid']}{$params['order_id']}{$params['time']}".config::UserKey;
+        $params['sign'] =md5($content) ;
+
+        $resp = http_request(config::QUERY_URL, $params, 'POST', false, config::ExtHeaders);
+
+        if (empty($resp)) {
+            return [false, '系统错误'];
+        }
+        else
+        {
+            Log::record($resp, Log::DEBUG);
+            $resp = json_decode($resp, true);
+
+            if (empty($resp)) {
+                return [false, '系统错误'];
+            }
+            elseif ($resp['code'] === '3')
+            {
+                $status = $resp['data']['status'];
+                if ($status === 3) {
+                    Model('refill_order')->edit($refill_info['order_id'], ['official_sn' => $resp['data']['certificate']]);
+                    $order_state = ORDER_STATE_SUCCESS;
+                } elseif (in_array($status, [0, 2], true)) {
+                    $order_state = ORDER_STATE_CANCEL;
+                } elseif ($status === 1) {
+                    $order_state = ORDER_STATE_SEND;
+                } else {
+                    return [false, $status];
+                }
+
+                return [true, $order_state];
+            }
+            elseif ($resp['code'] === '2' && time() - $refill_info['commit_time'] > 600) {
+                return [true, ORDER_STATE_NOEXIST];
+            }
+            else {
+                return [false, $resp['msg']];
+            }
+        }
+    }
+
+    public function balance()
+    {
+        $params['mchid'] = config::MCH_ID;
+        $params['time'] = time();
+        $content = "{$params['mchid']}{$params['time']}".config::UserKey;
+        $params['sign'] =md5($content) ;
+
+        $resp = http_request(config::BALANCE_URL, $params, 'POST', false, config::ExtHeaders);
+
+        Log::record($resp, Log::DEBUG);
+        $resp = json_decode($resp, true);
+        if (empty($resp)) {
+            return [false, '系统错误'];
+        } elseif ($resp['code'] === '3') {
+            return [true, $resp['data']['money']];
+        } else {
+            return [false, $resp['msg']];
+        }
+    }
+
+    private function aes_encrypt($params): string
+    {
+        $encrypt = json_encode($params);
+        return base64_encode(openssl_encrypt($encrypt, 'AES-128-CBC', config::UserKey, OPENSSL_RAW_DATA, config::aesIV));
+    }
+}

+ 25 - 0
helper/refill/api/xyz/huafutongman/config.php

@@ -0,0 +1,25 @@
+<?php
+
+
+namespace refill\huafutongman;
+
+use mtopcard;
+class config
+{
+    const ORDER_URL = 'http://me.sd.7080.cn:8080/?c=pay&m=create';
+    const QUERY_URL= 'http://api.sd.7080.cn:8080/?m=querys&a=queryorder';
+    const BALANCE_URL = 'http://api.sd.7080.cn:8080/?m=querys&a=querymoney';
+
+    const MCH_ID = '204';
+    const UserKey = 'e9e288235c1373a2';     #正式key
+
+    const aesIV = '1111111111111111';
+    const NOTIFY_URL = BASE_SITE_URL . "/mobile/callback/refill_huafutongman.php";
+    const ExtHeaders = ['Content-Type:application/x-www-form-urlencoded;charset=utf-8'];
+
+    const operator = [
+        mtopcard\ChinaMobileCard => 3,
+        mtopcard\ChinaUnicomCard => 1,
+        mtopcard\ChinaTelecomCard => 2
+    ];
+}

+ 6 - 0
helper/refill/api/xyz/huafutongman/商户信息.txt

@@ -0,0 +1,6 @@
+后台登入地址:http://me.sd.7080.cn/
+登入账号:yezimanchong
+登入密码:yezi123
+商户号ID: 204
+商户APIKEY秘钥:e9e288235c1373a2
+安全码: yezi123

二进制
helper/refill/api/xyz/huafutongman/对接文档new.docx


+ 2 - 2
helper/refill/api/xyz/jinfeng/RefillPhone.php

@@ -85,8 +85,8 @@ class RefillPhone extends refill\IRefillPhone
             {
                 if ($status === '026')
                 {
-                    //订单不存在状态,三小时内查询可失败,超过则返回充值中
-                    if (time() - $refill_info['commit_time'] <= 10800) {
+                    //订单不存在状态,三小时内查询可失败,超过则返回充值中.不可以在下单后的同时立马发起查询,否则返回该状态处理为充值中,至少隔30秒以上再发起查询
+                    if (time() - $refill_info['commit_time'] <= 10800 && time() - $refill_info['commit_time'] >= 30) {
                         $order_state = ORDER_STATE_CANCEL;
                     } else {
                         $order_state = ORDER_STATE_SEND;

+ 1 - 1
helper/refill/api/xyz/jinxin/RefillPhone.php

@@ -50,7 +50,7 @@ class RefillPhone extends refill\IRefillPhone
                 return [true, $resp['data']['orderNo'], false];
             } elseif ($resp['code'] === '9999') {
                 $net_errno = '9999';
-                return [false, $resp['msg'], false];
+                return [false, $resp['msg'], true];
             } else {
                 return [false, $resp['msg'], false];
             }

+ 12 - 0
helper/refill/api/xyz/jumithird/RefillPhone.php

@@ -43,6 +43,17 @@ class RefillPhone extends refill\IRefillPhone
         }
     }
 
+    private function getProductAmount($sys_pcode)
+    {
+        $thrid_refill = Model('thrid_refill');
+        $product = $thrid_refill->getProduct(['system_code' => $sys_pcode]);
+        if (empty($product)) {
+            return false;
+        } else {
+            return $product['refill_amount'];
+        }
+    }
+
     private function req_params(int $phone, int $amount, string $order_sn, string $product_code)
     {
         $params['mch_no'] = config::MCH_ID;
@@ -61,6 +72,7 @@ class RefillPhone extends refill\IRefillPhone
         $goods_id = intval($params['goods_id']);
         $product_code = $this->getProductCode($goods_id, $params['product_code']);
 
+        $amount = $this->getProductAmount($params['product_code']);
         $params = $this->req_params($card_no, $amount, $order_sn, $product_code);
         $sign = $this->sign($params);
         $params['sign'] = $sign;

+ 2 - 2
helper/refill/api/xyz/kachong/RefillPhone.php

@@ -54,11 +54,11 @@ class RefillPhone extends refill\IRefillPhone
                 return [false, $resp['szRtnCode'], false];
             } elseif (in_array($nRtn, [2050, 999])) {
                 $net_errno = "HTTP-{$nRtn}";
-                return [false, $resp['szRtnCode'], false];
+                return [false, $resp['szRtnCode'], true];
             } else {
                 $err = 998;
                 $net_errno = "HTTP-{$err}";
-                return [false, $resp['szRtnCode'], false];
+                return [false, $resp['szRtnCode'], true];
             }
         }
     }

+ 1 - 1
helper/refill/api/xyz/kangkai/RefillPhone.php

@@ -91,7 +91,7 @@ class RefillPhone extends refill\IRefillPhone
                 return [true, $resp['TaskID'], false];
             } elseif ($resp['Code'] == 999) {
                 $net_errno = "HTTP-999";
-                return [false, $resp['Message'], false];
+                return [false, $resp['Message'], true];
             } else {
                 return [false, $resp['Message'], false];
             }

+ 1 - 1
helper/refill/api/xyz/lechong/RefillPhone.php

@@ -56,7 +56,7 @@ class RefillPhone extends refill\IRefillPhone
                 return [true, '', false];
             } elseif (in_array($recode, ['s115', 's116'])) {
                 $net_errno = "HTTP-{$recode}";
-                return [false, $resp['msg'], false];
+                return [false, $resp['msg'], true];
             } else {
                 return [false, $resp['msg'], false];
             }

+ 2 - 2
helper/refill/api/xyz/lingzhman/RefillPhone.php

@@ -85,8 +85,8 @@ class RefillPhone extends refill\IRefillPhone
             {
                 if ($status === '026')
                 {
-                    //订单不存在状态,三小时内查询可失败,超过则返回充值中
-                    if (time() - $refill_info['commit_time'] <= 10800) {
+                    //订单不存在状态,三小时内查询可失败,超过则返回充值中.不可以在下单后的同时立马发起查询,否则返回该状态处理充值中,至少延迟10秒以上再发起查询
+                    if (time() - $refill_info['commit_time'] <= 10800 && time() - $refill_info['commit_time'] >= 10) {
                         $order_state = ORDER_STATE_CANCEL;
                     } else {
                         $order_state = ORDER_STATE_SEND;

+ 2 - 2
helper/refill/api/xyz/lingzhman48/RefillPhone.php

@@ -84,8 +84,8 @@ class RefillPhone extends refill\IRefillPhone
             {
                 if ($status === '026')
                 {
-                    //订单不存在状态,三小时内查询可失败,超过则返回充值中
-                    if (time() - $refill_info['commit_time'] <= 3600 * 3) {
+                    //订单不存在状态,三小时内查询可失败,超过则返回充值中.不可以在下单后的同时立马发起查询,否则返回该状态处理充值中,至少延迟10秒以上再发起查询
+                    if (time() - $refill_info['commit_time'] <= 10800 && time() - $refill_info['commit_time'] >= 10) {
                         $order_state = ORDER_STATE_CANCEL;
                     } else {
                         $order_state = ORDER_STATE_SEND;

+ 34 - 0
helper/refill/api/xyz/linzhu/RefillCallBack.php

@@ -0,0 +1,34 @@
+<?php
+namespace refill\linzhu;
+require_once(BASE_HELPER_RAPI_PATH . '/linzhu/config.php');
+
+use refill;
+class RefillCallBack implements refill\IRefillCallBack
+{
+    public function verify($params): bool
+    {
+       return true;
+    }
+
+    public function notify($params)
+    {
+        $status = $params['status'];
+        $order_sn = $params['consumerNo'];
+
+        $order_info = Model('vr_order')->getOrderInfo(['order_sn' => $order_sn]);
+        if (empty($order_info)) {
+            return [false, false, false,false];
+        }
+
+        $order_id = $order_info['order_id'];
+        if ($status === '001') {
+            $data['official_sn'] = strtolower($params['voucherNo']) == 'null' ? '' : $params['voucherNo'];
+            Model('refill_order')->edit($order_id, $data);
+            return [$order_id, true, false, true];
+        } elseif (in_array($status,config::NotifyErrCodes)) {
+            return [$order_id, false, true, true];
+        } else {
+            return [$order_id, false, false, false];
+        }
+    }
+}

+ 146 - 0
helper/refill/api/xyz/linzhu/RefillPhone.php

@@ -0,0 +1,146 @@
+<?php
+
+namespace refill\linzhu;
+
+require_once(BASE_HELPER_RAPI_PATH . '/linzhu/config.php');
+
+use refill;
+use Log;
+
+class RefillPhone extends refill\IRefillPhone
+{
+    public function __construct($cfgs)
+    {
+        parent::__construct($cfgs);
+    }
+
+    private function req_params(int $phone, string $order_sn)
+    {
+        $params['account'] = config::ACCOUNT;
+        $params['consumerNo'] = $order_sn;
+        $params['mobile'] = $phone;
+        $params['timestamp'] = date("YmdHis");
+
+        return $params;
+    }
+
+    public function add($card_no, $card_type, $amount, $params,&$net_errno = 0)
+    {
+        $params = $this->req_params($card_no, $params['order_sn']);
+        $params['flowCode'] = config::ProductIDS[$card_type][$amount];
+        if (empty($params['flowCode'])) {
+            return [false, '产品编号错误', false];
+        }
+
+        $sign = $this->sign($params);
+        $params['sign'] = $sign;
+
+        $resp = http_request(config::ORDER_URL, $params, 'GET', false, [], $net_errno);
+
+        if (empty($resp)) {
+            return [false, '系统错误', true];
+        }
+        else
+        {
+            Log::record($resp, Log::DEBUG);
+            $resp = json_decode($resp ,true);
+
+            if (empty($resp)) {
+                return [false, '系统错误', true];
+            } elseif ($resp['status'] === '001') {
+                return [true, $resp['orderNo'], false];
+            } else {
+                return [false, $resp['status'], false];
+            }
+        }
+    }
+
+    public function query($refill_info)
+    {
+        $params['account'] = config::ACCOUNT;
+        $params['consumerNo'] = $refill_info['order_sn'];
+        $params['timestamp'] = date("YmdHis");
+        $params['sign'] = $this->sign($params);
+
+        $resp = http_request(config::QUERY_URL, $params);
+        if (empty($resp)) {
+            return [false, '系统错误'];
+        }
+        else
+        {
+            Log::record($resp, Log::DEBUG);
+            $resp = json_decode($resp, true);
+            if (empty($resp)) {
+                return [false, '系统错误'];
+            }
+
+            $status = $resp['status'];
+            if ($status === '001')
+            {
+                $order_state = ORDER_STATE_SUCCESS;
+                $save['official_sn'] = strtolower($resp['voucherNo']) == 'null' ? '' : $resp['voucherNo'];
+                Model('refill_order')->edit($refill_info['order_id'], $save);
+            }
+            elseif (in_array($status,config::QueryErrCodes))
+            {
+                if ($status === '026')
+                {
+                    //订单不存在状态,三小时内查询可失败,超过则返回充值中.不可以在下单后的同时立马发起查询,否则返回该状态处理为充值中,至少隔30秒以上再发起查询
+                    if (time() - $refill_info['commit_time'] <= 10800 && time() - $refill_info['commit_time'] >= 30) {
+                        $order_state = ORDER_STATE_CANCEL;
+                    } else {
+                        $order_state = ORDER_STATE_SEND;
+                    }
+                }
+                else {
+                    $order_state = ORDER_STATE_CANCEL;
+                }
+            }
+            elseif ($status === '002') {
+                $order_state = ORDER_STATE_SEND;
+            }
+            else {
+                return [false, $status];
+            }
+
+            return [true, $order_state];
+        }
+    }
+
+    public function balance()
+    {
+        $params['account'] = config::ACCOUNT;
+        $params['timestamp'] = date("YmdHis");
+        $params['sign'] = $this->sign($params);
+
+        $resp = http_request(config::BALANCE_URL, $params);
+        if (empty($resp)) {
+            return [false, '系统错误'];
+        }
+        else
+        {
+            Log::record($resp, Log::DEBUG);
+            $resp = json_decode($resp, true);
+            if (empty($resp)) {
+                return [false, '系统错误'];
+            } elseif ($resp['status'] === 'success') {
+                return [true, $resp['balance']];
+            } else {
+                return [false, $resp['descriptor']];
+            }
+        }
+    }
+
+    private function sign($params)
+    {
+        $data['account'] = $params['account'];
+        $data['timestamp'] = $params['timestamp'];
+        $data['secret'] = config::KEY;
+        asort($data);
+        $content = '';
+        foreach ($data as $val){
+            $content .= $val;
+        }
+        return sha1($content);
+    }
+}

+ 36 - 0
helper/refill/api/xyz/linzhu/config.php

@@ -0,0 +1,36 @@
+<?php
+
+
+namespace refill\linzhu;
+use mtopcard;
+
+class config
+{
+    //回调地址需配置
+    const ORDER_URL = 'http://47.99.65.204/flow-receiver/fee/recharge';
+    const QUERY_URL = 'http://47.99.65.204/flow-receiver/fee/query/single';
+    const BALANCE_URL = 'http://47.99.65.204/flow-receiver/fee/balance/query';
+    const NOTIFY_URL = BASE_SITE_URL . '/mobile/callback/refill_linzhu.php';
+    const ACCOUNT = 'yezi';
+    const KEY = '507951e1ce694d94a3a22e4d44a777a7';
+
+    const ProductIDS = [
+        mtopcard\ChinaMobileCard => [
+            30 => 'CMCCALLr30r', 50 => 'CMCCALLr50r', 100 => 'CMCCALLr100r', 200 => 'CMCCALLr200r'
+        ],
+        mtopcard\ChinaUnicomCard => [
+            30 => 'CUCCALLr30r', 50 => 'CUCCALLr50r', 100 => 'CUCCALLr100r', 200 => 'CUCCALLr200r'
+        ],
+        mtopcard\ChinaTelecomCard => [
+            30 => 'CTCCALLr30r', 50 => 'CTCCALLr50r', 100 => 'CTCCALLr100r', 200 => 'CTCCALLr200r'
+        ]
+    ];
+
+    const NotifyErrCodes = [
+        '003','004','005','006','007','008','015','016','017','018','019','020','021','022','023','025','027','028','098','099'
+    ];
+
+    const QueryErrCodes = [
+        '003','004','005','006','007','008','015','016','017','018','019','020','021','022','023','024','025','026','027','028','098','099'
+    ];
+}

+ 32 - 0
helper/refill/api/xyz/linzhu/椰子.txt

@@ -0,0 +1,32 @@
+梖瘍		yezi
+躇鎢		123456
+躇埥		507951e1ce694d94a3a22e4d44a777a7
+
+
+狟等華硊
+http://47.99.65.204/flow-receiver/fee/recharge
+等跺脤戙華硊
+http://47.99.65.204/flow-receiver/fee/query/single
+豻塗脤戙華硊
+http://47.99.65.204/flow-receiver/fee/balance/query
+
+
+痄雄辦喃莉ⅲ晤鎢		醱硉
+CMCCALLr30r				30	
+CMCCALLr50r				50	
+CMCCALLr100r			100	
+CMCCALLr200r			200	
+
+
+薊籵辦喃莉ⅲ晤鎢		醱硉
+CUCCALLr30r				30	
+CUCCALLr50r				50	
+CUCCALLr100r			100	
+CUCCALLr200r			200	
+
+
+萇陓辦喃莉ⅲ晤鎢		醱硉
+CTCCALLr30r				30
+CTCCALLr50r				50
+CTCCALLr100r			100
+CTCCALLr200r			200

文件差异内容过多而无法显示
+ 3 - 0
helper/refill/api/xyz/linzhu/话费充值接口v1.1.doc


+ 1 - 1
helper/refill/api/xyz/menggu/RefillOil.php

@@ -52,7 +52,7 @@ class RefillOil extends refill\IRefillOil
                 return [true, $resp['orderId'], false];
             } elseif (in_array($resp['code'], [-22, -23, -99])) {
                 $net_errno = "HTTP-{$resp['code']}";
-                return [false, $resp['msg'], false];
+                return [false, $resp['msg'], true];
             } else {
                 return [false, $resp['msg'], false];
             }

+ 1 - 1
helper/refill/api/xyz/menggu_hf/RefillPhone.php

@@ -52,7 +52,7 @@ class RefillPhone extends refill\IRefillPhone
                 return [true, $resp['orderId'], false];
             } elseif (in_array($resp['code'], [-22, -23, -99])) {
                 $net_errno = "HTTP-{$resp['code']}";
-                return [false, $resp['msg'], false];
+                return [false, $resp['msg'], true];
             } else {
                 return [false, $resp['msg'], false];
             }

+ 2 - 2
helper/refill/api/xyz/miaoxt/RefillPhone.php

@@ -55,11 +55,11 @@ class RefillPhone extends refill\IRefillPhone
                 return [false, $resp['szRtnCode'], false];
             } elseif (in_array($nRtn, [2050, 999])) {
                 $net_errno = "HTTP-{$nRtn}";
-                return [false, $resp['szRtnCode'], false];
+                return [false, $resp['szRtnCode'], true];
             } else {
                 $err = 998;
                 $net_errno = "HTTP-{$err}";
-                return [false, $resp['szRtnCode'], false];
+                return [false, $resp['szRtnCode'], true];
             }
         }
     }

+ 2 - 2
helper/refill/api/xyz/miaoxt_fs/RefillPhone.php

@@ -69,11 +69,11 @@ class RefillPhone extends refill\IRefillPhone
                 return [false, $resp['szRtnCode'], false];
             } elseif (in_array($nRtn, [2050, 999])) {
                 $net_errno = "HTTP-{$nRtn}";
-                return [false, $resp['szRtnCode'], false];
+                return [false, $resp['szRtnCode'], true];
             } else {
                 $err = 998;
                 $net_errno = "HTTP-{$err}";
-                return [false, $resp['szRtnCode'], false];
+                return [false, $resp['szRtnCode'], true];
             }
         }
     }

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

@@ -30,7 +30,7 @@ class RefillCallBack implements refill\IRefillCallBack
             $data['official_sn'] = strtolower($params['voucherNo']) == 'null' ? '' : $params['voucherNo'];
             Model('refill_order')->edit($order_id, $data);
             return [$order_id, true, false, true];
-        } elseif (in_array($status,config::NotifyErrCodes)) {
+        } elseif (in_array($status,config::NotifyErrCodes, true)) {
             return [$order_id, false, true, true];
         } else {
             return [$order_id, false, false, false];

+ 1 - 1
helper/refill/api/xyz/qianqian/RefillPhone.php

@@ -81,7 +81,7 @@ class RefillPhone extends refill\IRefillPhone
                 $save['official_sn'] = strtolower($resp['voucherNo']) == 'null' ? '' : $resp['voucherNo'];
                 Model('refill_order')->edit($refill_info['order_id'], $save);
             }
-            elseif (in_array($status,config::QueryErrCodes))
+            elseif (in_array($status,config::QueryErrCodes, true))
             {
                 if ($status === '026')
                 {

+ 2 - 2
helper/refill/api/xyz/qijutang/RefillPhone.php

@@ -55,11 +55,11 @@ class RefillPhone extends refill\IRefillPhone
                 return [false, $resp['szRtnCode'], false];
             } elseif (in_array($nRtn, [2050, 999], true)) {
                 $net_errno = "HTTP-{$nRtn}";
-                return [false, $resp['szRtnCode'], false];
+                return [false, $resp['szRtnCode'], true];
             } else {
                 $err = 998;
                 $net_errno = "HTTP-{$err}";
-                return [false, $resp['szRtnCode'], false];
+                return [false, $resp['szRtnCode'], true];
             }
         }
     }

+ 1 - 1
helper/refill/api/xyz/shimier/RefillPhone.php

@@ -52,7 +52,7 @@ class RefillPhone extends refill\IRefillPhone
                 return [true, $resp['orderId'], false];
             } elseif (in_array($resp['code'], [-22, -23, -99])) {
                 $net_errno = "HTTP-{$resp['code']}";
-                return [false, $resp['msg'], false];
+                return [false, $resp['msg'], true];
             } else {
                 return [false, $resp['msg'], false];
             }

+ 143 - 128
helper/refill/api/xyz/shuoruan/RefillPhone.php

@@ -1,129 +1,144 @@
-<?php
-
-namespace refill\shuoruan;
-
-require_once(BASE_HELPER_RAPI_PATH . '/shuoruan/config.php');
-
-use refill;
-use Log;
-
-class RefillPhone extends refill\IRefillPhone
-{
-    public function __construct($cfgs)
-    {
-        parent::__construct($cfgs);
-    }
-
-    //统一请求
-    private function url_request($params, $action)
-    {
-        $params['action'] = $action;
-        $sign = $this->sign($params);
-        $params['sign'] = $sign;
-        $params['agentAccount'] = config::ACCOUNT;
-        $params = json_encode($params);
-
-        $url = config::API_URL;
-        return http_post_data($url, $params, config::ExtHeaders, $net_errno);
-    }
-
-    private function req_params(int $phone,int $amount, string $order_sn)
-    {
-        $params['orderId'] = $order_sn;
-        $params['chargeAcct'] = $phone;
-        $params['chargeCash'] = $amount;
-        $params['chargeType'] = 0;
-        $params['retUrl'] = urlencode(config::NOTIFY_URL);
-        return $params;
-    }
-
-    public function add($card_no, $card_type, $amount, $params,&$net_errno = 0)
-    {
-        $params = $this->req_params($card_no, $amount, $params['order_sn']);
-        $resp = $this->url_request($params,'CZ');
-
-        if (empty($resp)) {
-            return [false, '系统错误', true];
-        }
-        else
-        {
-            Log::record($resp, Log::DEBUG);
-            $resp = json_decode($resp, true);
-            if (empty($resp)) {
-                return [false, '系统错误', true];
-            } elseif (intval($resp['errorCode']) === 1) {
-                return [true, $resp['chargeId'], false];
-            } elseif (in_array($resp['errorCode'], [-992, -993, -994, -995, -996, -997, -998])) {
-                $net_errno = $resp['errorCode'];
-                return [false, $resp['errorDesc'], false];
-            } else {
-                return [false, $resp['errorDesc'], false];
-            }
-        }
-    }
-
-    public function query($refill_info)
-    {
-        $resp = $this->url_request($refill_info['order_sn'],'CX');
-
-        if (empty($resp)) {
-            return [false, '系统错误'];
-        }
-        else
-        {
-            Log::record($resp, Log::DEBUG);
-            $resp = json_decode($resp, true);
-
-            if (empty($resp)) {
-                return [false, '系统错误'];
-            } elseif (intval($resp['errorCode']) === 1) {
-                $status = $resp['orderStatuInt'];
-                if (in_array($status, [11, 16])) {
-                    $updata['official_sn'] = $resp['transo'];
-                    Model('refill_order')->edit($refill_info['order_id'], $updata);
-                    $order_state = ORDER_STATE_SUCCESS;
-                } elseif (in_array($status, [20, 21, 26])) {
-                    $order_state = ORDER_STATE_CANCEL;
-                } elseif (in_array($status, [0, 1, 2, 6])) {
-                    $order_state = ORDER_STATE_SEND;
-                } else {
-                    return [false, $resp['errorDesc']];
-                }
-                return [true, $order_state];
-            } elseif (intval($resp['errorCode']) === -201 && (time() - $refill_info['commit_time'] >= 180)) {
-                return [true, ORDER_STATE_NOEXIST];
-            } else {
-                return [false, $resp['errorDesc']];
-            }
-        }
-    }
-
-    public function balance()
-    {
-        $resp = $this->url_request([],'YE');
-
-        if (empty($resp)) {
-            return [false, '系统错误'];
-        }
-        else
-        {
-            Log::record($resp, Log::DEBUG);
-            $resp = json_decode($resp, true);
-
-            if (empty($resp)) {
-                return [false, '系统错误'];
-            } elseif (intval($resp['errorCode']) === 1) {
-                return [true, $resp['agentBalance']];
-            } else {
-                return [false, $resp['errorDesc']];
-            }
-        }
-    }
-
-    private function sign($params)
-    {
-        $json_str = json_encode($params);
-        $content  = $json_str . config::KEY;
-        return md5($content);
-    }
+<?php
+
+namespace refill\shuoruan;
+
+require_once(BASE_HELPER_RAPI_PATH . '/shuoruan/config.php');
+
+use refill;
+use Log;
+
+class RefillPhone extends refill\IRefillPhone
+{
+    public function __construct($cfgs)
+    {
+        parent::__construct($cfgs);
+    }
+
+    private function pack_params($params)
+    {
+        $json_str = json_encode($params);
+        $content  = $json_str . config::KEY;
+        $content = md5($content);
+
+        $req = [];
+        $req['sign'] = $content;
+        $req['agentAccount'] = config::ACCOUNT;
+        $req['busiBody'] = $params;
+        return json_encode($req);
+    }
+
+    public function add($card_no, $card_type, $amount, $params,&$net_errno = 0)
+    {
+        $params_getter = function ($order_sn,$phone,$amount) {
+            $params = [];
+            $params['orderId'] = $order_sn;
+            $params['chargeAcct'] = $phone;
+            $params['chargeCash'] = $amount;
+            $params['chargeType'] = 0;
+            $params['retUrl'] = urlencode(config::NOTIFY_URL);
+            $params['action'] = 'CZ';
+
+            return $params;
+        };
+
+        $params = $params_getter($params['order_sn'], $card_no, $amount);
+        $body = $this->pack_params($params);
+
+        $resp = http_post_data(config::API_URL, $body, config::ExtHeaders, $net_errno);
+        $resp = iconv('GB2312', 'UTF-8', $resp);
+
+        if (empty($resp)) {
+            return [false, '系统错误', true];
+        }
+        else
+        {
+            Log::record($resp, Log::DEBUG);
+            $resp = json_decode($resp, true);
+            if (empty($resp)) {
+                return [false, '系统错误', true];
+            } elseif ($resp['errorCode'] === 1) {
+                return [true, $resp['chargeId'], false];
+            } elseif (in_array($resp['errorCode'], [-992, -993, -994, -995, -996, -997, -998], true)) {
+                $net_errno = $resp['errorCode'];
+                return [false, $resp['errorDesc'], true];
+            } else {
+                return [false, $resp['errorDesc'], false];
+            }
+        }
+    }
+
+    public function query($refill_info)
+    {
+        $params_getter = function ($order_sn) {
+            $params = [];
+            $params['orderId'] = $order_sn;
+            $params['action'] = 'CX';
+            return $params;
+        };
+
+        $params = $params_getter($refill_info['order_sn']);
+        $body = $this->pack_params($params);
+        $resp = http_post_data(config::API_URL, $body, config::ExtHeaders, $net_errno);
+        $resp = iconv('GB2312', 'UTF-8', $resp);
+
+        if (empty($resp)) {
+            return [false, '系统错误'];
+        }
+        else
+        {
+            Log::record($resp, Log::DEBUG);
+            $resp = json_decode($resp, true);
+
+            if (empty($resp)) {
+                return [false, '系统错误'];
+            } elseif ($resp['errorCode'] === 1) {
+                $status = $resp['orderStatuInt'];
+                if (in_array($status, ['11', '16'], true)) {
+                    $order_state = ORDER_STATE_SUCCESS;
+                } elseif (in_array($status, ['20', '21', '26'], true)) {
+                    $order_state = ORDER_STATE_CANCEL;
+                } elseif (in_array($status, ['0', '1', '2', '6'], true)) {
+                    $order_state = ORDER_STATE_SEND;
+                } else {
+                    return [false, $resp['errorDesc']];
+                }
+                return [true, $order_state];
+            } elseif ($resp['errorCode'] === -201 && (time() - $refill_info['commit_time'] >= 180)) {
+                return [true, ORDER_STATE_NOEXIST];
+            } else {
+                return [false, $resp['errorDesc']];
+            }
+        }
+    }
+
+    public function balance()
+    {
+        $params_getter = function () {
+            $params['action'] = 'YE';
+            return $params;
+        };
+
+        $params = $params_getter();
+        $body = $this->pack_params($params);
+
+        $resp = http_post_data(config::API_URL, $body, config::ExtHeaders, $net_errno);
+        $resp = iconv('GB2312', 'UTF-8', $resp);
+
+        if (empty($resp)) {
+            return [false, '系统错误'];
+        }
+        else
+        {
+            Log::record($resp, Log::DEBUG);
+            $resp = json_decode($resp, true);
+
+            if (empty($resp)) {
+                return [false, '系统错误'];
+            } elseif ($resp['errorCode'] === 1) {
+                return [true, $resp['agentBalance']];
+            } else {
+                return [false, $resp['errorDesc']];
+            }
+        }
+    }
 }

+ 1 - 1
helper/refill/api/xyz/shuoruan/config.php

@@ -11,5 +11,5 @@ class config
     const ACCOUNT = '18600608333';
     const KEY = '471D690CFB902BD8';
     const NOTIFY_URL = BASE_SITE_URL . "/mobile/callback/refill_shuoruan.php";
-    const ExtHeaders = ['Content-Type: application/json'];
+    const ExtHeaders = ['Content-Type: application/json;charset=GB2312'];
 }

+ 4 - 1
helper/refill/api/xyz/shuoruan/北京椰子.txt

@@ -4,4 +4,7 @@
 开发接口资料
 接口文档网址:http://apidoc.sy666.com/web/#/3
 接口订单提交地址:
-http://api.sohan.hk:50080/API
+http://api.sohan.hk:50080/API
+
+http://oshop.sohan.hk/
+账号:18600608333

+ 2 - 2
helper/refill/api/xyz/sialan/RefillPhone.php

@@ -54,11 +54,11 @@ class RefillPhone extends refill\IRefillPhone
                 return [false, $resp['msg'], false];
             } elseif (in_array($status, [-10010, -10000, -999])) {
                 $net_errno = "HTTP-{$status}";
-                return [false, $resp['msg'], false];
+                return [false, $resp['msg'], true];
             } else {
                 $err = 998;
                 $net_errno = "HTTP-{$err}";
-                return [false, $resp['msg'], false];
+                return [false, $resp['msg'], true];
             }
         }
     }

+ 2 - 2
helper/refill/api/xyz/sialan_tax/RefillPhone.php

@@ -54,11 +54,11 @@ class RefillPhone extends refill\IRefillPhone
                 return [false, $resp['msg'], false];
             } elseif (in_array($status, [-10010, -10000, -999])) {
                 $net_errno = "HTTP-{$status}";
-                return [false, $resp['msg'], false];
+                return [false, $resp['msg'], true];
             } else {
                 $err = 998;
                 $net_errno = "HTTP-{$err}";
-                return [false, $resp['msg'], false];
+                return [false, $resp['msg'], true];
             }
         }
     }

+ 0 - 0
helper/refill/api/xyz/suyuan/RefillPhone.php


部分文件因为文件数量过多而无法显示