stanley-king hai 1 ano
pai
achega
cefaf87fe7
Modificáronse 100 ficheiros con 3140 adicións e 219 borrados
  1. 58 9
      admin/control/provider_ctl.php
  2. 131 0
      admin/control/refill_discount.php
  3. 22 4
      admin/control/refill_event.php
  4. 4 0
      admin/control/refill_order_manual.php
  5. 1 0
      admin/include/limit.php
  6. 4 3
      admin/include/menu.php
  7. 1 1
      admin/templates/default/css/recharge.css
  8. 19 0
      admin/templates/default/css/skin_1.css
  9. 2 0
      admin/templates/default/login.php
  10. 23 15
      admin/templates/default/member.index.php
  11. 53 51
      admin/templates/default/provider.amount.control.php
  12. 16 1
      admin/templates/default/refill.buyback.order.php
  13. 8 0
      admin/templates/default/refill.order.exception.php
  14. 6 0
      admin/templates/default/refill.order.monitor.notify.php
  15. 6 0
      admin/templates/default/refill.order.send.index.php
  16. 237 0
      admin/templates/default/refill_discount.add.php
  17. 240 0
      admin/templates/default/refill_discount.edit.php
  18. 253 0
      admin/templates/default/refill_discount.index.php
  19. 5 0
      admin/templates/default/refill_event.index.php
  20. 4 6
      core/framework/db/mysqli.php
  21. 1 1
      crontab/control/minutes.php
  22. 826 85
      data/config/xyz/refill.ini.php
  23. 309 15
      data/config/yl/refill.ini.php
  24. 95 0
      data/model/refill_discount.model.php
  25. 4 0
      docker/compose/homecuda/admin/docker-compose.yml
  26. 2 2
      docker/compose/homecuda/conf/php/php-swoole-debug.ini
  27. 1 1
      docker/compose/homecuda/cpenv
  28. 2 0
      docker/compose/homecuda/ibaobei/docker-compose.yml
  29. 1 1
      docker/compose/homecuda/storage/docker-compose.yml
  30. 3 2
      helper/refill/CalcMerchantPrice.php
  31. 20 3
      helper/refill/RefillBase.php
  32. 2 0
      helper/refill/XYZRefillFactory.php
  33. 11 1
      helper/refill/api/xyz/dongye/api.txt
  34. 4 4
      helper/refill/api/xyz/dongye/config.php
  35. BIN=BIN
      helper/refill/api/xyz/dunhui/20240320_yd_lt.png
  36. 37 0
      helper/refill/api/xyz/dunhui/API.MD
  37. 49 0
      helper/refill/api/xyz/dunhui/RefillCallBack.php
  38. 154 0
      helper/refill/api/xyz/dunhui/RefillPhone.php
  39. 45 0
      helper/refill/api/xyz/dunhui/config.php
  40. BIN=BIN
      helper/refill/api/xyz/guochuang/20240314_dx_shanxi.png
  41. BIN=BIN
      helper/refill/api/xyz/guochuang/20240314_yd_liaoning.jpg
  42. BIN=BIN
      helper/refill/api/xyz/guochuang/20240315_yd_guizhou.jpg
  43. BIN=BIN
      helper/refill/api/xyz/guochuang/20240316_yd_sichuan.jpg
  44. BIN=BIN
      helper/refill/api/xyz/guochuang/20240317_yd_liaoning.jpg
  45. BIN=BIN
      helper/refill/api/xyz/guochuang/20240318_yd_liaoning.png
  46. BIN=BIN
      helper/refill/api/xyz/guochuang/20240319_yd_liaoning.png
  47. BIN=BIN
      helper/refill/api/xyz/guochuang/20240320_yd_guangdong.png
  48. BIN=BIN
      helper/refill/api/xyz/guochuang/20240325_yd_shandong.jpg
  49. BIN=BIN
      helper/refill/api/xyz/guochuang/20240328_dx_shanxi.png
  50. BIN=BIN
      helper/refill/api/xyz/guochuang/20240328_yd_guangdong.png
  51. 15 14
      helper/refill/api/xyz/guochuang/config.php
  52. 0 0
      helper/refill/api/xyz/guochuang/调价函/20240101_yd_guangdong.jpg
  53. 0 0
      helper/refill/api/xyz/guochuang/调价函/20240101_yd_liaoning.jpg
  54. 0 0
      helper/refill/api/xyz/guochuang/调价函/20240102_yd_hebei.png
  55. BIN=BIN
      helper/refill/api/xyz/guochuang/调价函/20240102_yd_hebei_2.png
  56. BIN=BIN
      helper/refill/api/xyz/guochuang/调价函/20240103_yd_hebei.png
  57. BIN=BIN
      helper/refill/api/xyz/guochuang/调价函/20240103_yd_liaoning.png
  58. BIN=BIN
      helper/refill/api/xyz/guochuang/调价函/20240104_yd_liaoning.png
  59. BIN=BIN
      helper/refill/api/xyz/guochuang/调价函/20240104_yd_liaoning2.png
  60. BIN=BIN
      helper/refill/api/xyz/guochuang/调价函/20240105_yd_guangdong.png
  61. BIN=BIN
      helper/refill/api/xyz/guochuang/调价函/20240110_yd_liaoning.jpg
  62. BIN=BIN
      helper/refill/api/xyz/guochuang/调价函/20240111_dx_henan.jpg
  63. BIN=BIN
      helper/refill/api/xyz/guochuang/调价函/20240116_dx_antjln.jpg
  64. BIN=BIN
      helper/refill/api/xyz/guochuang/调价函/20240117_yd_liaoning.jpg
  65. BIN=BIN
      helper/refill/api/xyz/guochuang/调价函/20240118_yd_sc_gs.jpg
  66. BIN=BIN
      helper/refill/api/xyz/guochuang/调价函/20240119_dx_tj_ah_ln.jpg
  67. BIN=BIN
      helper/refill/api/xyz/guochuang/调价函/20240128_yd_sichuan.jpg
  68. BIN=BIN
      helper/refill/api/xyz/guochuang/调价函/20240129_yd_qinghai.png
  69. BIN=BIN
      helper/refill/api/xyz/guochuang/调价函/20240131_yd_liaoning.jpg
  70. BIN=BIN
      helper/refill/api/xyz/guochuang/调价函/20240201_dx_shanxi.jpg
  71. BIN=BIN
      helper/refill/api/xyz/guochuang/调价函/20240204_yd_liaoning.png
  72. BIN=BIN
      helper/refill/api/xyz/guochuang/调价函/20240206_yd_shanxi.jpg
  73. BIN=BIN
      helper/refill/api/xyz/guochuang/调价函/20240208_yd_shandong.jpg
  74. BIN=BIN
      helper/refill/api/xyz/guochuang/调价函/20240218_dx_qinghai.jpg
  75. BIN=BIN
      helper/refill/api/xyz/guochuang/调价函/20240218_yd_shandong.png
  76. BIN=BIN
      helper/refill/api/xyz/guochuang/调价函/20240219_yd_guangdong.jpg
  77. BIN=BIN
      helper/refill/api/xyz/guochuang/调价函/20240220_yd_guangdong.jpg
  78. BIN=BIN
      helper/refill/api/xyz/guochuang/调价函/20240220_yd_hebei.jpg
  79. BIN=BIN
      helper/refill/api/xyz/guochuang/调价函/20240221_yd_shanxi.jpg
  80. BIN=BIN
      helper/refill/api/xyz/guochuang/调价函/20240222_dx_shanxi.jpg
  81. BIN=BIN
      helper/refill/api/xyz/guochuang/调价函/20240222_yd_liaoning.jpg
  82. BIN=BIN
      helper/refill/api/xyz/guochuang/调价函/20240222_yd_shandong.jpg
  83. BIN=BIN
      helper/refill/api/xyz/guochuang/调价函/20240226_yd_liaoning_guangdong.jpg
  84. BIN=BIN
      helper/refill/api/xyz/guochuang/调价函/20240226_yd_shandong.jpg
  85. BIN=BIN
      helper/refill/api/xyz/guochuang/调价函/20240226_yd_sichuan.png
  86. BIN=BIN
      helper/refill/api/xyz/guochuang/调价函/20240227_yd_guizhou.jpg
  87. BIN=BIN
      helper/refill/api/xyz/guochuang/调价函/20240228_dx_anhui.jpg
  88. BIN=BIN
      helper/refill/api/xyz/guochuang/调价函/20240303_yd_guizhou.jpg
  89. BIN=BIN
      helper/refill/api/xyz/guochuang/调价函/20240305_yd_guizhou.jpg
  90. BIN=BIN
      helper/refill/api/xyz/guochuang/调价函/20240305_yd_shandong.jpg
  91. BIN=BIN
      helper/refill/api/xyz/guochuang/调价函/20240313_yd_liaoning.png
  92. BIN=BIN
      helper/refill/api/xyz/guochuang/调价函/20240313_yd_shandong.png
  93. 24 0
      helper/refill/api/xyz/huifen_fast/API.MD
  94. 40 0
      helper/refill/api/xyz/huifen_fast/RefillCallBack.php
  95. 154 0
      helper/refill/api/xyz/huifen_fast/RefillPhone.php
  96. 50 0
      helper/refill/api/xyz/huifen_fast/config.php
  97. 12 0
      helper/refill/api/xyz/kachong_new/API.MD
  98. 49 0
      helper/refill/api/xyz/kachong_new/RefillCallBack.php
  99. 137 0
      helper/refill/api/xyz/kachong_new/RefillPhone.php
  100. 0 0
      helper/refill/api/xyz/kachong_new/config.php

+ 58 - 9
admin/control/provider_ctl.php

@@ -8,6 +8,45 @@ class provider_ctlControl extends SystemControl
         parent::__construct();
     }
 
+    private function save_channel_speeds($ch_speeds, $providers)
+    {
+        $all_ch_speeds = rkcachex('channel_speeds', 'refill-');
+        if ($all_ch_speeds === false) {
+            $all_ch_speeds = [];
+        } else {
+            $all_ch_speeds = json_decode($all_ch_speeds, true);
+        }
+
+        foreach ($ch_speeds as $item)
+        {
+            [$pid, $speed] = explode('#', $item);
+
+            $provider = $providers[$pid] ?? [];
+            if (empty($provider)) {
+                continue;
+            }
+
+            $ch_name = $provider['name'];
+            if (!empty($ch_name)) {
+                $all_ch_speeds[$ch_name] = intval($speed);
+            }
+        }
+
+        wkcachex('channel_speeds', json_encode($all_ch_speeds), 'refill-');
+    }
+
+    private function read_channel_speeds()
+    {
+        $all_ch_speeds = rkcachex('channel_speeds', 'refill-');
+        if ($all_ch_speeds === false) {
+            $all_ch_speeds = [];
+        } else {
+            $all_ch_speeds = json_decode($all_ch_speeds, true);
+        }
+
+        return $all_ch_speeds;
+    }
+
     public function indexOp()
     {
         $type = $_GET['type'] ?? $_POST['type'];
@@ -16,12 +55,14 @@ class provider_ctlControl extends SystemControl
         if(empty($form)) $form = 'common';
         $rkey = $this->speed_key($type, $form);
         $quality = [
-            'common' => refill\Quality::Normal, 'fast' => refill\Quality::Quick, 'card' => refill\Quality::CardKey,
-            'third' => refill\Quality::ThirdShop, 'slow' => refill\Quality::SlowTwentyFour, 'slow6' => refill\Quality::SlowSix,
-            'slow2' => refill\Quality::SlowTwo, 'slow48' => refill\Quality::SlowFortyEight, 'slow72' => refill\Quality::SlowSeventyTwo,
-            'fastest' => refill\Quality::Fastest
+            'common' => refill\Quality::Normal,    'fast'   => refill\Quality::Quick,          'card'   => refill\Quality::CardKey,
+            'third'  => refill\Quality::ThirdShop, 'slow'   => refill\Quality::SlowTwentyFour, 'slow6'  => refill\Quality::SlowSix,
+            'slow2'  => refill\Quality::SlowTwo,   'slow48' => refill\Quality::SlowFortyEight, 'slow72' => refill\Quality::SlowSeventyTwo,
+            'fastest'=> refill\Quality::Fastest
         ];
-        if (chksubmit()) {
+
+        if (chksubmit())
+        { //提交写入
             $provider_list = $this->providers();
             foreach ($provider_list as $provider) {
                 $providers[$provider['provider_id']] = $provider;
@@ -30,7 +71,9 @@ class provider_ctlControl extends SystemControl
             $speeds = $_POST['speed'];
             $sorts = $_POST['sort'];
             $openeds = $_POST['opened'];
+            $this->save_channel_speeds($_POST['channel_speed_up'], $providers);
 
+            $result = [];
             foreach ($strs as $key => $str) {
                 $item = explode('-', $str);
 
@@ -55,7 +98,9 @@ class provider_ctlControl extends SystemControl
 
             wcache($rkey, ['data' => serialize($result)], 'provider-');
             showMessage('编辑成功');
-        } else {
+        }
+        else
+        { //显示
             $speed_limit = rcache($rkey, 'provider-');
             if (empty($speed_limit)) {
                 $speed_limit = [];
@@ -103,18 +148,22 @@ class provider_ctlControl extends SystemControl
             $ProviderManager->load();
             $QPTA = $ProviderManager->getQPTA();
             $QPTA = $QPTA[$quality[$form]];
+            $channels_speed = $this->read_channel_speeds();
 
             $datas = [];
-            foreach ($providers as $key => $provider)
+            foreach ($providers as $key => &$provider)
             {
                 $result = [];
                 $pid = $provider['provider_id'];
                 $name = $provider['name'];
+                $provider['channel_speed'] = $channels_speed[$name] ?? -1;
+
                 if (empty($cfgs) || !array_key_exists($name, $cfgs)) {
                     unset($providers[$key]);
                     continue;
                 }
-                foreach ($types as $type) {
+                foreach ($types as $type)
+                {
                     foreach ($amounts as $k => $amount) {
                         $key = $type . '-' . $amount;
                         if (is_array($speed_limit[$key]) && array_key_exists($pid, $speed_limit[$key])) {
@@ -122,7 +171,7 @@ class provider_ctlControl extends SystemControl
                         } else {
                             $speed = $initialiser($provider);
                         }
-                        if (is_array($QPTA["{$name}-{$type}-{$amount}"]) && array_key_exists("{$name}-{$type}-{$amount}", $QPTA)) {
+                        if (is_array($QPTA["$name-$type-$amount"]) && array_key_exists("$name-$type-$amount", $QPTA)) {
                             $speed['has'] = 1;
                         } else {
                             $speed['has'] = 0;

+ 131 - 0
admin/control/refill_discount.php

@@ -0,0 +1,131 @@
+<?php
+/**
+ *   refill_discount.php
+ *   stanley-king
+ *   2024/1/17
+ *   PhpStorm
+ *   PHPProject
+ */
+
+class refill_discountControl extends SystemControl
+{
+    public function __construct()
+    {
+        parent::__construct();
+    }
+
+    public function indexOp()
+    {
+        $mod_discount = Model('refill_discount');
+        $list = $mod_discount->getList($_GET);
+
+        Tpl::output('list', $list);
+        Tpl::output('show_page', $mod_discount->showpage());
+        Tpl::showpage('refill_discount.index');
+    }
+
+    public function addOp()
+    {
+        $lang	= Language::getLangContent();
+        $mod = Model('refill_discount');
+
+        if (chksubmit())
+        {
+            $data = [];
+            $data['act_name'] = trim($_POST['act_name'] ?? '');
+            $data['mch_id'] = trim($_POST['mch_id'] ?? 0);
+            $data['mch_name'] = trim($_POST['mch_name'] ?? '');
+            $data['pcode'] = trim($_POST['pcode'] ?? '');
+            $data['act_type'] = trim($_POST['act_type'] ?? 1);
+            $data['act_sn'] = trim($_POST['act_sn'] ?? '');
+            $data['act_state'] = trim($_POST['act_state'] ?? 1);
+            $data['act_amount'] = trim($_POST['act_amount'] ?? 0);
+            $data['act_count'] = trim($_POST['act_count'] ?? 0);
+
+            $data['add_time'] = time();
+            $data['start_time'] = strtotime(trim($_POST['start_time'] ?? date('Y-m-d')));
+            $data['end_time']   = strtotime(trim($_POST['end_time'] ?? date('Y-m-d')));
+            $data['act_detail'] = trim($_POST['act_detail']);
+
+            $result = $mod->insert($data);
+            if ($result)
+            {
+                $url = [
+                    [
+                        'url' => 'index.php?act=refill_discount&op=index',
+                        'msg' => '返回列表',
+                    ],
+                    [
+                        'url' => 'index.php?act=refill_discount&op=add',
+                        'msg' => '继续新增',
+                    ],
+                ];
+
+                showMessage('新增成功', $url);
+            } else {
+                showMessage('新增失败');
+            }
+        }
+
+        Tpl::showpage('refill_discount.add');
+    }
+
+    public function editOp()
+    {
+        $lang	= Language::getLangContent();
+        $mod = Model('refill_discount');
+
+        if (chksubmit())
+        {
+            $data = [];
+
+            $act_id = intval($_POST['act_id']);
+            $data['act_name'] = trim($_POST['act_name'] ?? '');
+            $data['mch_id'] = trim($_POST['mch_id'] ?? 0);
+            $data['mch_name'] = trim($_POST['mch_name'] ?? '');
+            $data['pcode'] = trim($_POST['pcode'] ?? '');
+            $data['act_type'] = trim($_POST['act_type'] ?? 1);
+            $data['act_sn'] = trim($_POST['act_sn'] ?? '');
+            $data['act_state'] = trim($_POST['act_state'] ?? 1);
+            $data['act_amount'] = trim($_POST['act_amount'] ?? 0);
+            $data['act_count'] = trim($_POST['act_count'] ?? 0);
+
+            $data['start_time'] = strtotime(trim($_POST['start_time'] ?? date('Y-m-d')));
+            $data['end_time']   = strtotime(trim($_POST['end_time'] ?? date('Y-m-d')));
+            $data['act_detail'] = trim($_POST['act_detail']);
+
+            $result = $mod->where(['act_id' => $act_id])->update($data);
+            if ($result) {
+                showMessage('编辑成功');
+            } else {
+                showMessage('编辑失败');
+            }
+        }
+        else
+        {
+            $act_id = intval($_GET['act_id']);
+            $act = $mod->getOneById($act_id);
+            Tpl::output('info', $act);
+            Tpl::showpage('refill_discount.edit');
+        }
+    }
+
+    public function delOp()
+    {
+        $mod = Model('refill_discount');
+        $act_id = intval($_GET['act_id']);
+        $info = $mod->getOneById($act_id);
+
+        if(empty($info)) {
+            showMessage('没有找到活动信息.');
+        }
+
+        $state = intval($info['act_state']);
+        if($state != 0) {
+            showMessage('只有取消的活动,才能被删除.');
+        }
+
+        $mod->delete(['act_id' => $act_id]);
+        showMessage('删除成功.');
+    }
+}

+ 22 - 4
admin/control/refill_event.php

@@ -11,7 +11,7 @@ class refill_eventControl extends SystemControl
 
     public function indexOp()
     {
-        $channels_reader = function ($input)
+        $str_reader = function ($input)
         {
             $ches = [];
             $data = explode(',', $input);
@@ -25,6 +25,20 @@ class refill_eventControl extends SystemControl
             return implode(',', $ches);
         };
 
+        $int_reader = function ($input)
+        {
+            $result = [];
+            $data = explode(',', $input);
+            foreach ($data as $val)
+            {
+                $val = trim($val);
+                if (intval($val) > 0) {
+                    $result[] = $val;
+                }
+            }
+            return implode(',', $result);
+        };
+
         $cacher = Cache::getInstance('cacheredis');
         $cfgs = $cacher->get('event-config', 'refill-');
 
@@ -37,17 +51,21 @@ class refill_eventControl extends SystemControl
             $cfgs['open_crash'] = false;
             $cfgs['cfgs_crash'] = [
                 'channels' => "",
-                'succ_interval' => 900
+                'succ_interval' => 900,
+                'mchids' => ''
             ];
         }
 
         if (chksubmit())
         {
-            $channels = $channels_reader($_POST['channels']);
+            $channels = $str_reader($_POST['channels']);
+            $mchids = $int_reader($_POST['mchids']);
+
             $cfgs['open_crash'] = boolval($_POST['open_crash'] ?? false);
             $cfgs['cfgs_crash'] = [
                 'channels' => $channels,
-                'succ_interval' => intval($_POST['succ_interval'])
+                'succ_interval' => intval($_POST['succ_interval']),
+                'mchids' => $mchids
             ];
             $cacher->set('event-config', serialize($cfgs), 'refill-');
             showMessage('编辑成功');

+ 4 - 0
admin/control/refill_order_manual.php

@@ -601,6 +601,10 @@ class refill_order_manualControl extends SystemControl
         {
             $condition['manual_type'] = $_GET['manual_type'];
         }
+        if (!empty($_GET['refill_amount']))
+        {
+            $condition['refill_order.refill_amount'] = $_GET['refill_amount'];
+        }
         $start = intval(strtotime($_GET['query_start_time']));
         $end = intval(strtotime($_GET['query_end_time']));
         if ($end <= 0) {

+ 1 - 0
admin/include/limit.php

@@ -45,6 +45,7 @@ $_limit =  array(
         array('name'=> '充值拦截设置', 'op'=>null, 'act'=>'refill_config'),
         array('name'=> '卡密管理', 'op'=>null, 'act'=>'card_key'),
         array('name'=> '增值业务管理', 'op'=>null, 'act'=>'refill_third'),
+        array('name'=> '立减金活动管理', 'op'=>null, 'act'=>'refill_discount'),
         array('name'=> '库存管理', 'op'=>null, 'act'=>'refill_stock'),
         array('name'=> '成功率监控', 'op'=>null, 'act'=>'refill_analysis'),
         array('name'=> '订单手动处理', 'op'=>null, 'act'=>'refill_order_manual'),

+ 4 - 3
admin/include/menu.php

@@ -116,8 +116,8 @@ $arr = array(
 					array('args'=>'index,refill_evidence,refill',		'text'=>'充值申请'),
 					array('args'=>'index,refill_order,refill',			'text'=>'订单列表'),
 					array('args'=>'index,provider,refill',				'text'=>'通道列表'),
-					array('args'=>'index,provider_ctl,refill',			'text'=>'通道控制'),
-					array('args'=>'index,refill_merchant_channel_cfg,refill', 'text'=>'机构通道配置'),
+					array('args'=>'index,provider_ctl,refill',					'text'=>'通道控制'),
+					array('args'=>'index,refill_merchant_channel_cfg,refill', 	'text'=>'机构通道配置'),
 					array('args'=>'index,provider_province_cfg,refill',	'text'=>'通道省份配置'),
 					array('args'=>'index,provider_group,refill',		'text'=>'通道组管理'),
 					array('args'=>'index,ordersendlist,refill',			'text'=>'订单监控'),
@@ -127,6 +127,7 @@ $arr = array(
 					array('args'=>'intercept,refill_config,refill',		'text'=>'充值拦截设置'),
 					array('args'=>'stats,card_key,refill',				'text'=>'卡密管理'),
 					array('args'=>'index,refill_third,refill',			'text'=>'增值业务管理'),
+					array('args'=>'index,refill_discount,refill',	    'text'=>'立减金活动管理'),
 					array('args'=>'index,refill_stock,refill',			'text'=>'库存管理'),
 					array('args'=>'index,refill_analysis,refill',		'text'=>'成功率监控'),
 					array('args'=>'index,refill_order_manual,refill',	'text'=>'订单手动处理'),
@@ -140,7 +141,7 @@ $arr = array(
 					array('args'=>'index,task,refill',					'text'=>'任务列表'),
 					array('args'=>'index,refill_error,refill',			'text'=>'异常订单列表'),
 					array('args'=>'index,arw_monitor,refill',			'text'=>'服务器磁盘监控'),
-					array('args'=>'index,refill_tax_stats,refill',	    'text'=>'带票对账统计')
+					array('args'=>'index,refill_tax_stats,refill',	    'text'=>'带票对账统计'),
 				)
 			],
 			[

+ 1 - 1
admin/templates/default/css/recharge.css

@@ -61,7 +61,7 @@
 
 
 /* 提示 */
-.tip_info{border-top: 0 !important;color: #e60d0d;font-size:13px;line-height: 3;}
+.tip_info{border-top: 0 !important;color: #e60d0d;font-size:13px;line-height: 1;}
 
 /* 表格 */
 .tableFixed {

+ 19 - 0
admin/templates/default/css/skin_1.css

@@ -199,6 +199,25 @@ h6 { font-size:12px;}
 .tab-base {float: left; overflow: hidden; padding-top:16px; }
 	.tab-base li { float: left;}
 		.tab-base a { font-weight: 700; line-height: 20px; background: #FFF url(../images/mac/bg_position.png) no-repeat 0px -200px; height: 20px; float: left; padding-left: 14px; margin-right:4px;  cursor: pointer;}
+		.tab-base a .badge {
+			position: absolute;
+			top: 0;
+			right: 0;
+			transform: translate(50%,-50%);
+			transform-origin: 100% 0;
+			min-width: 6px;
+			height: 18px;
+			padding: 0 6px;
+			color: #fff;
+			font-size: 12px;
+			line-height: 18px;
+			white-space: nowrap;
+			text-align: center;
+			background: #ff4d4f;
+			border-radius: 10px;
+			box-shadow: 0 0 0 1px #fff;
+			font-weight: bolder;
+		}
 		.tab-base a:hover { color: #5E728A; background-position: 0 -220px; }
 			.tab-base a span { color: #565D68; background: url(../images/mac/bg_position.png) no-repeat 9999px 9999px; float: left; padding-right: 10px; }
 			.tab-base a:hover span {  background-position: 100% -220px;}

+ 2 - 0
admin/templates/default/login.php

@@ -36,8 +36,10 @@ title="<?php echo $lang['login_index_password_pattern'];?>">
       </span> </div>
       <div class="submit2"></div>
   </form>
+  <!--
   <div class="bottom">
     <h4><?php global $config; echo $config['WEB_COMPANY_NAME'];?></h4>
   </div>
+  -->
 </div>
 

+ 23 - 15
admin/templates/default/member.index.php

@@ -32,21 +32,29 @@
               <option <?php if($output['search_sort'] == 'member_login_time desc'){ ?>selected='selected'<?php } ?> value="member_login_time desc"><?php echo $lang['member_index_last_login']?></option>
               <option <?php if($output['search_sort'] == 'member_login_num desc'){ ?>selected='selected'<?php } ?> value="member_login_num desc"><?php echo $lang['member_index_login_time']?></option>
             </select></td>
-          <td><select name="search_state" >
-              <option <?php if($_GET['search_state'] == ''){ ?>selected='selected'<?php } ?> value=""><?php echo $lang['member_index_state']; ?></option>
-              <option <?php if($_GET['search_state'] == 'no_informallow'){ ?>selected='selected'<?php } ?> value="no_informallow"><?php echo $lang['member_index_inform_deny']; ?></option>
-              <option <?php if($_GET['search_state'] == 'no_isbuy'){ ?>selected='selected'<?php } ?> value="no_isbuy"><?php echo $lang['member_index_buy_deny']; ?></option>
-              <option <?php if($_GET['search_state'] == 'no_isallowtalk'){ ?>selected='selected'<?php } ?> value="no_isallowtalk"><?php echo $lang['member_index_talk_deny']; ?></option>
-              <option <?php if($_GET['search_state'] == 'no_memberstate'){ ?>selected='selected'<?php } ?> value="no_memberstate"><?php echo $lang['member_index_login_deny']; ?></option>
-            </select></td>
-          <td><select name="search_grade" >
-              <option value='-1'>会员级别</option>
-              <?php if ($output['member_grade']){?>
-              	<?php foreach ($output['member_grade'] as $k=>$v){?>
-              	<option <?php if(isset($_GET['search_grade']) && $_GET['search_grade'] == $k){ ?>selected='selected'<?php } ?> value="<?php echo $k;?>"><?php echo $v['level_name'];?></option>
-              	<?php }?>
-              <?php }?>
-            </select></td>
+            <td><select name="search_state">
+                    <option <?php if ($_GET['search_state'] == ''){ ?>selected='selected'<?php } ?>
+                            value=""><?php echo $lang['member_index_state']; ?></option>
+                    <option <?php if ($_GET['search_state'] == 'no_informallow'){ ?>selected='selected'<?php } ?>
+                            value="no_informallow"><?php echo $lang['member_index_inform_deny']; ?></option>
+                    <option <?php if ($_GET['search_state'] == 'no_isbuy'){ ?>selected='selected'<?php } ?>
+                            value="no_isbuy"><?php echo $lang['member_index_buy_deny']; ?></option>
+                    <option <?php if ($_GET['search_state'] == 'no_isallowtalk'){ ?>selected='selected'<?php } ?>
+                            value="no_isallowtalk"><?php echo $lang['member_index_talk_deny']; ?></option>
+                    <option <?php if ($_GET['search_state'] == 'no_memberstate'){ ?>selected='selected'<?php } ?>
+                            value="no_memberstate"><?php echo $lang['member_index_login_deny']; ?></option>
+                </select></td>
+            <td><select name="search_grade">
+                    <option value='-1'>会员级别</option>
+                    <?php if ($output['member_grade']) { ?>
+                        <?php foreach ($output['member_grade'] as $k => $v) { ?>
+                            <option
+                                <?php if (isset($_GET['search_grade']) && $_GET['search_grade'] == $k){ ?>selected='selected'<?php } ?>
+                                value="<?php echo $k; ?>"><?php echo $v['level_name']; ?></option>
+                        <?php } ?>
+                    <?php } ?>
+                </select>
+            </td>
           <td><a href="javascript:void(0);" id="ncsubmit" class="btn-search " title="<?php echo $lang['nc_query'];?>">&nbsp;</a>
             <?php if($output['search_field_value'] != '' or $output['search_sort'] != ''){?>
             <a href="index.php?act=member&op=member" class="btns "><span><?php echo $lang['nc_cancel_search']?></span></a>

+ 53 - 51
admin/templates/default/provider.amount.control.php

@@ -89,10 +89,10 @@
     #price_table {
         table-layout: fixed;
         width: 100%;
-        height: calc(100vh - 220px);
+        height: calc(100vh - 152px);
         overflow: auto;
         display: block;
-        margin-top: 80px;
+        margin-top: 30px;
     }
 
     #price_table tr th:first-child {
@@ -118,6 +118,13 @@
         background: #fff;
     }
 
+    #price_table tr:nth-child(3) {
+        position: sticky;
+        top: 76px;
+        z-index: 11;
+        background: #fff;
+    }
+
     #price_table tr td:first-child {
         display: block;
         position: sticky;
@@ -164,10 +171,10 @@
     <div class="fixed-empty"></div>
     <form id="price_form" enctype="multipart/form-data" method="post">
         <input type="hidden" name="form_submit" value="ok" />
-        <table class="table tb-type2 tableFixed">
+        <table class="table tb-type2 tableFixed" style="top: 10px;">
             <tbody class="tbody">
                 <tr>
-                    <td colspan="2" class="required"><label>单量设置:</label></td>
+                    <td colspan="2" class="required"><label></label></td>
                 </tr>
                 <tr>
                     <td class="tip_info">
@@ -178,18 +185,33 @@
                 <tr class="noborder">
                     <table class="table tb-type2" id="price_table">
                         <tbody class="tbody tableContent">
+                        <!-- 第一层表头开始 -->
                             <tr>
                                 <th class="align-center w120 mw120">渠道名称</th>
                                 <?php foreach ($output['providers'] as $provider) { ?>
-                                    <th class="align-center w165 mw165"><?php echo $provider['store_name'] ?>(<?php if ($provider['opened'] == 1) { ?>
-                                        <span style="color: #0bb20c">开启</span>
-                                        <?php } ?><?php if ($provider['opened'] == 2) { ?>
-                                        <span style="color: #f30707">关闭</span>
-                                        <?php } ?>)
-                                    <?php } ?>
+                                    <th class="align-center w165 mw165">
+                                        <?php echo $provider['store_name'] ?>(<?php if ($provider['opened'] == 1) { ?>
+                                            <span style="color: #0bb20c">开</span>
+                                            <?php } ?><?php if ($provider['opened'] == 2) { ?>
+                                            <span style="color: #f30707">关</span>
+                                            <?php } ?>)
+                                        <?php } ?>
+                                    </th>    
+                            </tr>
+                            <tr> 
+                                <th class="align-center w120 mw120">通道单量</th>
+                                <?php foreach ($output['providers'] as $provider) { ?>
+                                    <th class="align-center w165 mw165">
+                                        <input type="text" value="<?php echo $provider['channel_speed'] ?? '-1' ?>" name="channel_speed[]" class="w32 channel_speed_inputs" />
+                                        <input data-pid="<?php echo $provider['provider_id']?>" type="hidden" value="<?php echo $provider['channel_speed'] ?? '-1' ?>" name="channel_speed_up[]" class="w32 channel_speed_input" />
+                                    </th>    
+                                <?php } ?>
                             </tr>
+                        <!-- 第一层表头结束 -->
+
+                        <!-- 第二层表头开始 -->
                             <tr>
-                                <th class="align-center w120 mw120" style="height:16px">类目</td>
+                                <th class="align-center w120 mw120" style="height:16px">类目</th>
                                     <?php foreach ($output['providers'] as $provider) { ?>
                                 <th class="batch-td">
                                     <div class="priority">
@@ -224,9 +246,12 @@
                             <?php } ?>
 
                             </tr>
+                        <!--第二层表头结束-->
+
+                        <!--表格内容开始-->
                             <?php foreach ($output['form']['amountData'] as $key => $amount) { ?>
                                 <tr class="w500 trFlex">
-                                    <td style="text-align: center;width: 120px;min-width:120px;" class="tbFlex" data-color="<?php echo $amount['type']; ?>">
+                                    <td style="text-align: left;width: 120px;min-width:120px;" class="tbFlex" data-color="<?php echo $amount['type']; ?>">
                                         <?php echo $amount['text'] ?>
                                     </td>
                                     <?php foreach ($output['providers'] as $provider) { ?>
@@ -256,13 +281,15 @@
                                     <?php } ?>
                                 </tr>
                             <?php } ?>
+
+                        <!--表格内容结束-->
                         </tbody>
                     </table>
                 </tr>
             </tbody>
             <tfoot>
                 <tr class="tfoot">
-                    <td colspan="15"><a href="JavaScript:void(0);" class="btn" style="margin-top: 15px" id="submitBtn"><span><?php echo $lang['nc_submit']; ?></span></a></td>
+                    <td colspan="15"><a href="JavaScript:void(0);" class="btn" style="margin-top: 5px" id="submitBtn"><span><?php echo $lang['nc_submit']; ?></span></a></td>
                 </tr>
             </tfoot>
         </table>
@@ -277,17 +304,13 @@
 <script type="text/javascript">
     $(function() {
 
-        // console.log("$output['datas']", <?php echo json_encode($output['datas']) ?>, <?php echo json_encode($output['providers']) ?>);
-
-        // $(window).scroll(function() {
-        //     let toLeft = document.documentElement.scrollLeft || document.body.scrollLeft;
-        //     if (toLeft > 0) {
-        //         let headLeft = toLeft - 20
-        //         $('#tableHread')[0].style.left = '-' + headLeft + 'px'
-        //     } else if (toLeft == 0) {
-        //         $('#tableHread')[0].style.left = 20 + 'px'
-        //     }
-        // });
+       const navRealHeight = $('.fixed-bar').height();
+        if (navRealHeight > 50) {
+            $('.tb-type2.tableFixed').css('top', '60px')
+            $('#price_table').css({'height': 'calc(100vh - 220px)', 'margin-top': '80px'});
+        }
+
+
         let isSubmit = true
         $('.input-one').blur(function() {
             let value = $(this)[0].value
@@ -333,6 +356,12 @@
         // 提交
         $("#submitBtn").click(function() {
             console.log('isSubmit', isSubmit);
+            var $channel_speed_inputs = $('.channel_speed_inputs');
+            for(let i=0;i<$channel_speed_inputs.length;i++) {
+                const val = $channel_speed_inputs.eq(i).val();
+                const pid = $channel_speed_inputs.eq(i).next('.channel_speed_input').attr('data-pid');
+                $channel_speed_inputs.eq(i).next('.channel_speed_input').val(pid+'#'+val);
+            }
             if (isSubmit) {
                 $("#price_form").submit();
             }
@@ -352,35 +381,8 @@
             } else {
                 $(this).css('background', '#fff');
             }
-
-            // 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')
-            // }
         })
 
-        // $('#price_table .tableContent tr').hover(function() {
-        //         $(this)[0].style.backgroundColor = '#cbe9f3'
-        //     }, function() {
-        //         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')
-
-        //         }
-        //     })
-
         // 批量设置开关
         $('.batch > .icon-edit').click(function() {
             $('.batch > .batch-input').hide();

+ 16 - 1
admin/templates/default/refill.buyback.order.php

@@ -196,7 +196,22 @@
                         <?php } ?>
                     </select>
                 </td>
-
+                <th><label>交易面额</label></th>
+                <td>
+                    <select name="refill_amount" class="querySelect">
+                        <option value=""><?php echo $lang['nc_please_choose']; ?></option>
+                        <option value="10" <?php if ($_GET['refill_amount'] == '10') { ?>selected<?php } ?>>10</option>
+                        <option value="20" <?php if ($_GET['refill_amount'] == '20') { ?>selected<?php } ?>>20</option>
+                        <option value="30" <?php if ($_GET['refill_amount'] == '30') { ?>selected<?php } ?>>30</option>
+                        <option value="50" <?php if ($_GET['refill_amount'] == '50') { ?>selected<?php } ?>>50</option>
+                        <option value="100" <?php if ($_GET['refill_amount'] == '100') { ?>selected<?php } ?>>100</option>
+                        <option value="200" <?php if ($_GET['refill_amount'] == '200') { ?>selected<?php } ?>>200</option>
+                        <option value="300" <?php if ($_GET['refill_amount'] == '300') { ?>selected<?php } ?>>300</option>
+                        <option value="500" <?php if ($_GET['refill_amount'] == '500') { ?>selected<?php } ?>>500</option>
+                        <option value="1000" <?php if ($_GET['refill_amount'] == '1000') { ?>selected<?php } ?>>1000</option>
+                        <option value="2000" <?php if ($_GET['refill_amount'] == '2000') { ?>selected<?php } ?>>2000</option>
+                    </select>
+                </td>
             </tr>
             <tr>
                 <th><label class="query_ors">订单号(多行查询)</label></th>

+ 8 - 0
admin/templates/default/refill.order.exception.php

@@ -78,6 +78,14 @@
     .query_ors {
         width: 140px;
     }
+
+    .tab-base{
+        overflow: visible;
+    }
+
+    .tab-base a {
+        position: relative;
+    }
 </style>
 
 <?php defined('InShopNC') or exit('Access Invalid!'); ?>

+ 6 - 0
admin/templates/default/refill.order.monitor.notify.php

@@ -59,6 +59,12 @@
     #selest_nc {
         width: 220px
     }
+    .tab-base{
+        overflow: visible;
+    }
+    .tab-base a {
+        position: relative;
+    }
 </style>
 
 <?php defined('InShopNC') or exit('Access Invalid!'); ?>

+ 6 - 0
admin/templates/default/refill.order.send.index.php

@@ -59,6 +59,12 @@
     #selest_nc {
         width: 220px
     }
+    .tab-base{
+        overflow: visible;
+    }
+    .tab-base a {
+        position: relative;
+    }
 </style>
 
 <?php defined('InShopNC') or exit('Access Invalid!'); ?>

+ 237 - 0
admin/templates/default/refill_discount.add.php

@@ -0,0 +1,237 @@
+<?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=refill_discount&op=index"><span>活动列表</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"/>
+        <table class="table tb-type2">
+            <tbody>
+                <tr class="noborder">
+                    <td colspan="2" class="required"><label class="validation" for="act_name">活动名称:</label></td>
+                </tr>
+                <tr class="noborder">
+                    <td class="vatop rowform"><input type="text" value="" name="act_name" id="system_code" class="txt"></td>
+                    <td class="vatop tips"></td>
+                </tr>
+                <tr>
+                    <td colspan="2" class="required"><label class="validation" for="mch_id">机构编码:</label></td>
+                </tr>
+                <tr class="noborder">
+                    <td class="vatop rowform">
+                        <input type="text" value="" name="mch_id" id="mch_id" class="txt">
+                    </td>
+                    <td class="vatop tips"></td>
+                </tr>
+                <tr class="noborder">
+                    <td colspan="2" ><label for="mch_name">机构名称:</label></td>
+                </tr>
+                <tr class="noborder">
+                    <td class="vatop rowform">
+                        <input type="text" value="" name="mch_name" id="mch_name" class="txt">
+                    </td>
+                </tr>
+                <tr class="noborder">
+                    <td colspan="2"><label for="start_time">活动开始时间:</label></td>
+                </tr>
+                <tr class="noborder">
+                    <td class="vatop rowform"><input class="txt date" type="text" id="start_time" name="start_time" autocomplete="off" style="width:120px" /></td>
+                </tr>
+
+                <tr class="noborder">
+                    <td colspan="2"><label for="end_time">活动结束时间:</label></td>
+                </tr>
+                <tr class="noborder">
+                    <td class="vatop rowform"><input class="txt date" type="text" id="end_time" name="end_time" autocomplete="off" style="width:120px" /></td>
+                </tr>
+                <tr class="noborder">
+                    <td colspan="2"><label for="pcode">产品编码:</label></td>
+                </tr>
+                <tr class="noborder">
+                    <td class="vatop rowform"><input type="text" value="" name="pcode" id="pcode" class="txt"></td>
+                   
+                </tr>
+                <tr class="noborder">
+                    <td colspan="2" ><label for="act_type">活动类型:</label></td>
+                </tr>
+                <tr class="noborder">
+                    <td class="vatop rowform">
+                        <select name="act_type" id="act_type">
+                            <option value="1">支付宝</option>
+                        </select>
+                    </td>
+                    
+                </tr>
+                <tr class="noborder">
+                    <td colspan="2"><label for="act_sn">活动平台编号:</label></td>
+                </tr>
+                <tr class="noborder">
+                    <td class="vatop rowform"><input type="text" value="" name="act_sn" id="act_sn" class="txt"></td>
+                    
+                </tr>
+                <tr class="noborder">
+                    <td colspan="2"><label for="act_state">活动状态:</label></td>
+                </tr>
+                <tr class="noborder">
+                    <td class="vatop rowform">
+                        <select name="act_state" id="act_state">
+                            <option value="0">取消</option>
+                            <option value="1">待开始</option>
+                            <option value="2">进行中</option>
+                            <option value="3">已结束</option>
+                        </select>
+                    </td>
+                    
+                </tr>
+                <tr class="noborder">
+                    <td colspan="2"><label for="act_amount">活动金额:</label></td>
+                </tr>
+                <tr class="noborder">
+                    <td class="vatop rowform"><input type="text" value="" name="act_amount" id="act_amount" class="txt"></td>
+                    
+                </tr>
+
+                <tr class="noborder">
+                    <td colspan="2"><label for="act_count">活动份数:</label></td>
+                </tr>
+                <tr class="noborder">
+                    <td class="vatop rowform"><input type="text" value="" name="act_count" id="act_count" class="txt"></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; ?>/laydate/laydate.js"></script>
+<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 () {
+
+        // 日期选择器
+        laydate.render({
+            elem: '#start_time',
+            type: 'datetime'
+        });
+        laydate.render({
+            elem: '#end_time',
+            type: 'datetime'
+        });
+
+
+        //按钮先执行验证再提交表单
+        $("#submitBtn").click(function () {
+            if ($("#user_form").valid()) {
+                $("#user_form").submit();
+            }
+        });
+        $('#user_form').validate({
+            errorPlacement: function (error, element) {
+                error.appendTo(element.parent().parent().prev().find('td:first'));
+            },
+            rules: {
+                // system_code: {
+                //     required: true,
+                //     remote: {
+                //         url: 'index.php?act=refill_third&op=check_code',
+                //         type: 'get',
+                //         data: {
+                //             system_code: function () {
+                //                 return $('#system_code').val();
+                //             },
+                //         }
+                //     }
+                // },
+                act_name: {
+                    required: true
+                },
+                mch_id: {
+                    required: true
+                },
+                // mch_name: {
+                //     required: true
+                // },
+                // pcode: {
+                //     required: true
+                // },
+                // act_type: {
+                //     required: true
+                // },
+                // act_sn: {
+                //     required: true
+                // },
+                // act_state: {
+                //     required: true
+                // },
+                // act_amount: {
+                //     required: true
+                // },
+                // act_count: {
+                //     required: true
+                // },
+                // start_time: {
+                //     required: true
+                // },
+                // end_time: {
+                //     required: true
+                // }
+            },
+            messages: {
+                act_name: {
+                    required: '活动名称不能为空',
+                    // remote: '产品code已存在'
+                },
+                mch_id: {
+                    required: '机构编码不能为空',
+                },
+                // mch_name: {
+                //     required: '机构名称不能为空',
+                // },
+                // pcode: {
+                //     required: '产品编码不能为空'
+                // },
+                // act_type: {
+                //     required: '活动类型不能为空'
+                // },
+                // act_sn: {
+                //     required: "活动平台编号不能为空"
+                // },
+                // act_state: {
+                //     required: '活动状态不能为空'
+                // },
+                // act_amount: {
+                //     required: '活动金额不能为空'
+                // },
+                // act_count: {
+                //     required: '活动份数不能为空'
+                // },
+                // start_time: {
+                //     required: '活动开始时间不能为空'
+                // },
+                // end_time: {
+                //     required: '活动结束时间不能为空'
+                // }
+            }
+        });
+    });
+</script>

+ 240 - 0
admin/templates/default/refill_discount.edit.php

@@ -0,0 +1,240 @@
+<?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=refill_discount&op=index"><span>活动列表</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="act_id" value="<?php echo $output['info']['act_id'] ?>"/>
+        <table class="table tb-type2">
+            <tbody>
+                <tr class="noborder">
+                    <td colspan="2" class="required"><label class="validation" for="act_name">活动名称:</label></td>
+                </tr>
+                <tr class="noborder">
+                    <td class="vatop rowform"><input type="text" value="<?php echo $output['info']['act_name'] ?>" name="act_name" id="system_code" class="txt"></td>
+                    <td class="vatop tips"></td>
+                </tr>
+                <tr>
+                    <td colspan="2" class="required"><label class="validation" for="mch_id">机构编码:</label></td>
+                </tr>
+                <tr class="noborder">
+                    <td class="vatop rowform">
+                        <input type="text" value="<?php echo $output['info']['mch_id'] ?>" name="mch_id" id="mch_id" class="txt">
+                    </td>
+                    <td class="vatop tips"></td>
+                </tr>
+                <tr class="noborder">
+                    <td colspan="2" ><label for="mch_name">机构名称:</label></td>
+                </tr>
+                <tr class="noborder">
+                    <td class="vatop rowform">
+                        <input type="text" value="<?php echo $output['info']['mch_name'] ?>" name="mch_name" id="mch_name" class="txt">
+                    </td>
+                </tr>
+                <tr class="noborder">
+                    <td colspan="2"><label for="start_time">活动开始时间:</label></td>
+                </tr>
+                <tr class="noborder">
+                    <td class="vatop rowform"><input class="txt date" value="<?php echo $output['info']['start_time'] ?>" type="text" id="start_time" name="start_time" autocomplete="off" style="width:120px" /></td>
+                </tr>
+
+                <tr class="noborder">
+                    <td colspan="2"><label for="end_time">活动结束时间:</label></td>
+                </tr>
+                <tr class="noborder">
+                    <td class="vatop rowform"><input class="txt date" value="<?php echo $output['info']['end_time'] ?>" type="text" id="end_time" name="end_time" autocomplete="off" style="width:120px" /></td>
+                </tr>
+                <tr class="noborder">
+                    <td colspan="2"><label for="pcode">产品编码:</label></td>
+                </tr>
+                <tr class="noborder">
+                    <td class="vatop rowform"><input type="text" value="<?php echo $output['info']['end_time'] ?>" name="pcode" id="pcode" class="txt"></td>
+                   
+                </tr>
+                <tr class="noborder">
+                    <td colspan="2" ><label for="act_type">活动类型:</label></td>
+                </tr>
+                <tr class="noborder">
+                    <td class="vatop rowform">
+                        <select name="act_type" id="act_type">
+                            <option value="1" <?php if ($output['info']['act_type'] == 1){ ?>selected<?php } ?>>支付宝</option>
+                        </select>
+                    </td>
+                    
+                </tr>
+                <tr class="noborder">
+                    <td colspan="2"><label for="act_sn">活动平台编号:</label></td>
+                </tr>
+                <tr class="noborder">
+                    <td class="vatop rowform"><input type="text" value="<?php echo $output['info']['act_sn'] ?>" name="act_sn" id="act_sn" class="txt"></td>
+                    
+                </tr>
+                <tr class="noborder">
+                    <td colspan="2"><label for="act_state">活动状态:</label></td>
+                </tr>
+                <tr class="noborder">
+                    <td class="vatop rowform">
+                        <select name="act_state" id="act_state">
+                            <option value="0" <?php if ($output['info']['act_type'] == '0'){ ?>selected<?php } ?>>取消</option>
+                            <option value="1" <?php if ($output['info']['act_type'] == '1'){ ?>selected<?php } ?>>待开始</option>
+                            <option value="2" <?php if ($output['info']['act_type'] == '2'){ ?>selected<?php } ?>>进行中</option>
+                            <option value="3" <?php if ($output['info']['act_type'] == '3'){ ?>selected<?php } ?>>已结束</option>
+                        </select>
+                    </td>
+                    
+                </tr>
+                <tr class="noborder">
+                    <td colspan="2"><label for="act_amount">活动金额:</label></td>
+                </tr>
+                <tr class="noborder">
+                    <td class="vatop rowform"><input type="text" value="<?php echo $output['info']['act_amount'] ?>" name="act_amount" id="act_amount" class="txt"></td>
+                    
+                </tr>
+
+                <tr class="noborder">
+                    <td colspan="2"><label for="act_count">活动份数:</label></td>
+                </tr>
+                <tr class="noborder">
+                    <td class="vatop rowform"><input type="text" value="<?php echo $output['info']['act_count'] ?>" name="act_count" id="act_count" class="txt"></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; ?>/laydate/laydate.js"></script>
+<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 () {
+
+        // 日期选择器
+        laydate.render({
+            elem: '#start_time',
+            type: 'datetime',
+            value: new Date(parseInt(<?php echo $output['info']['start_time'] ?>) * 1000)
+        });
+        laydate.render({
+            elem: '#end_time',
+            type: 'datetime',
+            value: new Date(parseInt(<?php echo $output['info']['end_time'] ?>) * 1000)
+        });
+
+
+        //按钮先执行验证再提交表单
+        $("#submitBtn").click(function () {
+            if ($("#user_form").valid()) {
+                $("#user_form").submit();
+            }
+        });
+        $('#user_form').validate({
+            errorPlacement: function (error, element) {
+                error.appendTo(element.parent().parent().prev().find('td:first'));
+            },
+            rules: {
+                // system_code: {
+                //     required: true,
+                //     remote: {
+                //         url: 'index.php?act=refill_third&op=check_code',
+                //         type: 'get',
+                //         data: {
+                //             system_code: function () {
+                //                 return $('#system_code').val();
+                //             },
+                //         }
+                //     }
+                // },
+                act_name: {
+                    required: true
+                },
+                mch_id: {
+                    required: true
+                },
+                // mch_name: {
+                //     required: true
+                // },
+                // pcode: {
+                //     required: true
+                // },
+                // act_type: {
+                //     required: true
+                // },
+                // act_sn: {
+                //     required: true
+                // },
+                // act_state: {
+                //     required: true
+                // },
+                // act_amount: {
+                //     required: true
+                // },
+                // act_count: {
+                //     required: true
+                // },
+                // start_time: {
+                //     required: true
+                // },
+                // end_time: {
+                //     required: true
+                // }
+            },
+            messages: {
+                act_name: {
+                    required: '活动名称不能为空',
+                    // remote: '产品code已存在'
+                },
+                mch_id: {
+                    required: '机构编码不能为空',
+                },
+                // mch_name: {
+                //     required: '机构名称不能为空',
+                // },
+                // pcode: {
+                //     required: '产品编码不能为空'
+                // },
+                // act_type: {
+                //     required: '活动类型不能为空'
+                // },
+                // act_sn: {
+                //     required: "活动平台编号不能为空"
+                // },
+                // act_state: {
+                //     required: '活动状态不能为空'
+                // },
+                // act_amount: {
+                //     required: '活动金额不能为空'
+                // },
+                // act_count: {
+                //     required: '活动份数不能为空'
+                // },
+                // start_time: {
+                //     required: '活动开始时间不能为空'
+                // },
+                // end_time: {
+                //     required: '活动结束时间不能为空'
+                // }
+            }
+        });
+    });
+</script>

+ 253 - 0
admin/templates/default/refill_discount.index.php

@@ -0,0 +1,253 @@
+<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;
+    }
+
+    th label {
+        display: inline-block;
+        width: 60px;
+    }
+
+    #prompt ul .noLineLi {
+        background: none;
+    }
+    #prompt div {
+        display: inline-block;
+        background: none
+    }
+    #prompt ul .lineLi {
+        color: #000;
+    }
+
+    tbody {
+        font-size: 12px;
+    }
+    .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 {
+        height: 26px;
+    }
+    input::placeholder {
+        color: #333;
+    }
+</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="JavaScript:void(0);" class="current"><span>活动列表</span></a></li>
+                <li><a href="index.php?act=refill_discount&op=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="refill_discount"/>
+        <input type="hidden" name="op" value="index"/>
+        <table class="tb-type1 noborder search">
+            <tr>
+                <th><label for="title">活动名称</label></th>
+                <td>
+                    <label>
+                        <input type="text" value="<?php echo $_GET['act_name']; ?>" name="act_name" class="txt">
+                    </label>
+                </td>
+                <th><label>机构编码</label></th>
+                <td>
+                    <label>
+                        <input type="text" value="<?php echo $_GET['mch_id']; ?>" name="mch_id" class="txt">
+                    </label>
+                </td>
+                <th><label>机构名称</label></th>
+                <td>
+                    <label>
+                        <input type="text" value="<?php echo $_GET['mch_name']; ?>" name="mch_name" class="txt">
+                    </label>
+                </td>
+                <th><label>产品编码</label></th>
+                <td>
+                    <label>
+                        <input type="text" value="<?php echo $_GET['pcode']; ?>" name="pcode" class="txt">
+                    </label>
+                </td>    
+                <th><label>活动类型</label></th>
+                <td>
+                    <label>
+                        <select name="act_type">
+                            <option value=""><?php echo $lang['nc_please_choose']; ?></option>
+                            <option value="1" <?php if ($_GET['act_type'] == 1){ ?>selected<?php } ?>>支付宝</option>
+                            <!-- <option value="1" <?php if ($_GET['is_show'] == '1'){ ?>selected<?php } ?>>显示</option> -->
+
+                        </select>
+                    </label>
+                </td>
+            </tr>
+            <tr>
+                <th><label>平台编号</label></th>
+                <td>
+                    <label>
+                        <input type="text" value="<?php echo $_GET['act_sn']; ?>" name="act_sn" class="txt">
+                    </label>
+                </td>
+
+                <th><label>活动状态</label></th>
+                <td>
+                    <label>
+                        <select name="act_state">
+                            <option value=""><?php echo $lang['nc_please_choose']; ?></option>
+                            <option value="0" <?php if ($_GET['act_state'] === '0'){ ?>selected<?php } ?>>取消</option>
+                            <option value="1" <?php if ($_GET['act_state'] === '1'){ ?>selected<?php } ?>>待开始</option>
+                            <option value="2" <?php if ($_GET['act_state'] === '2'){ ?>selected<?php } ?>>进行中</option>
+                            <option value="3" <?php if ($_GET['act_state'] === '3'){ ?>selected<?php } ?>>已结束</option>
+                        </select>
+                    </label>
+                </td>
+
+                <th><label>开始时间</label></th>
+                <td>
+                    <label>
+                        <input class="txt date" type="text" value="<?php echo $_GET['start_time']; ?>" id="startTime" name="start_time" autocomplete="off" style="width:120px" />
+                    </label>
+                </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">活动ID</th>
+            <th class="align-left">活动名称</th>
+            <th class="align_left" >机构编码</th>
+            <th class="align_left" >机构名称</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">活动份数</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 $key + 1; ?></td>
+                    <td class="align-center"><?php echo $value['act_name']; ?></td>
+                    <td class="align-center"><?php echo $value['mch_id']; ?></td>
+                    <td class="align-center"><?php echo $value['mch_name']; ?></td>
+                    <td class="align-center"><?php echo $value['pcode']; ?></td>
+                    <td class="align-center"><?php echo $value['act_type'] == 1 ? '支付宝' : '/' ?></td>
+                    <td class="align-center"><?php echo $value['act_sn']; ?></td>
+                    <td class="align-center"><?php 
+                        echo $value['act_state'] === '0' ? '取消': $value['act_state'] === '1' ? '待开始': $value['act_state'] === '2' ? '进行中': $value['act_state'] === '3' ? '已结束': '/';
+                    ?></td>
+                    <td class="align-center"><?php echo $value['act_amount']; ?></td>
+                    <td class="align-center"><?php echo $value['act_count']; ?></td>
+                    <td class="align-center"><?php echo $value['remain_amount']; ?></td>
+                    <td class="align-center"><?php echo $value['remain_count']; ?></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['start_time'] ? date('Y-m-d H:i:s', $value['start_time']) : '/';  ?></td>
+                    <td class="align-center"><?php echo $value['end_time'] ? date('Y-m-d H:i:s', $value['end_time']) : '/';  ?></td>
+                    <td class="align-center"><?php echo $value['update_time'] ? date('Y-m-d H:i:s', $value['update_time']) : '/';  ?></td>
+                    <td class="align-center">
+                        <a href="JavaScript:void(0);" data-detail="">详情</a>
+                        <a href="index.php?act=refill_discount&op=edit&act_id=<?php echo $key + 1; ?>">编辑</a>
+                        <a href="index.php?act=refill_discount&op=del&act_id=<?php echo $key + 1; ?>">删除</a>
+                    </td>
+                </tr>
+            <?php } ?>
+        <?php } else { ?>
+            <tr class="no_data">
+                <td colspan="18"><?php echo $lang['nc_no_record']; ?></td>
+            </tr>
+        <?php } ?>
+        </tbody>
+        <tfoot>
+        <tr class="tfoot">
+            <td colspan="18" 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">
+    $(function () {
+        $('#ncsubmit').click(function () {
+            $('#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')
+            }
+        })
+    });
+</script> 

+ 5 - 0
admin/templates/default/refill_event.index.php

@@ -34,6 +34,11 @@
         <span> 秒</span>
       </label>
     </div>
+    <div style="display:flex;align-items: center;height: 50px;padding-left: 25px;">
+      <span style="margin-right: 8px;">排除机构:</span>
+      <input type="text" name="mchids" style="width: 600px;" value="<?php echo $output['cfgs']['cfgs_crash']['mchids'];?>" id="channels"></input>
+      <span style="padding-left: 8px;"> 请以英文字符逗号隔开.</span>
+    </div>
     <a href="JavaScript:void(0);" class="btn" style="margin-top: 15px" id="submitBtn"><span>提交</span></a>
   </form>
 </div>

+ 4 - 6
core/framework/db/mysqli.php

@@ -45,12 +45,12 @@ class Db
         $conf = C('db.' . $host);
         self::$link[$host] = mysqli_init();
         self::$link[$host]->real_connect($conf['dbhost'], $conf['dbuser'], $conf['dbpwd'], $conf['dbname'], $conf['dbport'],NULL,MYSQLI_CLIENT_FOUND_ROWS);
-        Log::record("{$host}:{$conf['dbhost']}",Log::DEBUG);
+        Log::record("$host:{$conf['dbhost']}",Log::DEBUG);
 
         if (mysqli_connect_errno()) {
             $err_no = mysqli_connect_errno();
             $error = mysqli_connect_error();
-            throw_exception("Db Error: {$host} database connect failed errno={$err_no} err={$error}");
+            throw_exception("DbError: $host database connect failed errno=$err_no err=$error");
         }
 
         switch (strtoupper($conf['dbcharset'])) {
@@ -122,7 +122,7 @@ class Db
 
             if ($query === false)
             {
-                $eno = mysqli_errno(self::$link[$host]);
+                $eno  = mysqli_errno(self::$link[$host]);
                 $emsg = mysqli_error(self::$link[$host]);
 
                 $error = "DbError eno=$eno host=$host msg=$emsg sql=$sql";
@@ -140,7 +140,6 @@ class Db
 
                     self::connect('master');
                     self::connect('slave');
-
                     $count++;
                 }
                 elseif (C('debug')) {
@@ -149,7 +148,6 @@ class Db
                 }
                 elseif (self::ping($host) == false) {
                     if ($count > 0) return false;
-
                     Log::record("DbError query err where ping=false", Log::DEBUG);
                     self::connect('master');
                     self::connect('slave');
@@ -160,7 +158,7 @@ class Db
                 }
             }
             else {
-                Log::record($sql . " [{$host} RunTime:" . $staer->elapsed(6) . "s]", Log::SQL);
+                Log::record($sql . " [$host RunTime:" . $staer->elapsed(6) . "s]", Log::SQL);
                 return $query;
             }
         } while (true);

+ 1 - 1
crontab/control/minutes.php

@@ -558,7 +558,7 @@ class minutesControl extends BaseCronControl
                         $send_amounts = 0;
                         $lack_amounts = 0;
                     }
-                    Log::record("co_id={$co_id} mchid={$mchid} send_amounts={$send_amounts} lack_amounts={$lack_amounts}",Log::DEBUG);
+                    Log::record("co_id=$co_id mchid=$mchid send_amounts=$send_amounts lack_amounts=$lack_amounts",Log::DEBUG);
 
                     $available = $available_predeposit - $credit_bonus + $send_amounts;// - $lack_amounts;
                     $debt = -$available;

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 826 - 85
data/config/xyz/refill.ini.php


+ 309 - 15
data/config/yl/refill.ini.php

@@ -2,7 +2,7 @@
 
 global $config;
 
-$config['refill_oil_specs'] = [50, 100, 200, 500, 1000, 2000];
+$config['refill_oil_specs'] = [50, 100, 200, 300, 500, 1000, 2000];
 $config['refill_phone_specs'] = [10, 20, 30, 50, 100, 200, 300, 500];
 $config['refill_phone_small_specs'] = [1, 2, 3, 4, 5, 6, 7, 8, 9];
 //充值额度基本表
@@ -6757,16 +6757,16 @@ $dezhi_fs_phone = ['name' => 'dezhi_fs', 'store_id' => 245, 'qualitys' => '1',
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 
-$yezi_kc_phone = ['name' => 'yezi_kc', 'store_id' => 246, 'qualitys' => '2',
+$yezi_kc_phone = ['name' => 'yezi_kc', 'store_id' => 246, 'qualitys' => '3',
     'amount' => [
-        10 => [['goods_id' => 8051, 'price' => 10, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        20 => [['goods_id' => 8052, 'price' => 20, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        30 => [['goods_id' => 8053, 'price' => 30, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        50 => [['goods_id' => 8054, 'price' => 50, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        100 => [['goods_id' => 8055, 'price' => 100, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        200 => [['goods_id' => 8056, 'price' => 200, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        300 => [['goods_id' => 8057, 'price' => 300, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        500 => [['goods_id' => 8058, 'price' => 500, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']]
+        10 => [['goods_id' => 8051, 'price' => 10, 'quality' => 3, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        20 => [['goods_id' => 8052, 'price' => 20, 'quality' => 3, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        30 => [['goods_id' => 8053, 'price' => 30, 'quality' => 3, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        50 => [['goods_id' => 8054, 'price' => 50, 'quality' => 3, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        100 => [['goods_id' => 8055, 'price' => 100, 'quality' => 3, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        200 => [['goods_id' => 8056, 'price' => 200, 'quality' => 3, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        300 => [['goods_id' => 8057, 'price' => 300, 'quality' => 3, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        500 => [['goods_id' => 8058, 'price' => 500, 'quality' => 3, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']]
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 
@@ -7878,14 +7878,14 @@ $beirui_trd_phone = ['name' => 'beirui_trd', 'store_id' => 306, 'qualitys' => '1
 //        30 => [
 //            ['goods_id' => 8453, 'price' => 29.04, 'quality' => 1, 'card_type' => 'chinamobile'],
 //        ],
-//        50 => [
-//            ['goods_id' => 8454, 'price' => 47.5, 'quality' => 1, 'card_type' => 'chinamobile'],
-//        ],
+        50 => [
+            ['goods_id' => 8454, 'price' => 48.35, 'quality' => 1, 'card_type' => 'chinamobile'],
+        ],
         100 => [
-            ['goods_id' => 8455, 'price' => 96.5, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8455, 'price' => 96.7, 'quality' => 1, 'card_type' => 'chinamobile'],
         ],
         200 => [
-            ['goods_id' => 8456, 'price' => 193, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8456, 'price' => 193.4, 'quality' => 1, 'card_type' => 'chinamobile'],
         ],
 //        300 => [
 //            ['goods_id' => 8457, 'price' => 290.4, 'quality' => 1, 'card_type' => 'chinamobile'],
@@ -7986,6 +7986,287 @@ $yzpuchong2_phone = ['name' => 'yzpuchong2', 'store_id' => 308, 'qualitys' => '1
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 
+$xingchuang_nation_phone = ['name' => 'xingchuang_nation', 'store_id' => 309, 'qualitys' => '1',
+    'amount' => [
+        10 => [
+//            ['goods_id' => 8483, 'price' => 9.7, 'quality' => 1, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 8483, 'price' => 9.4, 'quality' => 1, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 8483, 'price' => 9.75, 'quality' => 1, 'card_type' => 'chinatelecom'],
+        ],
+        20 => [
+//            ['goods_id' => 8484, 'price' => 19.4, 'quality' => 1, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 8484, 'price' => 18.8, 'quality' => 1, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 8484, 'price' => 19.5, 'quality' => 1, 'card_type' => 'chinatelecom'],
+        ],
+        30 => [
+//            ['goods_id' => 8485, 'price' => 29.04, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8485, 'price' => 28.08, 'quality' => 1, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 8485, 'price' => 29.25, 'quality' => 1, 'card_type' => 'chinatelecom'],
+        ],
+        50 => [
+            ['goods_id' => 8486, 'price' => 48.3, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8486, 'price' => 46.8, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8486, 'price' => 48.3, 'quality' => 1, 'card_type' => 'chinatelecom'],
+        ],
+        100 => [
+            ['goods_id' => 8487, 'price' => 96.6, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8487, 'price' => 93.6, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8487, 'price' => 96.6, 'quality' => 1, 'card_type' => 'chinatelecom'],
+        ],
+        200 => [
+            ['goods_id' => 8488, 'price' => 193.2, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8488, 'price' => 187.2, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8488, 'price' => 193.2, 'quality' => 1, 'card_type' => 'chinatelecom'],
+        ],
+//        300 => [
+//            ['goods_id' => 8489, 'price' => 289.8, 'quality' => 1, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 8489, 'price' => 282, 'quality' => 1, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 8489, 'price' => 292.5, 'quality' => 1, 'card_type' => 'chinatelecom'],
+//        ],
+//        500 => [
+//            ['goods_id' => 8490, 'price' => 485, 'quality' => 1, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 8490, 'price' => 470, 'quality' => 1, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 8490, 'price' => 487.5, 'quality' => 1, 'card_type' => 'chinatelecom'],
+//        ]
+    ],
+    'official_sn' => true, 'refill_type' => 'api'];
+
+$xingchuang_fs_phone = ['name' => 'xingchuang_fs', 'store_id' => 310, 'qualitys' => '1',
+    'amount' => [
+//        10 => [
+//            ['goods_id' => 8491, 'price' => 9.54, 'quality' => 1, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 8491, 'price' => 9.42, 'quality' => 1, 'card_type' => 'chinatelecom']
+//        ],
+//        20 => [
+//            ['goods_id' => 8492, 'price' => 19.08, 'quality' => 1, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 8492, 'price' => 18.84, 'quality' => 1, 'card_type' => 'chinatelecom']
+//        ],
+        30 => [
+//            ['goods_id' => 8493, 'price' => 28.62, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8493, 'price' => 28.26, 'quality' => 1, 'card_type' => 'chinatelecom']
+        ],
+        50 => [
+            ['goods_id' => 8494, 'price' => 47.7, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8494, 'price' => 47.1, 'quality' => 1, 'card_type' => 'chinatelecom']
+        ],
+        100 => [
+            ['goods_id' => 8495, 'price' => 95.4, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8495, 'price' => 94.2, 'quality' => 1, 'card_type' => 'chinatelecom']
+        ],
+        200 => [
+            ['goods_id' => 8496, 'price' => 190.8, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8496, 'price' => 188.4, 'quality' => 1, 'card_type' => 'chinatelecom']
+        ],
+//        300 => [
+//            ['goods_id' => 8497, 'price' => 286.2, 'quality' => 1, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 8497, 'price' => 282.6, 'quality' => 1, 'card_type' => 'chinatelecom']
+//        ],
+//        500 => [
+//            ['goods_id' => 8498, 'price' => 477, 'quality' => 1, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 8498, 'price' => 471, 'quality' => 1, 'card_type' => 'chinatelecom']
+//        ]
+    ],
+    'official_sn' => true, 'refill_type' => 'api'];
+
+$menshang_phone = ['name' => 'menshang', 'store_id' => 311, 'qualitys' => '1',
+    'amount' => [
+        10 => [
+            ['goods_id' => 8499, 'price' => 9.67, 'quality' => 1, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 8499, 'price' => 10, 'quality' => 1, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 8499, 'price' => 10, 'quality' => 1, 'card_type' => 'chinatelecom']
+        ],
+        20 => [
+            ['goods_id' => 8500, 'price' => 19.34, 'quality' => 1, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 8500, 'price' => 20, 'quality' => 1, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 8500, 'price' => 20, 'quality' => 1, 'card_type' => 'chinatelecom']
+        ],
+        30 => [
+//            ['goods_id' => 8501, 'price' => 30, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8501, 'price' => 28.2, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8501, 'price' => 28.71, 'quality' => 1, 'card_type' => 'chinatelecom']
+        ],
+        50 => [
+            ['goods_id' => 8502, 'price' => 48.35, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8502, 'price' => 47, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8502, 'price' => 48.35, 'quality' => 1, 'card_type' => 'chinatelecom']
+        ],
+        100 => [
+            ['goods_id' => 8503, 'price' => 96.7, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8503, 'price' => 94, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8503, 'price' => 96.7, 'quality' => 1, 'card_type' => 'chinatelecom']
+        ],
+        200 => [
+            ['goods_id' => 8504, 'price' => 193.4, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8504, 'price' => 188, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8504, 'price' => 193.4, 'quality' => 1, 'card_type' => 'chinatelecom']
+        ],
+//        300 => [
+//            ['goods_id' => 8505, 'price' => 300, 'quality' => 1, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 8505, 'price' => 300, 'quality' => 1, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 8505, 'price' => 300, 'quality' => 1, 'card_type' => 'chinatelecom']
+//        ],
+//        500 => [
+//            ['goods_id' => 8506, 'price' => 500, 'quality' => 1, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 8506, 'price' => 500, 'quality' => 1, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 8506, 'price' => 500, 'quality' => 1, 'card_type' => 'chinatelecom']
+//        ]
+    ],
+    'official_sn' => true, 'refill_type' => 'api'];
+
+$menshang_fs_phone = ['name' => 'menshang_fs', 'store_id' => 312, 'qualitys' => '1',
+    'amount' => [
+//        10 => [
+//            ['goods_id' => 8507, 'price' => 10, 'quality' => 1, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 8507, 'price' => 10, 'quality' => 1, 'card_type' => 'chinatelecom']
+//        ],
+//        20 => [
+//            ['goods_id' => 8508, 'price' => 20, 'quality' => 1, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 8508, 'price' => 20, 'quality' => 1, 'card_type' => 'chinatelecom']
+//        ],
+        30 => [
+            ['goods_id' => 8509, 'price' => 28.35, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8509, 'price' => 28.14, 'quality' => 1, 'card_type' => 'chinatelecom']
+        ],
+        50 => [
+            ['goods_id' => 8510, 'price' => 47.25, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8510, 'price' => 46.9, 'quality' => 1, 'card_type' => 'chinatelecom']
+        ],
+        100 => [
+            ['goods_id' => 8511, 'price' => 94.5, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8511, 'price' => 93.8, 'quality' => 1, 'card_type' => 'chinatelecom']
+        ],
+        200 => [
+            ['goods_id' => 8512, 'price' => 189, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8512, 'price' => 187.6, 'quality' => 1, 'card_type' => 'chinatelecom']
+        ],
+//        300 => [
+//            ['goods_id' => 8513, 'price' => 300, 'quality' => 1, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 8513, 'price' => 300, 'quality' => 1, 'card_type' => 'chinatelecom']
+//        ],
+//        500 => [
+//            ['goods_id' => 8514, 'price' => 500, 'quality' => 1, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 8514, 'price' => 500, 'quality' => 1, 'card_type' => 'chinatelecom']
+//        ]
+    ],
+    'official_sn' => true, 'refill_type' => 'api'];
+
+$youshilian_phone = ['name' => 'youshilian', 'store_id' => 313, 'qualitys' => '1',
+    'amount' => [
+//        10 => [
+//            ['goods_id' => 8515, 'price' => 10, 'quality' => 1, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 8515, 'price' => 10, 'quality' => 1, 'card_type' => 'chinaunicom'],
+//        ],
+//        20 => [
+//            ['goods_id' => 8516, 'price' => 20, 'quality' => 1, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 8516, 'price' => 20, 'quality' => 1, 'card_type' => 'chinaunicom'],
+//        ],
+        30 => [
+//            ['goods_id' => 8517, 'price' => 30, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8517, 'price' => 28.11, 'quality' => 1, 'card_type' => 'chinaunicom'],
+        ],
+        50 => [
+            ['goods_id' => 8518, 'price' => 48.35, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8518, 'price' => 46.85, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8518, 'price' => 48.35, 'quality' => 1, 'card_type' => 'chinatelecom']
+        ],
+        100 => [
+            ['goods_id' => 8519, 'price' => 96.7, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8519, 'price' => 93.7, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8519, 'price' => 96.7, 'quality' => 1, 'card_type' => 'chinatelecom'],
+        ],
+        200 => [
+            ['goods_id' => 8520, 'price' => 193.4, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8520, 'price' => 187.4, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8520, 'price' => 193.4, 'quality' => 1, 'card_type' => 'chinatelecom'],
+        ],
+//        300 => [
+//            ['goods_id' => 8521, 'price' => 300, 'quality' => 1, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 8521, 'price' => 300, 'quality' => 1, 'card_type' => 'chinaunicom']
+//        ],
+//        500 => [
+//            ['goods_id' => 8522, 'price' => 500, 'quality' => 1, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 8522, 'price' => 500, 'quality' => 1, 'card_type' => 'chinaunicom']
+//        ]
+    ],
+    'official_sn' => true, 'refill_type' => 'api'];
+
+$xinbao_phone = ['name' => 'xinbao', 'store_id' => 314, 'qualitys' => '1',
+    'amount' => [
+//        10 => [
+//            ['goods_id' => 8523, 'price' => 10, 'quality' => 1, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 8523, 'price' => 10, 'quality' => 1, 'card_type' => 'chinaunicom'],
+//        ],
+//        20 => [
+//            ['goods_id' => 8524, 'price' => 20, 'quality' => 1, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 8524, 'price' => 20, 'quality' => 1, 'card_type' => 'chinaunicom'],
+//        ],
+        30 => [
+//            ['goods_id' => 8525, 'price' => 30, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8525, 'price' => 28.2, 'quality' => 1, 'card_type' => 'chinaunicom'],
+        ],
+        50 => [
+            ['goods_id' => 8526, 'price' => 48.4, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8526, 'price' => 47, 'quality' => 1, 'card_type' => 'chinaunicom'],
+        ],
+        100 => [
+            ['goods_id' => 8527, 'price' => 96.8, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8527, 'price' => 94, 'quality' => 1, 'card_type' => 'chinaunicom'],
+        ],
+        200 => [
+            ['goods_id' => 8528, 'price' => 193.6, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8528, 'price' => 188, 'quality' => 1, 'card_type' => 'chinaunicom'],
+        ],
+//        300 => [
+//            ['goods_id' => 8529, 'price' => 300, 'quality' => 1, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 8529, 'price' => 300, 'quality' => 1, 'card_type' => 'chinaunicom'],
+//        ],
+//        500 => [
+//            ['goods_id' => 8530, 'price' => 500, 'quality' => 1, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 8530, 'price' => 500, 'quality' => 1, 'card_type' => 'chinaunicom'],
+//        ]
+    ],
+    'official_sn' => true, 'refill_type' => 'api'];
+
+$dunhui_sec_phone = ['name' => 'dunhui_sec', 'store_id' => 315, 'qualitys' => '1',
+    'amount' => [
+//        10 => [
+//            ['goods_id' => 8531, 'price' => 10, 'quality' => 1, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 8531, 'price' => 10, 'quality' => 1, 'card_type' => 'chinaunicom'],
+//        ],
+//        20 => [
+//            ['goods_id' => 8532, 'price' => 20, 'quality' => 1, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 8532, 'price' => 20, 'quality' => 1, 'card_type' => 'chinaunicom'],
+//        ],
+//        30 => [
+//            ['goods_id' => 8533, 'price' => 30, 'quality' => 1, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 8533, 'price' => 30, 'quality' => 1, 'card_type' => 'chinaunicom'],
+//        ],
+        50 => [
+            ['goods_id' => 8534, 'price' => 48.15, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8534, 'price' => 46.75, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8534, 'price' => 48.3, 'quality' => 1, 'card_type' => 'chinatelecom'],
+        ],
+        100 => [
+            ['goods_id' => 8535, 'price' => 96.3, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8535, 'price' => 93.5, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8535, 'price' => 96.6, 'quality' => 1, 'card_type' => 'chinatelecom'],
+        ],
+        200 => [
+            ['goods_id' => 8536, 'price' => 192.6, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8536, 'price' => 187, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8536, 'price' => 193.2, 'quality' => 1, 'card_type' => 'chinatelecom'],
+        ],
+//        300 => [
+//            ['goods_id' => 8537, 'price' => 300, 'quality' => 1, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 8537, 'price' => 300, 'quality' => 1, 'card_type' => 'chinaunicom'],
+//        ],
+//        500 => [
+//            ['goods_id' => 8538, 'price' => 500, 'quality' => 1, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 8538, 'price' => 500, 'quality' => 1, 'card_type' => 'chinaunicom'],
+//        ]
+    ],
+    'official_sn' => true, 'refill_type' => 'api'];
+
 $phone_providers = [
 //    ['name' => 'beixt', 'cfg' => $beixt_phone],
 //    ['name' => 'bxtwt', 'cfg' => $bxtwt_phone],
@@ -8241,6 +8522,13 @@ $phone_providers = [
     ['name' => 'beirui_trd', 'cfg' => $beirui_trd_phone],
     ['name' => 'yezipczy', 'cfg' => $yezipczy_phone],
     ['name' => 'yzpuchong2', 'cfg' => $yzpuchong2_phone],
+    ['name' => 'xingchuang_nation', 'cfg' => $xingchuang_nation_phone],
+    ['name' => 'xingchuang_fs', 'cfg' => $xingchuang_fs_phone],
+    ['name' => 'menshang', 'cfg' => $menshang_phone],
+    ['name' => 'menshang_fs', 'cfg' => $menshang_fs_phone],
+    ['name' => 'youshilian', 'cfg' => $youshilian_phone],
+    ['name' => 'xinbao', 'cfg' => $xinbao_phone],
+    ['name' => 'dunhui_sec', 'cfg' => $dunhui_sec_phone],
 ];
 
 $config['phone_providers'] = $phone_providers;
@@ -8369,3 +8657,9 @@ $config['third_jumps'] = $third_jumps;
 
 #油需要发短信的机构
 $config['sms_mchids'] = [10325, 10361];
+
+
+#风险流水号管理
+$config['risk_official_sn'] = [
+    'exclude_stores' => []
+];

+ 95 - 0
data/model/refill_discount.model.php

@@ -0,0 +1,95 @@
+<?php
+/**
+ * 活动
+ *
+ * 
+ *
+ *
+ 
+ */
+defined('InShopNC') or exit('Access Invalid!');
+class refill_discountModel extends Model
+{
+    public function __construct()
+    {
+        parent::__construct('refill_discount');
+    }
+
+	/**
+	 * 活动列表
+	 *
+	 * @param  array $condition 查询条件
+	 * @param  obj $page 分页对象
+	 * @return array 二维数组
+	 */
+    public function getList($params, $page = '',$limit = 50)
+    {
+        $cond = $this->getCondition($params);
+        return $this->field('*')->where($cond)->page($page)->order('act_id desc')->limit($limit)->select();
+	}
+
+
+    /**
+	 * 根据id查询一条活动
+	 *
+	 * @param int $id 活动id
+	 * @return array 一维数组
+	 */
+	public function getOneById($id)
+    {
+        return $this->field('*')->where(['act_id' => $id])->find();
+    }
+
+    /**
+	 * 构造查询条件
+	 *
+	 * @param array $condition 条件数组
+	 * @return string
+	 */
+	private function getCondition($input)
+    {
+        $cond = [];
+
+        if(!empty($input['start_time'])) {
+            $start_time = strtotime($input['start_time']);
+            $cond['start_time'] = ['egt', $start_time];
+        }
+
+        if(!empty($input['end_time'])) {
+            $end_time = strtotime($input['end_time']);
+            $cond['start_time'] = ['lt', $end_time];
+        }
+
+        if(!empty($input['act_id'])) {
+            $cond['act_id'] = intval($input['act_id']);
+        }
+
+        if(!empty($input['act_name'])) {
+            $name = trim($input['act_name']);
+            $cond['act_name'] = ['like', "%$name%"];
+        }
+        if(!empty($input['mch_id'])) {
+            $cond['mch_id'] = intval($input['mch_id']);
+        }
+        if(!empty($input['mch_name'])) {
+            $name = trim($input['mch_name']);
+            $cond['mch_name'] = ['like', "%$name%"];
+        }
+        if(!empty($input['pcode'])) {
+            $cond['pcode'] = $input['pcode'];
+        }
+        if(!empty($input['act_type'])) {
+            $cond['act_type'] = intval($input['act_type']);
+        }
+        if(!empty($input['act_sn'])) {
+            $cond['act_sn'] = $input['act_sn'];
+        }
+
+        $act_state = trim($input['act_state']);
+        if($act_state !== "" ) {
+            $cond['act_state'] = intval($act_state);
+        }
+
+        return $cond;
+	}
+}

+ 4 - 0
docker/compose/homecuda/admin/docker-compose.yml

@@ -17,6 +17,8 @@ services:
       - ${SHOP_LOG_PATH}:${SHOP_ROOT_PATH}/data/log
     container_name: "${CONTAINER_PREFIX}-adnginx"
     command: [ nginx,'-g','daemon off;' ]
+    environment:
+      - DOCKER_HOST_IP=192.168.3.104
     extra_hosts:
       - docker.hostip:172.17.0.1
     networks:
@@ -47,5 +49,7 @@ services:
       - ${SHOP_LOG_PATH}:${SHOP_ROOT_PATH}/data/log
     container_name: '${CONTAINER_PREFIX}-adweb'
     command: [php-fpm]
+    extra_hosts:
+      - docker.hostip:172.17.0.1
     networks:
       - ${DOCKER_NET_NAME}

+ 2 - 2
docker/compose/homecuda/conf/php/php-swoole-debug.ini

@@ -1947,8 +1947,8 @@ output_buffering = On
 xdebug.default_enable=1
 xdebug.remote_enable=1
 xdebug.remote_handler=dbgp
-xdebug.remote_host=192.168.3.220
-xdebug.remote_port=9300
+xdebug.remote_host=39.99.233.218
+xdebug.remote_port=7002
 xdebug.remote_mode=req
 xdebug.remote_autostart=1
 xdebug.idekey=PHPSTORM

+ 1 - 1
docker/compose/homecuda/cpenv

@@ -3,7 +3,7 @@
 echo "请先手动编辑好当前目录的.env文件"
 
 # shellcheck disable=SC2039
-dest_dirs=("macc" "admin" "vendor" "cli" "cluster" "master" "racc" "slave" "worker" "remote" "capi" "ibaobei")
+dest_dirs=("macc" "admin" "vendor" "cli" "cluster" "master" "racc" "slave" "worker" "remote" "capi" "ibaobei" 'storage')
 src_file=".env"
 
 for dir in "${dest_dirs[@]}"; do

+ 2 - 0
docker/compose/homecuda/ibaobei/docker-compose.yml

@@ -17,5 +17,7 @@ services:
       - ${SHOP_UPLOAD_PATH}:${SHOP_ROOT_PATH}/data/upload
       - ${SHOP_LOG_PATH}:${SHOP_ROOT_PATH}/data/log
     container_name: "${CONTAINER_PREFIX}-ibaobei"
+    extra_hosts:
+      - docker.hostip:172.17.0.1
     networks:
       - ${DOCKER_NET_NAME}

+ 1 - 1
docker/compose/homecuda/storage/docker-compose.yml

@@ -12,7 +12,7 @@ services:
       - ../conf/etc/localtime:/etc/localtime:ro
       - ../conf/redis/6379.conf:/etc/redis/redis.conf
       - /mnt/redisdata:/data
-    container_name: "panda-redis"
+    container_name: "${CONTAINER_PREFIX}-redis"
     command: [redis-server,"/etc/redis/redis.conf"]
     networks:
       - ${DOCKER_NET_NAME}

+ 3 - 2
helper/refill/CalcMerchantPrice.php

@@ -23,7 +23,7 @@ class CalcMerchantPrice implements ICalc
         }
 
         $price = $policy->price($mchid,$spec,$card_type,$quality,$pcode);
-        if ($price === false) {
+        if ($price === false or $price <= 0.01) {
             throw new Exception("没有协商商品购买价格.");
         } else {
             $this->mPrice = $price;
@@ -40,9 +40,10 @@ class CalcMerchantPrice implements ICalc
         $num = $order_info['quantity'];
         return round($this->mPrice * $num,4);
     }
+
     public function calc_tips()
     {
-        Log::record("没有实现该接口" . __FUNCTION__ ,Log::ERR);
+        Log::record("没有实现该接口" . __FUNCTION__, Log::ERR);
         return [];
     }
 }

+ 20 - 3
helper/refill/RefillBase.php

@@ -409,6 +409,8 @@ class RefillBase
         }
     }
 
+
+
     public function mch_amount(order $order)
     {
         $mchid = $order->mchid();
@@ -490,6 +492,12 @@ class RefillBase
                 continue;
             }
 
+            if($this->mPolicy->is_over_chspeed($channel_name)) {
+                Log::record("chspeed is over:$channel_name",Log::DEBUG);
+                continue;
+            }
+
+
             [$goods_id, $ch_price] = $provider->goods($order->cur_quality(), $order->spec(), $order->card_type(), $order->region_no(), $order->thrid_params());
             if ($goods_id <= 0) continue;
 
@@ -505,11 +513,11 @@ class RefillBase
                 }
                 elseif(PolicyUtil::mixed_quality($org_quality))
                 {
-                    if(!$order->can_over_price()) {
-                        Log::record("can_over_price is false",Log::DEBUG);
+                    if (!$order->can_over_price()) {
+                        Log::record("can_over_price is false", Log::DEBUG);
                         continue;
                     } else {
-                        Log::record("can_over_price is true",Log::DEBUG);
+                        Log::record("can_over_price is true", Log::DEBUG);
                     }
                 }
                 else {
@@ -1121,8 +1129,17 @@ class RefillBase
     {
         $this->mPolicy->update_chctl($params);
     }
+    public function UpdateChspeed($params)
+    {
+        $this->mPolicy->update_chspeeds($params);
+    }
     public function UpdateMaxSpeed($params)
     {
         $this->mPolicy->update_maxspeeds($params);
     }
+
+    public function isOverChspeed($chname)
+    {
+        return $this->mPolicy->is_over_chspeed($chname);
+    }
 }

+ 2 - 0
helper/refill/XYZRefillFactory.php

@@ -38,6 +38,8 @@ require_once(BASE_HELPER_PATH . '/refill/policy/transfer.php');
 require_once(BASE_HELPER_PATH . '/refill/policy/mchannel.php');
 require_once(BASE_HELPER_PATH . '/refill/policy/third_helper.php');
 require_once(BASE_HELPER_PATH . '/refill/policy/ch_times.php');
+require_once(BASE_HELPER_PATH . '/refill/policy/chspeed.php');
+
 require_once(BASE_HELPER_PATH . '/refill/functional.php');
 require_once(BASE_HELPER_PATH . '/refill/chprice_helper.php');
 require_once(BASE_HELPER_PATH . '/refill/EventManager.php');

+ 11 - 1
helper/refill/api/xyz/dongye/api.txt

@@ -5,4 +5,14 @@
 下单地址 :http://8.134.53.93:9086/onlinepay.do
 查单地址 :http://8.134.53.93:9086/searchpay.do
 查询余额地址 :http://8.134.53.93:9086/searchbalance.do
-后台地址:http://8.134.53.93:7080
+后台地址:http://8.134.53.93:7080
+
+
+=======2024.3.22修改编码===============
+30000005891	全国移动计费50元
+30000005892	全国移动计费100元
+30000005893	全国移动计费200元
+
+30000006191	全国电信计费50元
+30000006174	全国电信计费100元
+30000006175	全国电信计费200元

+ 4 - 4
helper/refill/api/xyz/dongye/config.php

@@ -30,8 +30,8 @@ class config
 //        ],
     //移动拼多多资源
         mtopcard\ChinaMobileCard => [
-            10 => '30000001056', 20 => '30000001057', 30 => '30000001058', 50 => '30000005601',
-            100 => '30000001060', 200 => '30000001061', 300 => '30000001062', 500 => '30000001063'
+            10 => '30000001056', 20 => '30000001057', 30 => '30000001058', 50 => '30000005891',
+            100 => '30000005892', 200 => '30000005893', 300 => '30000001062', 500 => '30000001063'
         ],
         //沃支付
         mtopcard\ChinaUnicomCard => [
@@ -44,8 +44,8 @@ class config
         mtopcard\ChinaTelecomCard => [
             1 => '30000005430', 2 => '30000005431', 3 => '30000005432', 4 => '30000005433',
             5 => '30000005435', 6 => '30000005436', 7 => '30000005437', 8 => '30000005438', 9 => '30000005439',
-            10 => '30000001080', 20 => '30000001081', 30 => '30000001082',
-            100 => '30000005791', 200 => '30000005792', 300 => '30000005793', 500 => '30000005794'
+            10 => '30000001080', 20 => '30000001081', 30 => '30000001082', 50 => '30000006191',
+            100 => '30000006174', 200 => '30000006175', 300 => '30000005793', 500 => '30000005794'
         ],
     ];
 }

BIN=BIN
helper/refill/api/xyz/dunhui/20240320_yd_lt.png


+ 37 - 0
helper/refill/api/xyz/dunhui/API.MD

@@ -0,0 +1,37 @@
+
+## 盾辉全国1
+
+### 账号:
+- 登陆账号:FQS
+- 登陆密码:qq123458
+- 商户号:10002643
+- 秘钥:dnsTaPff76RJp8zPy7Ef3GPDPrPyChBR
+### 下游客户注册和登录地址:
+> http://123.60.16.116:7080/
+- api接口文档地址:
+ - https://www.showdoc.com.cn/AQL666666/
+- 话费下单地址:
+ - http://123.60.16.116:9086/onlinepay.do
+- 订单主动查询地址:
+ - http://123.60.16.116:9086/searchpay.do
+- 余额查询:
+- http://123.60.16.116:9086/searchbalance.do
+## 店铺
+- 账号:dunhui
+- 密码:dunhui67890
+
+### 折扣
+![报价](20240320_yd_lt.png)
+
+### 全国产品编码
+101688    全国移动话费50元直充  
+101689    全国移动话费100元直充  
+101690    全国移动话费200元直充  
+
+101706    全国联通话费50元直充  
+101707    全国联通话费100元直充  
+101708    全国联通话费200元直充  
+
+101724	全国电信话费50元直充
+101725	全国电信话费100元直充
+101726	全国电信话费200元直充

+ 49 - 0
helper/refill/api/xyz/dunhui/RefillCallBack.php

@@ -0,0 +1,49 @@
+<?php
+namespace refill\dunhui;
+
+require_once(BASE_HELPER_RAPI_PATH . '/dunhui/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): string
+    {
+        $userid = config::USER_ID;
+        $key = config::KEY;
+        $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): array
+    {
+        $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 === 1) {
+            $official_sn = strtolower($params['remark1']) == 'null' ? '' : $params['remark1'];
+            $data['official_sn'] = $official_sn;
+            Model('refill_order')->edit($order_id, $data);
+            return [$order_id, true, false, true, $official_sn];
+        } elseif ($status === 9) {
+            return [$order_id, false, true, true, ''];
+        } else {
+            return [$order_id, false, false, false, ''];
+        }
+    }
+}

+ 154 - 0
helper/refill/api/xyz/dunhui/RefillPhone.php

@@ -0,0 +1,154 @@
+<?php
+namespace refill\dunhui;
+
+require_once(BASE_HELPER_RAPI_PATH . '/dunhui/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): array
+    {
+        $params['userid'] = config::USER_ID;
+        $params['productid'] = config::ProductIdS[$card_type][$amount];
+        $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): array
+    {
+        $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): array
+    {
+        $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
+            {
+                $official_sn = !empty($resp['remark1']) ? $resp['remark1'] : '';
+
+                $resultno = $resp['resultno'];
+                if ($resultno === '1') {
+                    $updata['official_sn'] = $official_sn;
+                    Model('refill_order')->edit($refill_info['order_id'], $updata);
+                    $order_state = ORDER_STATE_SUCCESS;
+                } elseif ($resultno === '9') {
+                    $order_state = ORDER_STATE_CANCEL;
+                } elseif ($resultno === '5007' && (time() - $refill_info['commit_time'] > 600)) {
+                    $order_state = ORDER_STATE_NOEXIST;
+                } else {
+                    $order_state = ORDER_STATE_SEND;
+                }
+
+                return [true, $order_state, $official_sn];
+            }
+        }
+    }
+
+    public function balance(): array
+    {
+        $params['userid'] = config::USER_ID;
+        $key = config::KEY;
+        $content = "userid={$params['userid']}&key={$key}";
+        $params['sign'] = strtoupper(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 = $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): string
+    {
+        $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 refill\util::xmlToArray($xml);
+    }
+}

+ 45 - 0
helper/refill/api/xyz/dunhui/config.php

@@ -0,0 +1,45 @@
+<?php
+namespace refill\dunhui;
+
+use mtopcard;
+class config
+{
+    const ORDER_URL = 'http://123.60.16.116:9086/onlinepay.do';
+    const QUERY_URL= 'http://123.60.16.116:9086/searchpay.do';
+    const BALANCE_URL = 'http://123.60.16.116:9086/searchbalance.do';
+
+    const USER_ID= '10002643';
+    const KEY = 'dnsTaPff76RJp8zPy7Ef3GPDPrPyChBR';
+    const NOTIFY_URL = BASE_SITE_URL . "/mobile/callback/refill_dunhui.php";
+
+    const operator = [
+        mtopcard\ChinaMobileCard  => 'yd',
+        mtopcard\ChinaUnicomCard  => 'lt',
+        mtopcard\ChinaTelecomCard => 'dx'
+    ];
+    const ERR_NOS = [
+        '5001', '5002', '5003', '5004', '5005', '5008', '5009', '5010', '5011', '5012', '7001'
+    ];
+    const ExtHeaders = ['Content-Type:application/x-www-form-urlencoded;'];
+
+    const ProductIdS = [
+        mtopcard\ChinaMobileCard =>
+            [
+                50 => '101688',
+                100 => '101689',
+                200 => '101690',
+            ],
+        mtopcard\ChinaUnicomCard =>
+            [
+                50 => '101706',
+                100 => '101707',
+                200 => '101708',
+            ],
+        mtopcard\ChinaTelecomCard =>
+            [
+                50 => '101724',
+                100 => '101725',
+                200 => '101726',
+            ]
+    ];
+}

BIN=BIN
helper/refill/api/xyz/guochuang/20240314_dx_shanxi.png


BIN=BIN
helper/refill/api/xyz/guochuang/20240314_yd_liaoning.jpg


BIN=BIN
helper/refill/api/xyz/guochuang/20240315_yd_guizhou.jpg


BIN=BIN
helper/refill/api/xyz/guochuang/20240316_yd_sichuan.jpg


BIN=BIN
helper/refill/api/xyz/guochuang/20240317_yd_liaoning.jpg


BIN=BIN
helper/refill/api/xyz/guochuang/20240318_yd_liaoning.png


BIN=BIN
helper/refill/api/xyz/guochuang/20240319_yd_liaoning.png


BIN=BIN
helper/refill/api/xyz/guochuang/20240320_yd_guangdong.png


BIN=BIN
helper/refill/api/xyz/guochuang/20240325_yd_shandong.jpg


BIN=BIN
helper/refill/api/xyz/guochuang/20240328_dx_shanxi.png


BIN=BIN
helper/refill/api/xyz/guochuang/20240328_yd_guangdong.png


+ 15 - 14
helper/refill/api/xyz/guochuang/config.php

@@ -64,30 +64,31 @@ class config
     const Price = [
         //移动
         "4-10-2" => 10.28, "4-20-2" => 20.56, "4-30-2" => 30.84, "4-50-2" => 50.3, "4-100-2" => 100.3, "4-200-2" => 200.6, "4-300-2" => 300.9, "4-500-2" => 501.5,//天津 2
-        "4-10-6" => 9.76, "4-20-6" => 19.52, "4-30-6" => 29.28, "4-50-6" => 48.8, "4-100-6" => 97.6, "4-200-6" => 195.2, "4-300-6" => 292.8, "4-500-6" => 488,//辽宁 6
+        "4-10-6" => 9.64, "4-20-6" => 19.28, "4-30-6" => 28.92, "4-50-6" => 48.2, "4-100-6" => 96.4, "4-200-6" => 192.8, "4-300-6" => 289.2, "4-500-6" => 482,//辽宁 6
         "4-10-9" => 9.94, "4-20-9" => 19.88, "4-30-9" => 29.82, "4-50-9" => 49.7, "4-100-9" => 99.4,//上海 9
         "4-10-8" => 9.98, "4-20-8" => 19.96, "4-30-8" => 29.94, "4-50-8" => 49.9, "4-100-8" => 99.8, "4-200-8" => 199.6, "4-300-8" => 299.4, "4-500-8" => 499,//黑龙江 8
-        "4-10-29" => 9.83, "4-20-29" => 19.66, "4-30-29" => 29.49, "4-50-29" => 49.15, "4-100-29" => 98.3, "4-200-29" => 196.6, "4-300-29" => 294.9, "4-500-29" => 491.5,//青海 29
-        "4-10-28" => 9.985, "4-20-28" => 19.97, "4-30-28" => 29.955, "4-50-28" => 49.925, "4-100-28" => 99.85, "4-200-28" => 199.7, "4-300-28" => 299.55, "4-500-28" => 499.25,//甘肃 28
+        "4-10-29" => 9.89, "4-20-29" => 19.78, "4-30-29" => 29.67, "4-50-29" => 49.45, "4-100-29" => 98.9, "4-200-29" => 197.8, "4-300-29" => 296.7, "4-500-29" => 494.5,//青海 29
+        "4-10-28" => 10.45, "4-20-28" => 20.74, "4-30-28" => 31.11, "4-50-28" => 50.65, "4-100-28" => 99.85, "4-200-28" => 199.7, "4-300-28" => 299.55, "4-500-28" => 499.25,//甘肃 28
         "4-10-13" => 9.965, "4-20-13" => 19.93, "4-30-13" => 29.895, "4-50-13" => 49.825, "4-100-13" => 99.65, "4-200-13" => 199.3, "4-300-13" => 298.95, "4-500-13" => 498.25,//福建 13
         "4-10-5" => 10.035, "4-20-5" => 20.07, "4-30-5" => 30.09, "4-50-5" => 50.15, "4-100-5" => 100.3, "4-200-5" => 200.4, "4-300-5" => 300.6, "4-500-5" => 501,//内蒙古 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" => 10.1, "4-20-19" => 20.2, "4-30-19" => 30.03, "4-50-19" => 50.05, "4-100-19" => 100.1, "4-200-19" => 200.2, "4-300-19" => 300.3, "4-500-19" => 500.5,//广东 19
+        "4-10-19" => 10.1, "4-20-19" => 20.2, "4-30-19" => 30.03, "4-50-19" => 50.35, "4-100-19" => 100.7, "4-200-19" => 201.4, "4-300-19" => 302.1, "4-500-19" => 503.5,//广东 19
         "4-10-7" => 9.93, "4-20-7" => 19.86, "4-30-7" => 29.52, "4-50-7" => 49.2, "4-100-7" => 98.4, "4-200-7" => 196.8, "4-300-7" => 295.2, "4-500-7" => 492,//吉林 7
         "4-10-1" => 10.31, "4-20-1" => 20.32, "4-30-1" => 30.33, "4-50-1" => 50.35, "4-100-1" => 100.4, "4-200-1" => 200.3, "4-300-1" => 300.45, "4-500-1" => 500.75,//北京 1
         "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" => 10.35, "4-20-15" => 20.7, "4-30-15" => 31.05, "4-50-15" => 50.7, "4-100-15" => 99.3, "4-200-15" => 198.6, "4-300-15" => 297.9,//山东 15
+        "4-10-15" => 10.34, "4-20-15" => 20.54, "4-30-15" => 30.57, "4-50-15" => 50.7, "4-100-15" => 99.3, "4-200-15" => 198.6, "4-300-15" => 297.9,//山东 15
         "4-10-10" => 9.945, "4-20-10" => 19.89, "4-30-10" => 30.18, "4-50-10" => 50.2, "4-100-10" => 100.2, "4-200-10" => 200.4, "4-300-10" => 300.6, "4-500-10" => 501,//江苏 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
         "4-10-17" => 9.945, "4-20-17" => 19.89, "4-30-17" => 29.835, "4-50-17" => 49.725, "4-100-17" => 99.45, "4-200-17" => 198.9, "4-300-17" => 298.35, "4-500-17" => 497.25,//湖北 17
         "4-10-16" => 10.27, "4-20-16" => 20.54, "4-30-16" => 30.81, "4-50-16" => 50.175, "4-100-16" => 100.2, "4-200-16" => 200.4, "4-300-16" => 300.6, "4-500-16" => 501,//河南 16
         "4-10-4" => 10.23, "4-20-4" => 20.46, "4-30-4" => 30.105, "4-50-4" => 50.175, "4-100-4" => 100.35, "4-200-4" => 200.7, "4-300-4" => 301.05, "4-500-4" => 501.75,//山西 4
-        "4-10-24" => 10.13, "4-20-24" => 20.16, "4-30-24" => 30.18, "4-50-24" => 50.05, "4-100-24" => 100.1, "4-200-24" => 200.2, "4-300-24" => 300.3, "4-500-24" => 500.5,//贵州 24
+        "4-10-24" => 10.12, "4-20-24" => 20.14, "4-30-24" => 30.165, "4-50-24" => 50.1, "4-100-24" => 100.2, "4-200-24" => 200.4, "4-300-24" => 300.6, "4-500-24" => 501,//贵州 24
         "4-10-30" => 10.12, "4-20-30" => 20.24, "4-30-30" => 30.129, "4-50-30" => 50.15, "4-100-30" => 100.2, "4-200-30" => 200.4, "4-300-30" => 300.3, "4-500-30" => 500.5,//宁夏 30
         "4-10-25" => 10.14, "4-20-25" => 20.2, "4-30-25" => 30.18, "4-50-25" => 50.1, "4-100-25" => 100.2, "4-200-25" => 200.4, "4-300-25" => 300.6, "4-500-25" => 501,//云南 25
-        "4-10-27" => 10.29, "4-20-27" => 20.58, "4-30-27" => 30.48, "4-50-27" => 49.95, "4-100-27" => 99.9, "4-200-27" => 199.8, "4-300-27" => 299.7, "4-500-27" => 499.5,//陕西 27
+        "4-10-27" => 10.29, "4-20-27" => 20.58, "4-30-27" => 30.48, "4-50-27" => 50.1, "4-100-27" => 100.2, "4-200-27" => 200.4, "4-300-27" => 300.6, "4-500-27" => 501,//陕西 27
         "4-10-31" => 10.4, "4-20-31" => 20.5,//新疆 31
-        "4-50-3" => 50.45,//河北 3
+        "4-10-3" => 10.36, "4-20-3" => 20.72, "4-30-3" => 31.08, "4-50-3" => 50.4,//河北 3
+        "4-10-23" => 10.31, "4-20-23" => 20.62, "4-30-23" => 30.93,//四川 23
 
         //联通
         "5-10-19" => 10.04, "5-20-19" => 20.08, "5-30-19" => 30.06, "5-50-19" => 50.1, "5-100-19" => 100.2, "5-200-19" => 200.4, "5-300-19" => 300.6, "5-500-19" => 501,//广东 19
@@ -97,17 +98,17 @@ class config
         "5-20-23" => 20.08, "5-30-23" => 30.12, "5-50-23" => 50.2, "5-100-23" => 100.4, "5-200-23" => 200.8, "5-300-23" => 301.2, "5-500-23" => 502,//四川 23
         "5-10-31" => 10.22, "5-20-31" => 20.22, "5-30-31" => 30.24, "5-50-31" => 50.25, "5-100-31" => 100.3, "5-200-31" => 200.4, "5-300-31" => 300.6, "5-500-31" => 501,//新疆 31
         //电信
-        "6-10-27" => 10.06, "6-20-27" => 20.12, "6-30-27" => 30.18, "6-50-27" => 50.125, "6-100-27" => 100.25, "6-200-27" => 200.5, "6-300-27" => 300.75, "6-500-27" => 501.25,//陕西 27
+        "6-10-27" => 10.015, "6-20-27" => 20.03, "6-30-27" => 30.045, "6-50-27" => 50.075, "6-100-27" => 100.15, "6-200-27" => 200.3, "6-300-27" => 300.45, "6-500-27" => 501.5,//陕西 27
         "6-10-4" => 9.935, "6-20-4" => 19.87, "6-30-4" => 29.805, "6-50-4" => 49.675, "6-100-4" => 99.35, "6-200-4" => 198.7, "6-300-4" => 298.05, "6-500-4" => 496.75,//山西 4
         "6-10-18" => 10.04, "6-20-18" => 20.08, "6-30-18" => 30.12, "6-50-18" => 50.15, "6-100-18" => 100.3, "6-200-18" => 200.6, "6-300-18" => 300.9, "6-500-18" => 501.5,//湖南 18
         "6-10-15" => 10.22, "6-20-15" => 20.24, "6-30-15" => 30.27, "6-50-15" => 50.3, "6-100-15" => 100.4, "6-200-15" => 200.4, "6-300-15" => 300.6, "6-500-15" => 501,//山东 15
-        "6-10-12" => 10.13, "6-20-12" => 20.16, "6-30-12" => 30.21, "6-50-12" => 50.2, "6-100-12" => 100.55, "6-200-12" => 201, "6-300-12" => 301.5, "6-500-12" => 502.5,//安徽 12
-        "6-10-2" => 10.13, "6-20-2" => 20.16, "6-30-2" => 30.21, "6-50-2" => 50.2, "6-100-2" => 100.55, "6-200-2" => 201, "6-300-2" => 301.5, "6-500-2" => 502.5,//天津 2
+        "6-10-12" => 10.17, "6-20-12" => 20.18, "6-30-12" => 30.21, "6-50-12" => 50.275, "6-100-12" => 100.55, "6-200-12" => 200.8, "6-300-12" => 301.2, "6-500-12" => 502,//安徽 12
+        "6-10-2" => 10.17, "6-20-2" => 20.18, "6-30-2" => 30.21, "6-50-2" => 50.2, "6-100-2" => 100.45, "6-200-2" => 200.8, "6-300-2" => 301.2, "6-500-2" => 502,//天津 2
         "6-10-20" => 10.16, "6-20-20" => 20.18, "6-30-20" => 30.21, "6-50-20" => 50.35, "6-100-20" => 100.45, "6-200-20" => 200.6, "6-300-20" => 300.9, "6-500-20" => 501.5,//广西 20
-        "6-10-29" => 10.17, "6-20-29" => 20.19, "6-30-29" => 30.21, "6-50-29" => 50.25, "6-100-29" => 100.35, "6-200-29" => 200.6, "6-300-29" => 300.9, "6-500-29" => 501.5,//青海 29
+        "6-10-29" => 10.13, "6-20-29" => 20.14, "6-30-29" => 30.18, "6-50-29" => 50.25, "6-100-29" => 100.35, "6-200-29" => 200.6, "6-300-29" => 300.9, "6-500-29" => 501.5,//青海 29
         "6-100-1" => 100.2, "6-200-1" => 200.2, "6-300-1" => 300.3, "6-500-1" => 500.5,//北京 1
-        "6-10-16" => 10.2, "6-20-16" => 20.26, "6-30-16" => 30.27, "6-50-16" => 50.35, "6-100-16" => 100.5, "6-200-16" => 200.6, "6-300-16" => 300.9, "6-500-16" => 501.5,//河南 16
+        "6-10-16" => 10.23, "6-20-16" => 20.26, "6-30-16" => 30.27, "6-50-16" => 50.35, "6-100-16" => 100.5, "6-200-16" => 200.6, "6-300-16" => 300.9, "6-500-16" => 501.5,//河南 16
         "6-10-13" => 10.07, "6-20-13" => 20.14, "6-30-13" => 30.21, "6-50-13" => 50.2, "6-100-13" => 100.4, "6-200-13" => 200.8, "6-300-13" => 300.9, "6-500-13" => 501.5,//福建 13
-        "6-10-6" => 10.13, "6-20-6" => 20.16, "6-30-6" => 30.21, "6-50-6" => 50.2, "6-100-6" => 100.55, "6-200-6" => 201, "6-300-6" => 301.5, "6-500-6" => 502.5,//辽宁 6
+        "6-10-6" => 10.17, "6-20-6" => 20.18, "6-30-6" => 30.21, "6-50-6" => 50.2, "6-100-6" => 100.45, "6-200-6" => 200.8, "6-300-6" => 301.2, "6-500-6" => 502,//辽宁 6
     ];
 }

helper/refill/api/xyz/guochuang/20240101_yd_guangdong.jpg → helper/refill/api/xyz/guochuang/调价函/20240101_yd_guangdong.jpg


helper/refill/api/xyz/guochuang/20240101_yd_liaoning.jpg → helper/refill/api/xyz/guochuang/调价函/20240101_yd_liaoning.jpg


helper/refill/api/xyz/guochuang/20240102_yd_hebei.png → helper/refill/api/xyz/guochuang/调价函/20240102_yd_hebei.png


BIN=BIN
helper/refill/api/xyz/guochuang/调价函/20240102_yd_hebei_2.png


BIN=BIN
helper/refill/api/xyz/guochuang/调价函/20240103_yd_hebei.png


BIN=BIN
helper/refill/api/xyz/guochuang/调价函/20240103_yd_liaoning.png


BIN=BIN
helper/refill/api/xyz/guochuang/调价函/20240104_yd_liaoning.png


BIN=BIN
helper/refill/api/xyz/guochuang/调价函/20240104_yd_liaoning2.png


BIN=BIN
helper/refill/api/xyz/guochuang/调价函/20240105_yd_guangdong.png


BIN=BIN
helper/refill/api/xyz/guochuang/调价函/20240110_yd_liaoning.jpg


BIN=BIN
helper/refill/api/xyz/guochuang/调价函/20240111_dx_henan.jpg


BIN=BIN
helper/refill/api/xyz/guochuang/调价函/20240116_dx_antjln.jpg


BIN=BIN
helper/refill/api/xyz/guochuang/调价函/20240117_yd_liaoning.jpg


BIN=BIN
helper/refill/api/xyz/guochuang/调价函/20240118_yd_sc_gs.jpg


BIN=BIN
helper/refill/api/xyz/guochuang/调价函/20240119_dx_tj_ah_ln.jpg


BIN=BIN
helper/refill/api/xyz/guochuang/调价函/20240128_yd_sichuan.jpg


BIN=BIN
helper/refill/api/xyz/guochuang/调价函/20240129_yd_qinghai.png


BIN=BIN
helper/refill/api/xyz/guochuang/调价函/20240131_yd_liaoning.jpg


BIN=BIN
helper/refill/api/xyz/guochuang/调价函/20240201_dx_shanxi.jpg


BIN=BIN
helper/refill/api/xyz/guochuang/调价函/20240204_yd_liaoning.png


BIN=BIN
helper/refill/api/xyz/guochuang/调价函/20240206_yd_shanxi.jpg


BIN=BIN
helper/refill/api/xyz/guochuang/调价函/20240208_yd_shandong.jpg


BIN=BIN
helper/refill/api/xyz/guochuang/调价函/20240218_dx_qinghai.jpg


BIN=BIN
helper/refill/api/xyz/guochuang/调价函/20240218_yd_shandong.png


BIN=BIN
helper/refill/api/xyz/guochuang/调价函/20240219_yd_guangdong.jpg


BIN=BIN
helper/refill/api/xyz/guochuang/调价函/20240220_yd_guangdong.jpg


BIN=BIN
helper/refill/api/xyz/guochuang/调价函/20240220_yd_hebei.jpg


BIN=BIN
helper/refill/api/xyz/guochuang/调价函/20240221_yd_shanxi.jpg


BIN=BIN
helper/refill/api/xyz/guochuang/调价函/20240222_dx_shanxi.jpg


BIN=BIN
helper/refill/api/xyz/guochuang/调价函/20240222_yd_liaoning.jpg


BIN=BIN
helper/refill/api/xyz/guochuang/调价函/20240222_yd_shandong.jpg


BIN=BIN
helper/refill/api/xyz/guochuang/调价函/20240226_yd_liaoning_guangdong.jpg


BIN=BIN
helper/refill/api/xyz/guochuang/调价函/20240226_yd_shandong.jpg


BIN=BIN
helper/refill/api/xyz/guochuang/调价函/20240226_yd_sichuan.png


BIN=BIN
helper/refill/api/xyz/guochuang/调价函/20240227_yd_guizhou.jpg


BIN=BIN
helper/refill/api/xyz/guochuang/调价函/20240228_dx_anhui.jpg


BIN=BIN
helper/refill/api/xyz/guochuang/调价函/20240303_yd_guizhou.jpg


BIN=BIN
helper/refill/api/xyz/guochuang/调价函/20240305_yd_guizhou.jpg


BIN=BIN
helper/refill/api/xyz/guochuang/调价函/20240305_yd_shandong.jpg


BIN=BIN
helper/refill/api/xyz/guochuang/调价函/20240313_yd_liaoning.png


BIN=BIN
helper/refill/api/xyz/guochuang/调价函/20240313_yd_shandong.png


+ 24 - 0
helper/refill/api/xyz/huifen_fast/API.MD

@@ -0,0 +1,24 @@
+
+## 荟分快充
+
+### 接口地址:
+- 下单地址:https://hfx.vipsave.cn/hf/api/procuder/order/submit
+- 订单状态查询地址:https://hfx.vipsave.cn/hf/api/procuder/order/queryOrderStatus
+- 余额查询地址:https://hfx.vipsave.cn/hf/api/procuder/order/queryBalanceAmt
+
+### 后台:
+- https://hfadmin.vipsave.cn/hf-pos-admin-html/#/login
+- 账号:guo_yan
+- 密码:guoyan88
+
+### 对接文档
+- https://www.showdoc.com.cn/posProducer/7417894866479018
+- 访问密码:886886
+
+### 账户信息:
+- 生产合作方编号:guo_yan
+- 秘钥:k77IXVC366nVfkj5E2FHehnuzAFJKy1O
+
+## 店铺
+- 账号:huifen_fast
+- 密码:huifen_fast67890

+ 40 - 0
helper/refill/api/xyz/huifen_fast/RefillCallBack.php

@@ -0,0 +1,40 @@
+<?php
+namespace refill\huifen_fast;
+
+require_once(BASE_HELPER_RAPI_PATH . '/huifen_fast/config.php');
+
+use refill;
+
+class RefillCallBack implements refill\IRefillCallBack
+{
+    public function verify($params): bool
+    {
+        $sign = config::sign($params, ['sign']);
+        if ($params['sign'] == $sign) {
+            return true;
+        } else {
+            return false;
+        }
+    }
+
+    public function notify($params): array
+    {
+        $status = intval($params['orderStatus']);
+        $order_sn = $params['orderNo'];
+        $order_info = Model('vr_order')->getOrderInfoForNotify(['order_sn' => $order_sn]);
+        if (empty($order_info)) {
+            return [false, false, false, false, ''];
+        }
+
+        $order_id = $order_info['order_id'];
+        if ($status === 20) {
+            $official_sn = $params['operatorSerialNo'];
+            Model('refill_order')->edit($order_id, ['official_sn' => $official_sn]);
+            return [$order_id, true, false, true, $official_sn];
+        } elseif ($status === 40) {
+            return [$order_id, false, true, true, ''];
+        } else {
+            return [$order_id, false, false, false, ''];
+        }
+    }
+}

+ 154 - 0
helper/refill/api/xyz/huifen_fast/RefillPhone.php

@@ -0,0 +1,154 @@
+<?php
+
+namespace refill\huifen_fast;
+
+require_once(BASE_HELPER_RAPI_PATH . '/huifen_fast/config.php');
+
+use Exception;
+use refill;
+use Log;
+
+class RefillPhone extends refill\IRefillPhone
+{
+    public function __construct($cfgs)
+    {
+        parent::__construct($cfgs);
+    }
+
+    /**
+     * @throws Exception
+     */
+    private function req_params(int $card_no, int $card_type, string $order_sn, int $amount): array
+    {
+        $operatorName = config::operator[$card_type] ?? false;
+        if($operatorName === false) {
+            return [];
+        }
+
+        $params['partnerNo'] = config::PARTNER_NO;
+        $params['productNo'] = $amount;
+        $params['orderNo'] = $order_sn;
+        $params['productQty'] = 1;
+        $params['operatorName'] = $operatorName;
+        $params['accountNo'] = $card_no;
+        return $params;
+    }
+
+    public function add($card_no, $card_type, $amount, $params, &$net_errno = 0): array
+    {
+        $params = $this->req_params($card_no, $card_type, $params['order_sn'], $amount);
+        if(empty($params)) {
+            return [false, '参数错误', false];
+        }
+
+        $sign = config::sign($params);
+        $params['sign'] = $sign;
+
+        $params = json_encode($params);
+        $resp = http_post_data(config::ORDER_URL, $params, 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];
+            }
+
+            $code = intval($resp['code']);
+            if ($code === 200) {
+                return [true, '', false];
+            } elseif (in_array($code, config::ERR_NOS, true)) { //const ERR_NOS = [500, 50001, 50003, 50005];
+                return [false, $resp['message'], false];
+            } elseif (in_array($code, config::EXP_NOS, true)) {
+                $net_errno = "HTTP-$code";
+                return [false, $resp['message'], true];
+            } else {
+                $err = 998;
+                $net_errno = "HTTP-$err";
+                return [false, $resp['message'], true];
+            }
+        }
+    }
+
+    public function query($refill_info): array
+    {
+        $params['partnerNo'] = config::PARTNER_NO;
+        $params['orderNo'] = $refill_info['order_sn'];
+        $sign = config::sign($params);
+        $params['sign'] = $sign;
+
+        $params = json_encode($params);
+        $resp = http_post_data(config::QUERY_URL, $params, config::ExtHeaders);
+        if (empty($resp)) {
+            return [false, '网络错误', ''];
+        }
+        else
+        {
+            Log::record($resp, Log::DEBUG);
+
+            $resp = json_decode($resp, true);
+            if (empty($resp)) {
+                return [false, '网络错误', ''];
+            }
+
+            $code = intval($resp['code']);
+            if ($code === 200)
+            {
+                $offical_sn = '';
+                $status = intval($resp['data']['orderStatus']);
+
+                if ($status === 20) {
+                    $offical_sn = $resp['data']['operatorSerialNo'];
+                    Model('refill_order')->edit($refill_info['order_id'], ['official_sn' => $offical_sn]);
+                    $order_state = ORDER_STATE_SUCCESS;
+                } elseif ($status === 40) {
+                    $order_state = ORDER_STATE_CANCEL;
+                } elseif ($status === 10) {
+                    $order_state = ORDER_STATE_SEND;
+                } else {
+                    return [false, $resp['data']['orderStatusDesc'], $offical_sn];
+                }
+
+                return [true, $order_state, $offical_sn];
+            }
+            else
+            {
+                return [false, $resp['message'], ''];
+            }
+        }
+    }
+
+    public function balance(): array
+    {
+        $params['partnerNo'] = config::PARTNER_NO;
+
+        $sign = config::sign($params);
+        $params['sign'] = $sign;
+
+        $params = json_encode($params);
+        $resp = http_post_data(config::BALANCE_URL, $params, config::ExtHeaders);
+        if (empty($resp)) {
+            return [false, '网络错误'];
+        }
+        else
+        {
+            Log::record($resp, Log::DEBUG);
+
+            $resp = json_decode($resp, true);
+            if (empty($resp)) {
+                return [false, '网络错误'];
+            }
+
+            $code = intval($resp['code']);
+            if ($code === 200) {
+                return [true, $resp['data']['balanceAmt']];
+            } else {
+                return [false, $resp['message']];
+            }
+        }
+    }
+}

+ 50 - 0
helper/refill/api/xyz/huifen_fast/config.php

@@ -0,0 +1,50 @@
+<?php
+namespace refill\huifen_fast;
+
+use mtopcard;
+class config
+{
+    const ORDER_URL = 'https://hfx.vipsave.cn/hf/api/procuder/order/submit';
+    const QUERY_URL = 'https://hfx.vipsave.cn/hf/api/procuder/order/queryOrderStatus';
+    const BALANCE_URL = 'https://hfx.vipsave.cn/hf/api/procuder/order/queryBalanceAmt';
+    const PARTNER_NO = 'guo_yan';
+    const SECRET_KEY = 'k77IXVC366nVfkj5E2FHehnuzAFJKy1O';
+
+    const NOTIFY_URL = BASE_SITE_URL . "/mobile/callback/refill_huifen_fast.php";
+    const ExtHeaders = ['Content-Type: application/json;charset=UTF-8'];
+
+    const ERR_NOS = [500, 50001, 50003, 50005];
+    const EXP_NOS = [50004, 50006, 50009];
+    const operator = [
+        mtopcard\ChinaMobileCard  => 'YD',
+        mtopcard\ChinaUnicomCard  => 'LT',
+        mtopcard\ChinaTelecomCard => 'DX'
+    ];
+
+    public static function sign(array $params, array $ignore = []): string
+    {
+        ksort($params);
+        $content = '';
+        foreach ($params as $key => $value)
+        {
+            if (in_array($key, $ignore)) {
+                continue;
+            }
+            if(self::check_empty($value) === false) {
+                $content .= "$key=$value&";
+            }
+        }
+        $content .= "secretKey=" . config::SECRET_KEY;
+        return strtoupper(md5($content));
+    }
+
+    public static function check_empty($value): bool
+    {
+        if (!isset($value))
+            return true;
+        if (trim($value) === "null")
+            return true;
+
+        return false;
+    }
+}

+ 12 - 0
helper/refill/api/xyz/kachong_new/API.MD

@@ -0,0 +1,12 @@
+## 70卡充(新)
+
+- 下单地址:http://42.193.245.133:5001/plat/api/old/submitorder
+- 查单地址:http://42.193.245.133:5001/plat/api/old/queryorder
+- 余额地址:http://42.193.245.133:5001/plat/api/old/queryBalance
+- 接口文档:https://docs.qq.com/doc/DZW5jTWdHZFVIYnZp?_t=1639711707120 话费
+- ID:200517
+- 密钥:618702d302bab75af6b429b5563047ec
+
+## 店铺账号:
+- kachong_new
+- kachong_new67890

+ 49 - 0
helper/refill/api/xyz/kachong_new/RefillCallBack.php

@@ -0,0 +1,49 @@
+<?php
+namespace refill\kachong_new;
+
+require_once(BASE_HELPER_RAPI_PATH . '/kachong_new/config.php');
+
+use refill;
+class RefillCallBack implements refill\IRefillCallBack
+{
+    public function verify($params): bool
+    {
+        $sign = $this->sign($params);
+        if ($params['szVerifyString'] == $sign) {
+            return true;
+        } else {
+            return false;
+        }
+    }
+
+    private function sign($params)
+    {
+        $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);
+    }
+
+    public function notify($params)
+    {
+        $status = intval($params['nFlag']);
+        $order_sn = $params['szOrderId'];
+        $order_info = Model('vr_order')->getOrderInfoForNotify(['order_sn' => $order_sn]);
+        if (empty($order_info)) {
+            return [false, false, false,false];
+        }
+        $order_id = $order_info['order_id'];
+
+        if ($status === 2) {
+            Model('refill_order')->edit($order_id, ['official_sn' => $params['szRtnMsg']]);
+            return [$order_id, true, false,true];
+        }
+        elseif ($status === 3) {
+            return [$order_id, false, true,true];
+        }
+        else {
+            return [$order_id, false, false,false];
+        }
+    }
+}

+ 137 - 0
helper/refill/api/xyz/kachong_new/RefillPhone.php

@@ -0,0 +1,137 @@
+<?php
+
+namespace refill\kachong_new;
+
+require_once(BASE_HELPER_RAPI_PATH . '/kachong_new/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 = intval($resp['nRtn']);
+            if (empty($resp)) {
+                return [false, '网络错误', true];
+            } elseif ($nRtn === 0) {
+                return [true, '', false];
+            } elseif (in_array($nRtn, config::ERR_NOS)) {
+                return [false, $resp['szRtnCode'], false];
+            } elseif (in_array($nRtn, [2050, 999])) {
+                $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 = intval($resp['nRtn']);
+            if ($status === 5012) {
+                Model('refill_order')->edit($refill_info['order_id'], ['official_sn' => $resp['szRtnMsg']]);
+                $order_state = ORDER_STATE_SUCCESS;
+            } elseif ($status === 5013) {
+                $order_state = ORDER_STATE_CANCEL;
+            } elseif (in_array($status, [5011,5019])) {
+                $order_state = ORDER_STATE_SEND;
+            } elseif ($status === 5005 && (time() - $refill_info['commit_time'] >= 300)) {
+                $order_state = ORDER_STATE_NOEXIST;
+            } else {
+                return [false, $status];
+            }
+            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);
+    }
+}

+ 0 - 0
helper/refill/api/xyz/kachong_new/config.php


Algúns arquivos non se mostraron porque demasiados arquivos cambiaron neste cambio