Browse Source

Merge branch 'raccount' into rchannel

xiaoyu 3 years atrás
parent
commit
13732ecafc
100 changed files with 5449 additions and 1865 deletions
  1. 21 1
      admin/config/config.ini.php
  2. 6 23
      admin/control/control.php
  3. 1 0
      admin/control/merchant.php
  4. 1 0
      admin/control/ordersendlist.php
  5. 62 13
      admin/control/orderstats.php
  6. 232 3
      admin/control/provider.php
  7. 17 0
      admin/control/provider_group.php
  8. 7 0
      admin/control/provider_price.php
  9. 2 0
      admin/control/refill_order_manual.php
  10. 0 3
      admin/language/zh/cache.php
  11. 319 276
      admin/templates/default/layout/index_layout.php
  12. 19 4
      admin/templates/default/merchant.order.stats.php
  13. 381 0
      admin/templates/default/merchant.refill.balance.php
  14. 53 14
      admin/templates/default/provider.group.list.php
  15. 248 223
      admin/templates/default/provider.index.php
  16. 19 4
      admin/templates/default/provider.order.stats.php
  17. 328 0
      admin/templates/default/provider.price.set.php
  18. 377 0
      admin/templates/default/provider.refill.balance.php
  19. 667 629
      admin/templates/default/refill.order.index.php
  20. 12 0
      admin/templates/default/system.order.stats.php
  21. 302 0
      admin/templates/default/system.refill.balance.php
  22. 10 42
      data/config/dev/refill.ini.php
  23. 1 33
      data/config/win/refill.ini.php
  24. 207 163
      data/config/xyz/refill.ini.php
  25. 2 2
      data/config/xyztest/base.ini.php
  26. 9 41
      data/config/xyztest/refill.ini.php
  27. 223 201
      data/config/yl/refill.ini.php
  28. 19 0
      data/logic/queue.logic.php
  29. 3 0
      data/model/provider_group.model.php
  30. 21 0
      data/model/provider_price.model.php
  31. 37 0
      data/model/refill_balance.model.php
  32. 25 0
      data/model/refill_order.model.php
  33. 14 0
      docker/compose/stanley/admin/docker-compose.yml
  34. 4 4
      docker/compose/xyzt/acc/docker-compose.yml
  35. 2 2
      docker/compose/xyzt/admin/docker-compose.yml
  36. 2 2
      docker/compose/xyzt/cli/docker-compose.yml
  37. 3 3
      docker/compose/xyzt/master-crond/docker-compose.yml
  38. 0 0
      docker/compose/xyzt/tsender/docker-compose.yml
  39. 1 1
      docker/compose/xyzt/slave-crond/docker-compose.yml
  40. 8 8
      docker/compose/xyzt/stat/docker-compose.yml
  41. 1 1
      docker/compose/xyzt/storage/docker-compose.yml
  42. 0 0
      docker/compose/xyzt/tworker/docker-compose.yml
  43. 0 0
      docker/compose/xyz/worker/restart_all.sh
  44. 0 0
      docker/compose/xyzt/tworker/restart_cordsrv.sh
  45. 0 0
      docker/compose/xyzt/tworker/stop_all.sh
  46. 0 4
      docker/compose/xyzt/worker/restart_all.sh
  47. 1 0
      docker/compose/yl/conf/crontab/slave_root
  48. 63 63
      global.php
  49. 9 0
      helper/bank/IBank.php
  50. 110 0
      helper/bank/bcm.php
  51. 114 0
      helper/bank/ccb.php
  52. 117 0
      helper/bank/ccbb.php
  53. 138 0
      helper/bank/cmbc.php
  54. 137 0
      helper/bank/cmbcex.php
  55. 96 0
      helper/bank/converter.php
  56. 141 0
      helper/bank/execl_loader.php
  57. 97 0
      helper/bank/hfb.php
  58. 111 0
      helper/bank/spdb.php
  59. 11 9
      helper/mtopcard/card_query.php
  60. 6 0
      helper/refill/ProviderManager.php
  61. 1 1
      helper/refill/XYZRefillFactory.php
  62. 50 0
      helper/refill/api/xyz/guitong/RefillCallBack.php
  63. 141 0
      helper/refill/api/xyz/guitong/RefillPhone.php
  64. 9 0
      helper/refill/api/xyz/guitong/api.txt
  65. 27 0
      helper/refill/api/xyz/guitong/config.php
  66. BIN
      helper/refill/api/xyz/guochuang/20200407江西联通调价函.png
  67. BIN
      helper/refill/api/xyz/guochuang/20220331辽宁青海移动调价函.jpg
  68. BIN
      helper/refill/api/xyz/guochuang/20220404国创河南移动调价.png
  69. BIN
      helper/refill/api/xyz/guochuang/20220407天津移动调价函.png
  70. BIN
      helper/refill/api/xyz/guochuang/20220407河南移动调价函.png
  71. BIN
      helper/refill/api/xyz/guochuang/20220408青海移动调价函.png
  72. BIN
      helper/refill/api/xyz/guochuang/20220409辽宁移动调价函.png
  73. 6 5
      helper/refill/api/xyz/guochuang/config.php
  74. 6 4
      helper/refill/api/xyz/huoshenguo/config.php
  75. 9 1
      helper/refill/api/xyz/huoshenguo/开户信息.txt
  76. 67 0
      helper/refill/api/xyz/huoshenguoman/RefillCallBack.php
  77. 155 0
      helper/refill/api/xyz/huoshenguoman/RefillPhone.php
  78. 31 0
      helper/refill/api/xyz/huoshenguoman/config.php
  79. 21 0
      helper/refill/api/xyz/huoshenguoman/开户信息.txt
  80. 1 1
      helper/refill/api/xyz/jianjiao/API信息.txt
  81. BIN
      helper/refill/api/xyz/kuaikuaifs/20220330广东移动调价函.png
  82. BIN
      helper/refill/api/xyz/kuaikuaifs/20220331青海移动调价函.png
  83. 2 2
      helper/refill/api/xyz/kuaikuaifs/config.php
  84. 12 7
      helper/refill/api/xyz/lingzhman48/config.php
  85. 44 34
      helper/refill/api/xyz/lingzhman48/椰子慢充.txt
  86. 2 2
      helper/refill/api/yl/baixuannew_high/config.php
  87. 4 4
      helper/refill/api/yl/baixuannew_high/对接文档-yezi.txt
  88. 2 2
      helper/refill/api/yl/baixuannew_normal/config.php
  89. 4 4
      helper/refill/api/yl/baixuannew_normal/对接文档-yezi.txt
  90. 8 4
      helper/refill/api/yl/dashang_normal/config.php
  91. 12 6
      helper/refill/api/yl/dashang_normal/开户信息.txt
  92. 4 3
      helper/refill/api/yl/dongye/api.txt
  93. 2 2
      helper/refill/api/yl/dongye/config.php
  94. 4 3
      helper/refill/api/yl/dongyefs/api.txt
  95. 2 2
      helper/refill/api/yl/dongyefs/config.php
  96. 2 2
      helper/refill/api/yl/feimingyunew/config.php
  97. 4 4
      helper/refill/api/yl/feimingyunew/对接文档-yezi.txt
  98. BIN
      helper/refill/api/yl/guochuang/20210904调价函.jpg
  99. BIN
      helper/refill/api/yl/guochuang/20210908广东移动调价函.png
  100. 0 0
      helper/refill/api/yl/guochuang/20210914广东移动调价函.jpg

+ 21 - 1
admin/config/config.ini.php

@@ -1,4 +1,5 @@
 <?php
+require_once(BASE_HELPER_PATH . '/refill/RefillFactory.php');
 defined('InShopNC') or exit('Access Invalid!');
 
 $config['sys_log'] = true;
@@ -13,7 +14,8 @@ $config['receive_bank'] = [
         '国研招行',
         '趣带娃建行',
         '椰子交行',
-        '国研交行'
+        '国研交行',
+        '椰林招行'
     ],
     'LZKJ_COMPANY' => [
         '琳珠收款'
@@ -34,7 +36,25 @@ $config['server'] = [
     '39.99.250.165' => '主数据库服务器',
     '39.103.201.41' => '备份数据库服务器',
     '39.103.141.163' => '后台服务器',
+];
 
+$config['oil_quality_text'] = [
+    refill\Quality::Normal => '无流水',
+    refill\Quality::Quick => '快充',
+    refill\Quality::CardKey => '卡密',
+    refill\Quality::SlowTwentyFour => '有流水'
+];
+$config['phone_quality_text'] = [
+    refill\Quality::Normal => '普充',
+    refill\Quality::Quick => '快充',
+    refill\Quality::CardKey => '卡密',
+    refill\Quality::ThirdShop => '三方',
+    refill\Quality::SlowTwentyFour => '慢24',
+    refill\Quality::SlowSix => '慢6',
+    refill\Quality::SlowTwo => '慢2',
+    refill\Quality::SlowFortyEight => '慢48',
+    refill\Quality::SlowSeventyTwo => '慢72',
+    refill\Quality::Fastest => '速充',
 ];
 
 return $config;

+ 6 - 23
admin/control/control.php

@@ -332,30 +332,13 @@ class SystemControl
     }
 
     protected function quality_format($quality,$card_type) {
-        $oil_text = [
-            refill\Quality::Normal => '无流水',
-            refill\Quality::Quick => '快充',
-            refill\Quality::CardKey => '卡密',
-            refill\Quality::SlowTwentyFour => '有流水'
-        ];
-        $phone_text = [
-            refill\Quality::Normal => '普充',
-            refill\Quality::Quick => '快充',
-            refill\Quality::CardKey => '卡密',
-            refill\Quality::ThirdShop => '三方',
-            refill\Quality::SlowTwentyFour => '慢24',
-            refill\Quality::SlowSix => '慢6',
-            refill\Quality::SlowTwo => '慢2',
-            refill\Quality::SlowFortyEight => '慢48',
-            refill\Quality::SlowSeventyTwo => '慢72',
-            refill\Quality::Fastest => '速充',
-        ];
+        global $config;
         $text = [
-            mtopcard\PetroChinaCard => $oil_text,
-            mtopcard\SinopecCard => $oil_text,
-            mtopcard\ChinaMobileCard => $phone_text,
-            mtopcard\ChinaUnicomCard => $phone_text,
-            mtopcard\ChinaTelecomCard => $phone_text
+            mtopcard\PetroChinaCard => $config['oil_quality_text'],
+            mtopcard\SinopecCard => $config['oil_quality_text'],
+            mtopcard\ChinaMobileCard => $config['phone_quality_text'],
+            mtopcard\ChinaUnicomCard => $config['phone_quality_text'],
+            mtopcard\ChinaTelecomCard => $config['phone_quality_text']
         ];
         return $text[$card_type][$quality] ?? $quality;
     }

+ 1 - 0
admin/control/merchant.php

@@ -843,6 +843,7 @@ class merchantControl extends SystemControl
             showMessage('手动操作类型错误', 'index.php?act=refill_order&op=index');
         }
         $this->manual_log_record($refill_info, $type);
+        $this->log("手动处理,订单号:{$order_info['order_sn']}", 1);
         showMessage('操作成功');
     }
 

+ 1 - 0
admin/control/ordersendlist.php

@@ -562,6 +562,7 @@ class ordersendlistControl extends SystemControl
             util::pop_queue_order($order['mchid'], $order['mch_order']);
             QueueClient::push("NotifyMerchantComplete", ['order_id' => $order_id, 'manual' => true]);
         }
+        $this->log("手动强制处理", 1);
         showMessage('操作成功');
     }
 

+ 62 - 13
admin/control/orderstats.php

@@ -1,4 +1,5 @@
 <?php
+require_once(BASE_HELPER_PATH . '/task/task_helper.php');
 
 
 class orderstatsControl extends SystemControl
@@ -14,23 +15,17 @@ class orderstatsControl extends SystemControl
         $page = "{$type}.order.stats";
         $_GET['query_start_time'] = $_GET['query_start_time'] ?? date("Y-m-d 00:00:00", strtotime("-1 day"));
         $model_refill_order = Model('refill_order');
-        $condition['type'] = $type;
-        if (!empty($_GET['cid'])) {
-            $condition['cid'] = ['in', $_GET['cid']];
-        }
+        $condition = $this->ct_cond($_GET, 'time_stamp');
         if (!empty($_GET['order_time_type'])) {
             $condition['order_time_type'] = $_GET['order_time_type'];
         }
-        $start_unixtime = intval(strtotime($_GET['query_start_time']));
-        $end_unixtime = intval(strtotime($_GET['query_end_time']));
-        if ($start_unixtime > 0 && $end_unixtime > $start_unixtime) {
-            $condition['time_stamp'] = [['egt', $start_unixtime], ['lt', $end_unixtime], 'and'];
-        } elseif ($start_unixtime > 0) {
-            $condition['time_stamp'] = ['egt', $start_unixtime];
-        } elseif ($end_unixtime > 0) {
-            $condition['time_stamp'] = ['lt', $end_unixtime];
+        if(!empty($_GET['reload'])) {
+            $stats_list = $model_refill_order->getAllRefillStats($condition);
+            $this->stats_reload($stats_list);
+            $json_str = json_encode($condition);
+            $this->log("对账管理,批量重新统计,条件:{$json_str}", 1);
+            showMessage('操作完成');
         }
-
         $stats_list = $model_refill_order->getOrderStatsList($condition, 50, '*', 'time_stamp desc, cname asc');
         if($type == 'merchant') {
             foreach ($stats_list as $key => $stats) {
@@ -51,6 +46,41 @@ class orderstatsControl extends SystemControl
         Tpl::showpage($page);
     }
 
+    private function stats_reload($stats_list)
+    {
+        foreach ($stats_list as $stats)
+        {
+            if($stats['send_count'] == 0) continue;
+            $cond = [
+                'type' => $stats['type'],
+                'time_stamp' => $stats['time_stamp'],
+                'cid' => $stats['cid'],
+                'order_time_type' => $stats['order_time_type']
+            ];
+            $manager = new task\manager();
+
+            $manager->add_task('order_stat_reload',$cond,0,3600);
+        }
+    }
+
+    private function ct_cond($input,$time_stamp)
+    {
+        $condition['type'] = $input['type'] ?? 'system';
+        if (!empty($input['cid'])) {
+            $condition['cid'] = ['in', $input['cid']];
+        }
+        $start_unixtime = intval(strtotime($input['query_start_time']));
+        $end_unixtime = intval(strtotime($input['query_end_time']));
+        if ($start_unixtime > 0 && $end_unixtime > $start_unixtime) {
+            $condition[$time_stamp] = [['egt', $start_unixtime], ['lt', $end_unixtime], 'and'];
+        } elseif ($start_unixtime > 0) {
+            $condition[$time_stamp] = ['egt', $start_unixtime];
+        } elseif ($end_unixtime > 0) {
+            $condition[$time_stamp] = ['lt', $end_unixtime];
+        }
+        return $condition;
+    }
+
     public function ExportDataOp()
     {
         $type = $_GET['type'] ?? 'system';
@@ -123,4 +153,23 @@ class orderstatsControl extends SystemControl
         }
         return $result;
     }
+
+    public function refill_balanceOp()
+    {
+        $mod = Model('refill_balance');
+        $type = $_GET['type'] ?? 'system';
+        $page = "{$type}.refill.balance";
+
+        $cond = $this->ct_cond($_GET, 'end_stamp');
+        if (!empty($_GET['order_time_type'])) {
+            $cond['time_type'] = $_GET['order_time_type'];
+        }
+        $balance_list = $mod->getBalanceList($cond, 200);
+
+        $order_time_type_text = ['notify_time' => '回调时间', 'order_time' => '下单时间'];
+        Tpl::output('stats_list', $balance_list);
+        Tpl::output('order_time_type_text', $order_time_type_text);
+        Tpl::output('show_page', $mod->showpage());
+        Tpl::showpage($page);
+    }
 }

+ 232 - 3
admin/control/provider.php

@@ -1,8 +1,8 @@
 <?php
 
 include(BASE_CONFIG_PATH . CONFIG_PREFIX . '/refill.ini.php');
-
-require_once (BASE_HELPER_PATH . '/model/member_info.php');
+require_once(BASE_HELPER_PATH . '/model/member_info.php');
+require_once(BASE_HELPER_PATH . '/refill/chprice_helper.php');
 
 class providerControl extends SystemControl
 {
@@ -13,6 +13,7 @@ class providerControl extends SystemControl
 
     public function indexOp()
     {
+        global $config;
         $this->sync_cfgs();
         $provider_model = Model('refill_provider');
         $condition = [];
@@ -44,6 +45,8 @@ class providerControl extends SystemControl
             $pid = $provider['provider_id'];
             $providers[$pid] = $provider;
             $providers[$pid]['available_predeposit'] = 0;
+            $quality_text = $provider['type'] == mtopcard\OilCardPaper ? $config['oil_quality_text'] : $config['phone_quality_text'];
+            $providers[$pid]['quality_text'] = $quality_text[$provider['qualitys']];
             $account_id = intval($provider['account_id']);
             if($account_id > 0) {
                 $mid_pids[$account_id] = $pid;
@@ -78,10 +81,31 @@ class providerControl extends SystemControl
         Tpl::output('type_text', $type_text);
         Tpl::output('provider_list', $providers);
         Tpl::output('stats', $stats);
+        Tpl::output('prices', $this->all_price());
         Tpl::output('show_page', $provider_model->showpage());
         Tpl::showpage('provider.index');
     }
 
+    private function all_price()
+    {
+        $result = [];
+
+        $mod_price = Model('provider_price');
+        $prices = $mod_price->getPirces(['price_id' => ['gt', 0]]);
+        foreach ($prices as $price)
+        {
+            $key = "{$price['provider_name']}-{$price['product_type']}";
+            if(!empty($price['effect_time']))
+            {
+                $time = '<span style="color: #0bb20c">' . date("Y-m-d H:i:s", $price['effect_time']) . '</span>';
+            }else{
+                $time = date("Y-m-d H:i:s", $price['update_time']);
+            }
+            $result[$key] = $time;
+        }
+        return $result;
+    }
+
     public function recharge_manualOp()
     {
         $provider_id = $_GET['provider_id'] ?? $_POST['provider_id'];
@@ -227,7 +251,8 @@ class providerControl extends SystemControl
                 $mod->editProvider($data, ['provider_id' => $provider_id]);
             }
         };
-        $inserter = function ($mod, $type, $names) {
+        $inserter = function ($mod, $type, $names)
+        {
             $model_member = Model('member');
             foreach ($names as $name) {
                 $insert_member = [];
@@ -271,6 +296,9 @@ class providerControl extends SystemControl
         $updater($mod_prov, $oil_updates);
         $updater($mod_prov, $phone_updates);
         $updater($mod_prov, $third_updates);
+
+        $chprice_helper = new refill\chprice_helper();
+        $chprice_helper->update_from_file();
     }
 
     private function ProviderAmountExport($cond)
@@ -323,4 +351,205 @@ class providerControl extends SystemControl
         $excel_obj->addWorksheet($excel_obj->charset(L('exp_od_order'), CHARSET));
         $excel_obj->generateXML('通道调款记录导出-' . date('Y-m-d-H', time()));
     }
+
+    public function file_syncOp()
+    {
+        $chprice_helper = new refill\chprice_helper();
+        $chprice_helper->update_from_file();
+        showMessage('操作完成');
+    }
+
+    public function refresh_priceOp()
+    {
+        $publisher = new message\publisher();
+        $publisher->modify_refill_channel();
+        showMessage('操作完成');
+    }
+
+    public function provider_priceOp()
+    {
+        $provider_id = $_GET['provider_id'];
+        $mod_provider = Model('refill_provider');
+        $mod_price = Model('provider_price');
+
+        $provider = $mod_provider->getProviderInfo(['provider_id' => $provider_id]);
+        $provider_name = $provider['name'];
+        $type = $provider['type'];
+
+        $price = $mod_price->getPirce(['provider_name' => $provider_name,'product_type' => $type]);
+        $cfg = $this->price_cfg($price);
+
+        if(empty($provider)) {
+            showMessage('通道不存在');
+        }
+        if(chksubmit()){
+            $admininfo = $this->getAdminInfo();
+            $new_cfg = $this->cfg_format($_POST, $cfg);
+            $effect_time = $_POST['effect_time'];
+            if(!empty($effect_time))
+            {
+                $effect_time = strtotime($effect_time);
+                if($effect_time < time()) {
+                    $effect_time = 0;
+                }
+            }
+            else {
+                $effect_time = 0;
+            }
+
+            $chprice_helper = new refill\chprice_helper();
+            $ret = $chprice_helper->update($price['price_id'], $new_cfg, $effect_time, $admininfo['name']);
+            if($effect_time > 0) {
+                QueueClient::async_push('AysncChangePrice', ['price_id' => $price['price_id']], $effect_time - time());
+            }
+
+            if($ret) {
+                showMessage('编辑成功');
+            }else{
+                showMessage('编辑失败');
+            }
+        }
+        else
+        {
+            global $config;
+            $all_specs = $this->all_specs($cfg['qualitys'], $type);
+            $amounts   = $this->map_cfg($cfg,$all_specs);
+            $quality_text = $price['product_type'] == mtopcard\OilCardPaper ? $config['oil_quality_text'] : $config['phone_quality_text'];
+            $quality_text = $quality_text[$cfg['qualitys']];
+
+            Tpl::output('provider_name', $cfg['name']);
+            Tpl::output('product_type', $price['product_type']);
+            Tpl::output('quality_text', $quality_text);
+            Tpl::output('quality', $cfg['qualitys']);
+            Tpl::output('effect_time', $price['effect_time']);
+
+            Tpl::output('amounts', $amounts);
+            Tpl::output('all_specs', $all_specs);
+            Tpl::showpage('provider.price.set');
+        }
+    }
+
+    private function price_cfg($price)
+    {
+        $cfg = json_decode($price['cfg'], true);
+        $new_cfg = $price['new_cfg'];
+        if(!empty($new_cfg))
+        {
+            $cfg = json_decode($new_cfg, true);
+        }
+        return $cfg;
+    }
+
+    private function card_types($stypes)
+    {
+        $result = [];
+        $types = explode(',',$stypes);
+        foreach ($types as $stype) {
+            $type = mtopcard\topcard_type($stype);
+            $result[] = $type;
+        }
+        return $result;
+    }
+
+    private function map_cfg($cfg,$all_specs)
+    {
+        $amounts = $cfg['amount'] ?? [];
+
+        $amount_list = [];
+        foreach ($amounts as $spec => $goods)
+        {
+            foreach ($goods as $gitem)
+            {
+                $types = $this->card_types($gitem['card_type']);
+                foreach ($types as $type) {
+                    $amount_list[$type][$spec] = $gitem['price'] ?? 0;
+                }
+            }
+        }
+
+        $result = [];
+        foreach ($all_specs as $card_type => $val)
+        {
+            $specs = $val['specs'];
+            foreach ($specs as $spec)
+            {
+                $result[$card_type][$spec] = ['price' => 0,'opened' => 0];
+            }
+        }
+
+        foreach ($amount_list as $card_type => $prices)
+        {
+            foreach ($prices as $spec => $price)
+            {
+                if (array_key_exists($card_type, $result) && array_key_exists($spec, $result[$card_type])) {
+                    $result[$card_type][$spec]['price'] = $price;
+                    $result[$card_type][$spec]['opened'] = 1;
+                }
+            }
+        }
+
+        return $result;
+    }
+
+    private function all_specs($qualitys, $type): array
+    {
+        global $config;
+        if ($type == mtopcard\OilCardPaper) {
+            $refill_specs = [
+                'petrochina'  =>  $config['refill_oil_specs'],
+                'sinopec'     =>  $config['refill_oil_specs']
+            ];
+        } elseif ($type == mtopcard\PhoneCardPaper) {
+            $refill_specs = [
+                'chinamobile' =>  $config['refill_phone_specs'],
+                'chinaunicom' =>  $config['refill_phone_specs'],
+                'chinatelecom' => $config['refill_phone_specs']
+            ];
+        } else {
+            return [];
+        }
+
+        $all_type_specs = [];
+        foreach ($refill_specs as $scard_type => $specs) {
+            $data = [];
+            $card_type = mtopcard\topcard_type($scard_type);
+
+            if (in_array($card_type, [mtopcard\ChinaMobileCard, mtopcard\ChinaUnicomCard, mtopcard\ChinaTelecomCard])) {
+                if (in_array(refill\Quality::Quick, explode(',', $qualitys))) {
+                    $specs = array_merge($config['refill_phone_small_specs'], $specs);
+                }
+            }
+            $data['goods_name'] = $this->scard_type($card_type);
+            $data['specs'] = $specs;
+            $all_type_specs[$card_type] = $data;
+        }
+        return $all_type_specs;
+    }
+
+    private function cfg_format($input, $cfg)
+    {
+        foreach ($cfg['amount'] as $amount => $amt_items)
+        {
+            $new_amount = [];
+            foreach ($amt_items as $item){
+                $goods_id = $item['goods_id'];
+                $quality = $item['quality'];
+                $card_types = $this->card_types($item['card_type']);
+                foreach ($card_types as $card_type)
+                {
+                    $key = "price-{$card_type}-{$amount}";
+                    $arr = [
+                        'goods_id'  => $goods_id,
+                        'price'     => floatval(ncPriceFormat($input[$key])),
+                        'quality'   => $quality,
+                        'card_type' => mtopcard\scard_type($card_type)
+                    ];
+                    $new_amount[] = $arr;
+                }
+            }
+            $cfg['amount'][$amount] = $new_amount;
+        }
+
+        return $cfg;
+    }
 }

+ 17 - 0
admin/control/provider_group.php

@@ -71,6 +71,23 @@ class provider_groupControl extends SystemControl
             Tpl::showpage('provider.group.edit');
         }
     }
+    
+    public function DelGroupsOp()
+    {
+        $group_ids = $_GET['group_ids'];
+        $cond['group_id'] = ['in', $group_ids];
+        try {
+            $mod = Model('provider_group');
+            $trans = new trans_wapper($mod, __METHOD__);
+            $mod->delGroup($cond);
+            $mod->delGroupInfo($cond);
+            $trans->commit();
+            showMessage('操作成功', 'index.php?act=provider_group&op=index');
+        } catch (Exception $e) {
+            $trans->rollback();
+            showMessage('操作失败', '');
+        }
+    }
 
     public function provider_chooseOp()
     {

+ 7 - 0
admin/control/provider_price.php

@@ -1,5 +1,9 @@
 <?php
+
+use refill\chprice_helper;
+
 include(BASE_CONFIG_PATH . CONFIG_PREFIX . '/refill.ini.php');
+require_once(BASE_HELPER_PATH . '/refill/chprice_helper.php');
 
 class provider_priceControl extends SystemControl
 {
@@ -11,6 +15,9 @@ class provider_priceControl extends SystemControl
     public function indexOp()
     {
         global $config;
+        $chprice_helper = new chprice_helper();
+        $chprice_helper->load_from_db();
+
         $card_type = $_GET['card_type'] ?? mtopcard\PhoneCardPaper;
         if ($card_type == mtopcard\OilCardPaper) {
             $configs = $this->map_cfg($config['oil_providers']);

+ 2 - 0
admin/control/refill_order_manual.php

@@ -51,6 +51,8 @@ class refill_order_manualControl extends SystemControl
             showMessage('手动操作类型错误', 'index.php?act=refill_order&op=index');
         }
         $this->manual_record([$refill_info], $type, $order_id, '手动强制处理');
+        $this->log("手动强制处理,订单号:{$order_info['order_sn']}", 1);
+
         if($refill_info['notify_time'] == 0) {
             $mod_refill->edit($order_id, ['notify_state' =>1, 'notify_time' => time()]);
         }

+ 0 - 3
admin/language/zh/cache.php

@@ -29,9 +29,6 @@ $lang['cache_cls_optionalgoods']= '任选专区信息';
 $lang['cache_cls_goodssampler'] = '红包内推荐商品';
 $lang['cache_cls_bargaingoods'] = '砍价商品';
 $lang['cache_cls_refill_channel'] = '更新渠道缓存';
-
-
-
 $lang['cache_cls_salelist']	    = '手机品牌相关缓存';
 $lang['cache_cls_appversion']	= 'Andrid手机版本信息缓存';
 $lang['cache_cls_ok']			= '更新成功';

+ 319 - 276
admin/templates/default/layout/index_layout.php

@@ -1,296 +1,339 @@
-<?php defined('InShopNC') or exit('Access Invalid!');?>
+<?php defined('InShopNC') or exit('Access Invalid!'); ?>
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" >
+<html xmlns="http://www.w3.org/1999/xhtml">
+
 <head>
-<meta http-equiv="Content-Type" content="text/html;" charset="<?php echo CHARSET;?>">
-<title><?php echo $output['html_title'];?></title>
-<link href="<?php echo ADMIN_TEMPLATES_URL;?>/css/skin_0.css?1" rel="stylesheet" type="text/css" id="cssfile"/>
-
-<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL;?>/js/jquery.js"></script>
-<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL;?>/js/jquery.validation.min.js"></script>
-<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL;?>/js/jquery.cookie.js"></script>
-<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
-<!--[if lt IE 9]>
-      <script src="<?php echo RESOURCE_SITE_URL;?>/js/html5shiv.js"></script>
-      <script src="<?php echo RESOURCE_SITE_URL;?>/js/respond.min.js"></script>
+	<meta http-equiv="Content-Type" content="text/html;" charset="<?php echo CHARSET; ?>">
+	<title><?php echo $output['html_title']; ?></title>
+
+	<link href="<?php echo ADMIN_TEMPLATES_URL; ?>/css/skin_0.css?1" rel="stylesheet" type="text/css" id="cssfile" />
+
+	<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/js/jquery.js"></script>
+	<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/js/jquery.validation.min.js"></script>
+	<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/js/jquery.cookie.js"></script>
+	<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
+	<!--[if lt IE 9]>
+      <script src="<?php echo RESOURCE_SITE_URL; ?>/js/html5shiv.js"></script>
+      <script src="<?php echo RESOURCE_SITE_URL; ?>/js/respond.min.js"></script>
 <![endif]-->
-<script>
-//
-$(document).ready(function () {
-    $('span.bar-btn').click(function () {
-	$('ul.bar-list').toggle('fast');
-    });
-});
-
-$(document).ready(function(){
-	var pagestyle = function() {
-		var iframe = $("#workspace");
-		var h = $(window).height() - iframe.offset().top;
-		var w = $(window).width() - iframe.offset().left;
-		if(h < 300) h = 300;
-		if(w < 973) w = 973;
-		iframe.height(h);
-		iframe.width(w);
-	}
-	pagestyle();
-	$(window).resize(pagestyle);
-	//turn location
-	if($.cookie('now_location_act') != null){
-		openItem($.cookie('now_location_op')+','+$.cookie('now_location_act')+','+$.cookie('now_location_nav'));
-	}else{
-		$('#mainMenu>ul').first().css('display','block');
-		//第一次进入后台时,默认定到欢迎界面
-		$('#item_welcome').addClass('selected');
-		$('#workspace').attr('src','index.php?act=dashboard&op=welcome');
-	}
-	$('#iframe_refresh').click(function(){
-		var fr = document.frames ? document.frames("workspace") : document.getElementById("workspace").contentWindow;;
-		fr.location.reload();
-	});
-
-});
-//收藏夹
-function addBookmark(url, label) {
-    if (document.all)
-    {
-        window.external.addFavorite(url, label);
-    }
-    else if (window.sidebar)
-    {
-        window.sidebar.addPanel(label, url, '');
-    }
-}
-
-
-function openItem(args){
-    closeBg();
-	//cookie
-
-	if($.cookie('<?php echo COOKIE_PRE?>sys_key') === null){
-		location.href = 'index.php?act=login&op=login';
-		return false;
-	}
+	<script>
+		//
+		$(document).ready(function() {
+			$('span.bar-btn').click(function() {
+				$('ul.bar-list').toggle('fast');
+			});
+		});
 
-	spl = args.split(',');
-	op  = spl[0];
-	try {
-		act = spl[1];
-		nav = spl[2];
-	}
-	catch(ex){}
-	if (typeof(act)=='undefined'){var nav = args;}
-	$('.actived').removeClass('actived');
-	$('#nav_'+nav).addClass('actived');
-
-	$('.selected').removeClass('selected');
-
-	//show
-	$('#mainMenu ul').css('display','none');
-	$('#sort_'+nav).css('display','block');
-
-	if (typeof(act)=='undefined'){
-		//顶部菜单事件
-		html = $('#sort_'+nav+'>li>dl>dd>ol>li').first().html();
-		str = html.match(/openItem\('(.*)'\)/ig);
-		arg = str[0].split("'");
-		spl = arg[1].split(',');
-		op  = spl[0];
-		act = spl[1];
-		nav = spl[2];
-		first_obj = $('#sort_'+nav+'>li>dl>dd>ol>li').first().children('a');
-		$(first_obj).addClass('selected');
-		//crumbs
-		$('#crumbs').html('<span>'+$('#nav_'+nav+' > span').html()+'</span><span class="arrow">&nbsp;</span><span>'+$(first_obj).text()+'</span>');
-	}else{
-		//左侧菜单事件
-		//location
-		$.cookie('now_location_nav',nav);
-		$.cookie('now_location_act',act);
-		$.cookie('now_location_op',op);
-		$("a[name='item_"+op+act+"']").addClass('selected');
-		//crumbs
-		$('#crumbs').html('<span>'+$('#nav_'+nav+' > span').html()+'</span><span class="arrow">&nbsp;</span><span>'+$('#item_'+op).html()+'</span>');
-	}
-	src = 'index.php?act='+act+'&op='+op;
-	$('#workspace').attr('src',src);
+		$(document).ready(function() {
+			var pagestyle = function() {
+				var iframe = $("#workspace");
+				var h = $(window).height() - iframe.offset().top;
+				var w = $(window).width() - iframe.offset().left;
+				if (h < 300) h = 300;
+				if (w < 973) w = 973;
+				iframe.height(h);
+				iframe.width(w);
+			}
+			pagestyle();
+			$(window).resize(pagestyle);
+			//turn location
+			if ($.cookie('now_location_act') != null) {
+				openItem($.cookie('now_location_op') + ',' + $.cookie('now_location_act') + ',' + $.cookie('now_location_nav'));
+			} else {
+				$('#mainMenu>ul').first().css('display', 'block');
+				//第一次进入后台时,默认定到欢迎界面
+				$('#item_welcome').addClass('selected');
+				$('#workspace').attr('src', 'index.php?act=dashboard&op=welcome');
+			}
+			$('#iframe_refresh').click(function() {
+				var fr = document.frames ? document.frames("workspace") : document.getElementById("workspace").contentWindow;;
+				fr.location.reload();
+			});
+
+		});
+		//收藏夹
+		function addBookmark(url, label) {
+			if (document.all) {
+				window.external.addFavorite(url, label);
+			} else if (window.sidebar) {
+				window.sidebar.addPanel(label, url, '');
+			}
+		}
+
+
+		function openItem(args) {
+			closeBg();
+			//cookie
+
+			if ($.cookie('<?php echo COOKIE_PRE ?>sys_key') === null) {
+				location.href = 'index.php?act=login&op=login';
+				return false;
+			}
+
+			spl = args.split(',');
+			op = spl[0];
+			try {
+				act = spl[1];
+				nav = spl[2];
+			} catch (ex) {}
+			if (typeof(act) == 'undefined') {
+				var nav = args;
+			}
+			$('.actived').removeClass('actived');
+			$('#nav_' + nav).addClass('actived');
+
+			$('.selected').removeClass('selected');
 
-}
+			//show
+			$('#mainMenu ul').css('display', 'none');
+			$('#sort_' + nav).css('display', 'block');
+
+			if (typeof(act) == 'undefined') {
+				//顶部菜单事件
+				html = $('#sort_' + nav + '>li>dl>dd>ol>li').first().html();
+				str = html.match(/openItem\('(.*)'\)/ig);
+				arg = str[0].split("'");
+				spl = arg[1].split(',');
+				op = spl[0];
+				act = spl[1];
+				nav = spl[2];
+				first_obj = $('#sort_' + nav + '>li>dl>dd>ol>li').first().children('a');
+				$(first_obj).addClass('selected');
+				//crumbs
+				$('#crumbs').html('<span>' + $('#nav_' + nav + ' > span').html() + '</span><span class="arrow">&nbsp;</span><span>' + $(first_obj).text() + '</span>');
+			} else {
+				//左侧菜单事件
+				//location
+				$.cookie('now_location_nav', nav);
+				$.cookie('now_location_act', act);
+				$.cookie('now_location_op', op);
+				$("a[name='item_" + op + act + "']").addClass('selected');
+				//crumbs
+				$('#crumbs').html('<span>' + $('#nav_' + nav + ' > span').html() + '</span><span class="arrow">&nbsp;</span><span>' + $('#item_' + op).html() + '</span>');
+			}
+			src = 'index.php?act=' + act + '&op=' + op;
+			$('#workspace').attr('src', src);
 
-$(function(){
-		bindAdminMenu();
+		}
+
+		$(function() {
+			bindAdminMenu();
 		})
-		function bindAdminMenu(){
-
-		$("[nc_type='parentli']").click(function(){
-			var key = $(this).attr('dataparam');
-			if($(this).find("dd").css("display")=="none"){
-				$("[nc_type='"+key+"']").slideDown("fast");
-				$(this).find('dt').css("background-position","-322px -170px");
-				$(this).find("dd").show();
-			}else{
-				$("[nc_type='"+key+"']").slideUp("fast");
-				$(this).find('dt').css("background-position","-483px -170px");
-				$(this).find("dd").hide();
+
+		function bindAdminMenu() {
+
+			$("[nc_type='parentli']").click(function() {
+				var key = $(this).attr('dataparam');
+				if ($(this).find("dd").css("display") == "none") {
+					$("[nc_type='" + key + "']").slideDown("fast");
+					$(this).find('dt').css("background-position", "-322px -170px");
+					$(this).find("dd").show();
+				} else {
+					$("[nc_type='" + key + "']").slideUp("fast");
+					$(this).find('dt').css("background-position", "-483px -170px");
+					$(this).find("dd").hide();
+				}
+			});
+		}
+	</script>
+	<script type="text/javascript">
+		//显示灰色JS遮罩层
+		function showBg(ct, content) {
+			var bH = $("body").height();
+			var bW = $("body").width();
+			var objWH = getObjWh(ct);
+			$("#pagemask").css({
+				width: bW,
+				height: bH,
+				display: "none"
+			});
+			var tbT = objWH.split("|")[0] + "px";
+			var tbL = objWH.split("|")[1] + "px";
+			$("#" + ct).css({
+				top: tbT,
+				left: tbL,
+				display: "block"
+			});
+			$(window).scroll(function() {
+				resetBg()
+			});
+			$(window).resize(function() {
+				resetBg()
+			});
+		}
+
+		function getObjWh(obj) {
+			var st = document.documentElement.scrollTop; //滚动条距顶部的距离
+			var sl = document.documentElement.scrollLeft; //滚动条距左边的距离
+			var ch = document.documentElement.clientHeight; //屏幕的高度
+			var cw = document.documentElement.clientWidth; //屏幕的宽度
+			var objH = $("#" + obj).height(); //浮动对象的高度
+			var objW = $("#" + obj).width(); //浮动对象的宽度
+			var objT = Number(st) + (Number(ch) - Number(objH)) / 2;
+			var objL = Number(sl) + (Number(cw) - Number(objW)) / 2;
+			return objT + "|" + objL;
+		}
+
+		function resetBg() {
+			var fullbg = $("#pagemask").css("display");
+			if (fullbg == "block") {
+				var bH2 = $("body").height();
+				var bW2 = $("body").width();
+				$("#pagemask").css({
+					width: bW2,
+					height: bH2
+				});
+				var objV = getObjWh("dialog");
+				var tbT = objV.split("|")[0] + "px";
+				var tbL = objV.split("|")[1] + "px";
+				$("#dialog").css({
+					top: tbT,
+					left: tbL
+				});
+			}
+		}
+
+		//关闭灰色JS遮罩层和操作窗口
+		function closeBg() {
+			$("#pagemask").css("display", "none");
+			$("#dialog").css("display", "none");
+		}
+	</script>
+	<script type="text/javascript">
+		$(function() {
+
+			// 主题设置
+
+			$.cookie("MyCssSkin", 'skin_0'); // 默认主题
+
+			// $.cookie("MyCssSkin", 'skin_1'); //黑色主题
+
+
+			var $li = $("#skin li");
+			$li.click(function() {
+				$("#" + this.id).addClass("selected").siblings().removeClass("selected");
+				$("#cssfile").attr("href", "<?php echo ADMIN_TEMPLATES_URL; ?>/css/" + (this.id) + ".css");
+				$.cookie("MyCssSkin", this.id, {
+					path: '/',
+					expires: 10
+				});
+
+				$('iframe').contents().find('#cssfile2').attr("href", "<?php echo ADMIN_TEMPLATES_URL; ?>/css/" + (this.id) + ".css");
+			});
+
+			var cookie_skin = $.cookie("MyCssSkin");
+			if (cookie_skin) {
+				$("#" + cookie_skin).addClass("selected").siblings().removeClass("selected");
+				$("#cssfile").attr("href", "<?php echo ADMIN_TEMPLATES_URL; ?>/css/" + cookie_skin + ".css");
+				$.cookie("MyCssSkin", cookie_skin, {
+					path: '/',
+					expires: 10
+				});
 			}
 		});
-	}
-</script>
-<script type="text/javascript">
-//显示灰色JS遮罩层
-function showBg(ct,content){
-var bH=$("body").height();
-var bW=$("body").width();
-var objWH=getObjWh(ct);
-$("#pagemask").css({width:bW,height:bH,display:"none"});
-var tbT=objWH.split("|")[0]+"px";
-var tbL=objWH.split("|")[1]+"px";
-$("#"+ct).css({top:tbT,left:tbL,display:"block"});
-$(window).scroll(function(){resetBg()});
-$(window).resize(function(){resetBg()});
-}
-function getObjWh(obj){
-var st=document.documentElement.scrollTop;//滚动条距顶部的距离
-var sl=document.documentElement.scrollLeft;//滚动条距左边的距离
-var ch=document.documentElement.clientHeight;//屏幕的高度
-var cw=document.documentElement.clientWidth;//屏幕的宽度
-var objH=$("#"+obj).height();//浮动对象的高度
-var objW=$("#"+obj).width();//浮动对象的宽度
-var objT=Number(st)+(Number(ch)-Number(objH))/2;
-var objL=Number(sl)+(Number(cw)-Number(objW))/2;
-return objT+"|"+objL;
-}
-function resetBg(){
-var fullbg=$("#pagemask").css("display");
-if(fullbg=="block"){
-var bH2=$("body").height();
-var bW2=$("body").width();
-$("#pagemask").css({width:bW2,height:bH2});
-var objV=getObjWh("dialog");
-var tbT=objV.split("|")[0]+"px";
-var tbL=objV.split("|")[1]+"px";
-$("#dialog").css({top:tbT,left:tbL});
-}
-}
-
-//关闭灰色JS遮罩层和操作窗口
-function closeBg(){
-$("#pagemask").css("display","none");
-$("#dialog").css("display","none");
-}
-</script>
-<script type="text/javascript">
-$(function(){
-    var $li =$("#skin li");
-		$li.click(function(){
-		$("#"+this.id).addClass("selected").siblings().removeClass("selected");
-		$("#cssfile").attr("href","<?php echo ADMIN_TEMPLATES_URL;?>/css/"+ (this.id) +".css");
-        $.cookie( "MyCssSkin" ,  this.id , { path: '/', expires: 10 });
-
-        $('iframe').contents().find('#cssfile2').attr("href","<?php echo ADMIN_TEMPLATES_URL;?>/css/"+ (this.id) +".css");
-    });
-
-    var cookie_skin = $.cookie( "MyCssSkin");
-    if (cookie_skin) {
-		$("#"+cookie_skin).addClass("selected").siblings().removeClass("selected");
-		$("#cssfile").attr("href","<?php echo ADMIN_TEMPLATES_URL;?>/css/"+ cookie_skin +".css");
-		$.cookie( "MyCssSkin" ,  cookie_skin  , { path: '/', expires: 10 });
-    }
-});
-function addFavorite(url, title) {
-	try {
-		window.external.addFavorite(url, title);
-	} catch (e){
-		try {
-			window.sidebar.addPanel(title, url, '');
-        	} catch (e) {
-			showDialog("<?php echo $lang['nc_to_favorite'];?>", 'notice');
+
+		function addFavorite(url, title) {
+			try {
+				window.external.addFavorite(url, title);
+			} catch (e) {
+				try {
+					window.sidebar.addPanel(title, url, '');
+				} catch (e) {
+					showDialog("<?php echo $lang['nc_to_favorite']; ?>", 'notice');
+				}
+			}
 		}
-	}
-}
-</script>
+	</script>
 
 </head>
 
 <body style="min-width: 1200px; margin: 0px; ">
-<div id="pagemask"></div>
-<div id="dialog" style="display:none">
-  <div class="title">
-    <h3><?php echo $lang['nc_admin_navigation'];?></h3>
-    <span><a href="JavaScript:void(0);" onclick="closeBg();"><?php echo $lang['nc_close'];?></a></span> </div>
-  <div class="content">
-  <?php foreach ($output['map_nav'] as $k=>$v) {?>
-  <dl>
-  <dt><?php echo $v['text'];?></dt>
-  	<?php foreach ($v['list'] as $key=>$value) {?>
-  	<dd><a href="javascript:void(0)" onclick="openItem('<?php echo $value['args']?>')"><?php echo $value['text'];?></a></dd>
-  	<?php }?>
-  	 </dl>
-  <?php }?>
-  </div>
-</div>
-<table style="width: 100%;" id="frametable" height="100%" width="100%" cellpadding="0" cellspacing="0">
-  <tbody>
-    <tr>
-      <td colspan="2" height="90" class="mainhd"><div class="layout-header"> <!-- Title/Logo - can use text instead of image -->
-          <div id="title"><a href="index.php"></a></div>
-          <!-- Top navigation -->
-          <div id="topnav" class="top-nav">
-            <ul>
-              <li class="adminid" title="<?php echo $lang['nc_hello'];?>:<?php echo $output['admin_info']['name'];?>"><?php echo $lang['nc_hello'];?>&nbsp;:&nbsp;<strong><?php echo $output['admin_info']['name'];?></strong></li>
-              <li><a href="index.php?act=index&op=modifypw" target="workspace" ><span><?php echo $lang['nc_modifypw']; ?></span></a></li>
-              <li><a href="index.php?act=index&op=logout" title="<?php echo $lang['nc_logout'];?>"><span><?php echo $lang['nc_logout'];?></span></a></li>
-              <li><a href="<?php echo BASE_SITE_URL;?>" target="_blank" title="<?php echo $lang['nc_homepage'];?>"><span><?php echo $lang['nc_homepage'];?></span></a></li>
-            </ul>
-          </div>
-          <!-- End of Top navigation -->
-          <!-- Main navigation -->
-          <nav id="nav" class="main-nav">
-            <ul>
-           <?php echo $output['top_nav'];?>
-            </ul>
-          </nav>
-          <div class="loca"><strong><?php echo $lang['nc_loca'];?>:</strong>
-            <div id="crumbs" class="crumbs"><span><?php echo $lang['nc_console'];?></span><span class="arrow">&nbsp;</span><span><?php echo $lang['nc_welcome_page'];?></span> </div>
-          </div>
-          <div class="toolbar">
-            <ul id="skin" class="skin"><span><?php echo $lang['nc_skin_peeler'];?></span>
-              <li id="skin_0" class="" title="<?php echo $lang['nc_default_style'];?>"></li>
-              <li id="skin_1" class="" title="<?php echo $lang['nc_mac_style'];?>"></li>
-            </ul>
-            <div class="sitemap"><a id="siteMapBtn" href="#rhis" onclick="showBg('dialog','dialog_content');"><span><?php echo $lang['nc_sitemap'];?></span></a></div>
-            <div class="toolmenu"><span class="bar-btn"></span>
-              <ul class="bar-list">
-                <li><a onclick="openItem('clear,cache,setting');" href="javascript:void(0)"><?php echo $lang['nc_update_cache'];?></a></li>
-                <li><a href="<?php echo ADMIN_SITE_URL;?>" id="iframe_refresh"><?php echo $lang['nc_refresh'];?><?php echo $lang['nc_admincp']; ?></a></li>
-                <li><a href="<?php echo ADMIN_SITE_URL;?>" title="<?php echo $lang['nc_admincp']; ?>-<?php echo $output['html_title'];?>" rel="sidebar" onclick="addFavorite('<?php echo ADMIN_SITE_URL;?>', '<?php echo $lang['nc_admincp']; ?>-<?php echo $output['html_title'];?>');return false;"><?php echo $lang['nc_favorite']; ?><?php echo $lang['nc_admincp']; ?></a></li>
-                <!--//zmr>v30-->
-                <li><a href="index.php?act=setting&op=exetarget" target="_blank">执行计划任务</a></li>
-              </ul>
-            </div>
-          </div>
-        </div>
-        <div > </div></td>
-    </tr>
-    <tr>
-      <td class="menutd" valign="top" width="161"><div id="mainMenu" class="main-menu">
-          <?php echo $output['left_nav'];?>
-        </div><div class="copyright" style="display:none"></div></td>
-      <td valign="top" width="100%"><iframe src="" id="workspace" name="workspace" style="overflow: visible;" frameborder="0" width="100%" height="100%" scrolling="yes" onload="window.parent"></iframe></td>
-    </tr>
-  </tbody>
-</table>
+	<div id="pagemask"></div>
+	<div id="dialog" style="display:none">
+		<div class="title">
+			<h3><?php echo $lang['nc_admin_navigation']; ?></h3>
+			<span><a href="JavaScript:void(0);" onclick="closeBg();"><?php echo $lang['nc_close']; ?></a></span>
+		</div>
+		<div class="content">
+			<?php foreach ($output['map_nav'] as $k => $v) { ?>
+				<dl>
+					<dt><?php echo $v['text']; ?></dt>
+					<?php foreach ($v['list'] as $key => $value) { ?>
+						<dd><a href="javascript:void(0)" onclick="openItem('<?php echo $value['args'] ?>')"><?php echo $value['text']; ?></a></dd>
+					<?php } ?>
+				</dl>
+			<?php } ?>
+		</div>
+	</div>
+	<table style="width: 100%;" id="frametable" height="100%" width="100%" cellpadding="0" cellspacing="0">
+		<tbody>
+			<tr>
+				<td colspan="2" height="90" class="mainhd">
+					<div class="layout-header">
+						<!-- Title/Logo - can use text instead of image -->
+						<div id="title"><a href="index.php"></a></div>
+						<!-- Top navigation -->
+						<div id="topnav" class="top-nav">
+							<ul>
+								<li class="adminid" title="<?php echo $lang['nc_hello']; ?>:<?php echo $output['admin_info']['name']; ?>"><?php echo $lang['nc_hello']; ?>&nbsp;:&nbsp;<strong><?php echo $output['admin_info']['name']; ?></strong></li>
+								<li><a href="index.php?act=index&op=modifypw" target="workspace"><span><?php echo $lang['nc_modifypw']; ?></span></a></li>
+								<li><a href="index.php?act=index&op=logout" title="<?php echo $lang['nc_logout']; ?>"><span><?php echo $lang['nc_logout']; ?></span></a></li>
+								<li><a href="<?php echo BASE_SITE_URL; ?>" target="_blank" title="<?php echo $lang['nc_homepage']; ?>"><span><?php echo $lang['nc_homepage']; ?></span></a></li>
+							</ul>
+						</div>
+						<!-- End of Top navigation -->
+						<!-- Main navigation -->
+						<nav id="nav" class="main-nav">
+							<ul>
+								<?php echo $output['top_nav']; ?>
+							</ul>
+						</nav>
+						<div class="loca"><strong><?php echo $lang['nc_loca']; ?>:</strong>
+							<div id="crumbs" class="crumbs"><span><?php echo $lang['nc_console']; ?></span><span class="arrow">&nbsp;</span><span><?php echo $lang['nc_welcome_page']; ?></span> </div>
+						</div>
+						<div class="toolbar">
+							<ul id="skin" class="skin"><span><?php echo $lang['nc_skin_peeler']; ?></span>
+								<li id="skin_0" class="" title="<?php echo $lang['nc_default_style']; ?>"></li>
+								<li id="skin_1" class="" title="<?php echo $lang['nc_mac_style']; ?>"></li>
+							</ul>
+							<div class="sitemap"><a id="siteMapBtn" href="#rhis" onclick="showBg('dialog','dialog_content');"><span><?php echo $lang['nc_sitemap']; ?></span></a></div>
+							<div class="toolmenu"><span class="bar-btn"></span>
+								<ul class="bar-list">
+									<li><a onclick="openItem('clear,cache,setting');" href="javascript:void(0)"><?php echo $lang['nc_update_cache']; ?></a></li>
+									<li><a href="<?php echo ADMIN_SITE_URL; ?>" id="iframe_refresh"><?php echo $lang['nc_refresh']; ?><?php echo $lang['nc_admincp']; ?></a></li>
+									<li><a href="<?php echo ADMIN_SITE_URL; ?>" title="<?php echo $lang['nc_admincp']; ?>-<?php echo $output['html_title']; ?>" rel="sidebar" onclick="addFavorite('<?php echo ADMIN_SITE_URL; ?>', '<?php echo $lang['nc_admincp']; ?>-<?php echo $output['html_title']; ?>');return false;"><?php echo $lang['nc_favorite']; ?><?php echo $lang['nc_admincp']; ?></a></li>
+									<!--//zmr>v30-->
+									<li><a href="index.php?act=setting&op=exetarget" target="_blank">执行计划任务</a></li>
+								</ul>
+							</div>
+						</div>
+					</div>
+					<div> </div>
+				</td>
+			</tr>
+			<tr>
+				<td class="menutd" valign="top" width="161">
+					<div id="mainMenu" class="main-menu">
+						<?php echo $output['left_nav']; ?>
+					</div>
+					<div class="copyright" style="display:none"></div>
+				</td>
+				<td valign="top" width="100%"><iframe src="" id="workspace" name="workspace" style="overflow: visible;" frameborder="0" width="100%" height="100%" scrolling="yes" onload="window.parent"></iframe></td>
+			</tr>
+		</tbody>
+	</table>
 </body>
 <script>
-    init_notice();
-
-    function init_notice(){
-        var room_certs = "<?php echo $output['notice']['certs_num']; ?>";
+	init_notice();
 
-        if(room_certs > 0) {
-            var html = '<span>群聊('+room_certs+')</span>';
-            $("#nav_room").html(html);
-        }
-    }
+	function init_notice() {
+		var room_certs = "<?php echo $output['notice']['certs_num']; ?>";
 
+		if (room_certs > 0) {
+			var html = '<span>群聊(' + room_certs + ')</span>';
+			$("#nav_room").html(html);
+		}
+	}
 </script>
+
 </html>

+ 19 - 4
admin/templates/default/merchant.order.stats.php

@@ -31,6 +31,9 @@
                 <li><a href="index.php?act=OrderStats&op=index&type=system"><span>平台对账记录</span></a></li>
                 <li><a href="index.php?act=OrderStats&op=index&type=provider"><span>上游对账记录</span></a></li>
                 <li><a href="JavaScript:void(0);" class="current"><span>下游对账记录</span></a></li>
+                <li><a href="index.php?act=OrderStats&op=refill_balance&type=system"><span>平台结余记录</span></a></li>
+                <li><a href="index.php?act=OrderStats&op=refill_balance&type=provider"><span>上游结余记录</span></a></li>
+                <li><a href="index.php?act=OrderStats&op=refill_balance&type=merchant"><span>下游结余记录</span></a></li>
             </ul>
         </div>
     </div>
@@ -41,7 +44,7 @@
         <input type="hidden" value="merchant" name="type">
         <input type="hidden" name="cid" value=""/>
         <input type="hidden" name="default_no_mch" value="<?php echo $_GET['cid']; ?>"/>
-        
+        <input type="hidden" name="reload" value=""/>
         <table class="tb-type1 noborder search">
             <tbody>
             <tr>
@@ -84,6 +87,11 @@
                         <span>导出</span>
                     </a>
                 </td>
+                <td>
+                    <a href="javascript:void(0);" id="ncreload" class="btn">
+                        <span>批量重新统计</span>
+                    </a>
+                </td>
             </tr>
             </tbody>
         </table>
@@ -238,8 +246,16 @@
       href="<?php echo ADMIN_TEMPLATES_URL; ?>/layui/css/layui.css"/>
 <script>
     $(function () {
+        $("#ncreload").click(function () {
+            $('input[name="reload"]').val('1');
+            select_set()
+            $('#formSearch').submit();
+        })
         $('#ncsubmit').click(function () {
-            $('input[name="op"]').val('index');
+            select_set()
+            $('#formSearch').submit();
+        });
+        function select_set(){
             let selectArr = selest_nc.getValue();
             let selectStr = ''
             for (let i = 0; i < selectArr.length; i++) {
@@ -248,8 +264,7 @@
             selectStr = selectStr.substr(0, selectStr.length-1)
             $('input[name="cid"]').val(selectStr);
             console.log("selectStr", selectStr);
-            $('#formSearch').submit();
-        });
+        }
         // 日期选择器
         laydate.render({
             elem: '#startTime',

+ 381 - 0
admin/templates/default/merchant.refill.balance.php

@@ -0,0 +1,381 @@
+<?php defined('InShopNC') or exit('Access Invalid!'); ?>
+<style>
+    .page .fixed-bar .item-title h3 {
+        margin-top:18px !important;
+        margin-bottom:10px !important;
+        font-weight:700 !important;
+    }
+    .tab-base li span {
+        font-size:12px !important;
+    }
+    .layui-form-select .layui-input {
+        height:26px;
+    }
+    input::placeholder{ 
+        color:#333; 
+    }
+    .row_q ul li {
+        height: 30px;
+        line-height: 30px;
+    }
+    .row_w {
+        float: left;
+        margin-right: 40px;
+    }
+</style>
+<div class="page">
+    <div class="fixed-bar">
+        <div class="item-title">
+            <h3>对账管理</h3>
+            <ul class="tab-base">
+                <li><a href="index.php?act=OrderStats&op=index&type=system"><span>平台对账记录</span></a></li>
+                <li><a href="index.php?act=OrderStats&op=index&type=provider"><span>上游对账记录</span></a></li>
+                <li><a href="index.php?act=OrderStats&op=index&type=merchant"><span>下游对账记录</span></a></li>
+                <li><a href="index.php?act=OrderStats&op=refill_balance&type=system"><span>平台结余记录</span></a></li>
+                <li><a href="index.php?act=OrderStats&op=refill_balance&type=provider"><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 method="get" name="formSearch" id="formSearch" class="layui-form">
+        <input type="hidden" value="OrderStats" name="act">
+        <input type="hidden" value="refill_balance" name="op">
+        <input type="hidden" value="merchant" name="type">
+        <input type="hidden" name="cid" value=""/>
+        <input type="hidden" name="default_no_mch" value="<?php echo $_GET['cid']; ?>"/>
+        
+        <table class="tb-type1 noborder search">
+            <tbody>
+            <tr>
+                <th><label for="query_start_time">统计时间</label></th>
+                <td>
+                    <input class="txt date" type="text" value="<?php echo $_GET['query_start_time']; ?>"
+                           id="startTime" name="query_start_time" autocomplete="off" style="width:120px" />
+                    <label for="query_start_time">~</label>
+                    <input class="txt date" type="text" value="<?php echo $_GET['query_end_time']; ?>"
+                           id="endTime" name="query_end_time" autocomplete="off" style="width:120px" />
+                </td>
+                <th><label>统计日期类型</label></th>
+                <td>
+                    <select name="order_time_type" id="order_time_type">
+                        <option value="">请选择...</option>
+                        <option value="notify_time" <?php if($_GET['order_time_type'] == 'notify_time'){ echo 'selected';}?>>回调日期</option>
+                        <option value="order_time" <?php if($_GET['order_time_type'] == 'order_time'){ echo 'selected';}?>>下单日期</option>
+                    </select>
+                </td>
+                <th><label>商户名称</label></th>
+                <td>
+                    <!-- <select name="cid" id="cid" class="querySelect" lay-verify="" lay-search>
+                        <option value=""><?php echo $lang['nc_please_choose']; ?></option>
+                        <?php foreach($output['merchant_list'] as $merchant){?>
+                            <option value="<?php echo $merchant['mchid']?>"
+                                    <?php if ($_GET['cid'] == $merchant['mchid']){ ?>selected<?php } ?>><?php echo $merchant['company_name'] == '' ? $merchant['name'] : $merchant['company_name'];?>
+                            </option>
+                        <?php }?>
+                    </select> -->
+                    <div id="selest_nc"></div>
+                </td>
+                <td><a href="javascript:void(0);" id="ncsubmit" class="btn-search "
+                       title="<?php echo $lang['nc_query']; ?>">&nbsp;</a>
+                    <?php if ($output['mch_name'] != '') { ?>
+                        <a href="index.php?act=OrderStats&op=index" class="btns "
+                           title="<?php echo $lang['nc_cancel_search']; ?>"><span><?php echo $lang['nc_cancel_search']; ?></span></a>
+                    <?php } ?></td>
+<!--                <td>-->
+<!--                    <a href="javascript:void(0);" id="ncexport" class="btn">-->
+<!--                        <span>导出</span>-->
+<!--                    </a>-->
+<!--                </td>-->
+            </tr>
+            </tbody>
+        </table>
+    </form>
+<!--    <table class="table tb-type2" id="prompt">-->
+<!--        <tbody>-->
+<!--        <tr class="space odd">-->
+<!--            <th colspan="12"><div class="title">-->
+<!--                    <h5>总量统计</h5>-->
+<!--                    <span class="arrow"></span></div></th>-->
+<!--        </tr>-->
+<!--        <tr>-->
+<!--            <td class="row_q">-->
+<!--                <ul class="row_w">-->
+<!--                    <li>回调日期统计</li>-->
+<!--                    <li class="lineLi" style="color:#000;">总计成功订单量: --><?php //echo $output['total_stats']['notify_time']['success_count_total'] ?? 0?><!--</li>-->
+<!--                    <li class="lineLi" style="color:#000;">总计充值中订单量: --><?php //echo $output['total_stats']['notify_time']['send_count_total'] ?? 0?><!--</li>-->
+<!--                    <li class="lineLi" style="color:#000;">总计成功订单金额:--><?php //echo $output['total_stats']['notify_time']['success_refill_amounts_total'] ?? 0?><!--</li>-->
+<!--                    <li class="lineLi" style="color:#000;">总计下游扣款金额:--><?php //echo $output['total_stats']['notify_time']['success_mch_amounts_toatl'] ?? 0?><!--</li>-->
+<!--                    <li class="lineLi" style="color:#000;">总计上游扣款金额:--><?php //echo $output['total_stats']['notify_time']['success_channel_amounts_total'] ?? 0?><!--</li>-->
+<!--                </ul>-->
+<!--                <ul>-->
+<!--                    <li>下单日期统计</li>-->
+<!--                    <li class="lineLi" style="color:#000;">总计成功订单量: --><?php //echo $output['total_stats']['order_time']['success_count_total'] ?? 0?><!--</li>-->
+<!--                    <li class="lineLi" style="color:#000;">总计充值中订单量: --><?php //echo $output['total_stats']['order_time']['send_count_total'] ?? 0?><!--</li>-->
+<!--                    <li class="lineLi" style="color:#000;">总计成功订单金额:--><?php //echo $output['total_stats']['order_time']['success_refill_amounts_total'] ?? 0?><!--</li>-->
+<!--                    <li class="lineLi" style="color:#000;">总计下游扣款金额:--><?php //echo $output['total_stats']['order_time']['success_mch_amounts_toatl'] ?? 0?><!--</li>-->
+<!--                    <li class="lineLi" style="color:#000;">总计上游扣款金额:--><?php //echo $output['total_stats']['order_time']['success_channel_amounts_total'] ?? 0?><!--</li>-->
+<!--                </ul>-->
+<!--            </td>-->
+<!--        </tr>-->
+<!--        </tbody>-->
+<!--    </table>-->
+    <form method="post" id="merchant_name_form">
+        <input type="hidden" name="form_submit" value="ok"/>
+        <table class="table tb-type2">
+            <thead>
+            <tr class="thead">
+                <th>记录ID</th>
+                <th>父ID</th>
+                <th>主体名称</th>
+                <th>主体ID</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-left">更新日期</th>
+                <th class="align-center">确认状态</th>
+                <th class="align-center">统计日期类型</th>
+                <th class="align-left">备注</th>
+<!--                <th class="align-center">操作</th>-->
+            </tr>
+            </thead>
+            <tbody>
+            <?php if (!empty($output['stats_list']) && is_array($output['stats_list'])) { ?>
+                <?php foreach ($output['stats_list'] as $k => $v) { ?>
+                    <tr class="trFlex">
+                        <td><?php echo $v['balance_id']; ?></td>
+                        <td><?php echo $v['parent_id']; ?></td>
+                        <td><?php echo $v['cname']; ?></td>
+                        <td><?php echo $v['cid']; ?></td>
+                        <td class="align-left"><?php echo $v['start_stamp'] ? date('Y-m-d H:i', $v['start_stamp']) : '/'; ?></td>
+                        <td class="align-left"><?php echo $v['end_text']; ?></td>
+                        <td class="align-center"><?php echo $v['success_count']; ?></td>
+                        <td class="align-center"><?php echo $v['refill_amount']; ?></td>
+                        <td class="align-center"><?php echo $v['mch_amount']; ?></td>
+                        <td class="align-center"><?php echo $v['channel_amount']; ?></td>
+                        <td class="align-center"><?php echo $v['profit_amount']; ?></td>
+                        <td class="align-center"><?php echo $v['transfer_in']; ?></td>
+                        <td class="align-center"><?php echo $v['transfer_out']; ?></td>
+                        <td class="align-center"><?php echo $v['refund_amount']; ?></td>
+                        <td class="align-center"><?php echo $v['except_amount']; ?></td>
+                        <td class="align-center"><?php echo $v['accumulate_balance']; ?></td>
+                        <td class="align-center"><?php echo $v['balance']; ?></td>
+                        <td class="align-left"><?php echo date("Y-m-d H:i:s", $v['update_time']); ?></td>
+                        <td class="align-center">
+                            <?php if($v['confirmed'] == 0){?>
+                                <span style="color: #fd9d0e">未确认</span>
+                            <?php }else{?>
+                                <span style="color: #0bb20c">已确认</span>
+                            <?php }?>
+                        </td>
+                        <td class="align-center"><?php echo $output['order_time_type_text'][$v['time_type']]; ?></td>
+                        <td class="align-left"><?php echo $v['remark']; ?></td>
+<!--                        <td class="align-center w200">-->
+<!--                            <a href="index.php?act=merchant&op=OrderStatsReload&stat_id=--><?php //echo $v['stat_id'];?><!--">重新统计</a>-->
+<!--                            |<a href="index.php?act=merchant&op=OrderStatsCheck&stat_id=--><?php //echo $v['stat_id'] ?><!--">编辑</a>-->
+<!--                        </td>-->
+                    </tr>
+                <?php } ?>
+            <?php } else { ?>
+                <tr class="no_data">
+                    <td colspan="19"><?php echo $lang['nc_no_record']; ?></td>
+                </tr>
+            <?php } ?>
+            </tbody>
+            <tfoot>
+            <tr class="tfoot">
+                <td></td>
+                <td colspan="19">
+                    <div class="pagination"><?php echo $output['show_page']; ?></div>
+                </td>
+            </tr>
+            </tfoot>
+        </table>
+    </form>
+</div>
+<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/js/jquery.edit.js" charset="utf-8"></script>
+<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/laydate/laydate.js"></script>
+<script type="text/javascript" src="<?php echo ADMIN_TEMPLATES_URL;?>/js/xm-select.js"></script>
+<script type="text/javascript" src="<?php echo ADMIN_TEMPLATES_URL;?>/layui/layui.js"></script>
+<link rel="stylesheet" type="text/css"
+      href="<?php echo ADMIN_TEMPLATES_URL; ?>/layui/css/layui.css"/>
+<script>
+    $(function () {
+        $('#ncsubmit').click(function () {
+            let selectArr = selest_nc.getValue();
+            let selectStr = ''
+            for (let i = 0; i < selectArr.length; i++) {
+                selectStr += selectArr[i].value+','
+            }
+            selectStr = selectStr.substr(0, selectStr.length-1)
+            $('input[name="cid"]').val(selectStr);
+            console.log("selectStr", selectStr);
+            $('#formSearch').submit();
+        });
+        // 日期选择器
+        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'
+            })
+        })
+        function JSONToExcelConvertor(JSONData, FileName, ShowLabel, headData) { 
+            //先转化json 
+            let arrData = typeof JSONData != 'object' ? JSON.parse(JSONData) : JSONData; 
+            let excel = '<table>';   
+            // 标题
+            for (const key in headData) {
+                var head = "<tr>";
+                var td = "<td colspan='12' style='font-size:16px;'>"+ headData[key] + '</td>';
+                excel += td + "</tr>";
+            }
+            //设置表头 
+            var row = "<tr>"; 
+            for (var i = 0, l = ShowLabel.length; i < l; i++) { 
+                row += "<th style='font-size:14px;'>" + ShowLabel[i].value + '</th>'; 
+            } 
+            //换行 
+            excel += row + "</tr>"; 
+            //设置数据 
+            for (var i = 0; i < arrData.length; i++) { 
+                var row = "<tr>"; 
+                let code = i+1
+                row += "<td>" +code+ "</td>"
+                row += '<td style=font-size:14px;'+ 'mso-number-format:"\@"'+ '>' + arrData[i].time_text + '</td>';
+                row += '<td style=font-size:14px;'+ 'mso-number-format:"\@"'+ '>' + arrData[i].cname + '</td>';
+                row += '<td style=font-size:14px;'+ 'mso-number-format:"\@"'+ '>' + arrData[i].cid + '</td>';
+                row += '<td style=font-size:14px;'+ 'mso-number-format:"\@"'+ '>' + arrData[i].success_count + '</td>';
+                row += '<td style=font-size:14px;'+ 'mso-number-format:"\@"'+ '>' + arrData[i].success_refill_amounts + '</td>';
+                row += '<td style=font-size:14px;'+ 'mso-number-format:"\@"'+ '>' + arrData[i].success_mch_amounts + '</td>';
+                row += '<td style=font-size:14px;'+ 'mso-number-format:"\@"'+ '>' + arrData[i].success_channel_amounts + '</td>';
+                row += '<td style=font-size:14px;'+ 'mso-number-format:"\@"'+ '>' + arrData[i].profit_amounts + '</td>';
+                row += '<td style=font-size:14px;'+ 'mso-number-format:"\@"'+ '>' + arrData[i].order_count + '</td>';
+                row += '<td style=font-size:14px;'+ 'mso-number-format:"\@"'+ '>' + arrData[i].cancel_count + '</td>';
+                row += '<td style=font-size:14px;'+ 'mso-number-format:"\@"'+ '>' + arrData[i].success_ratio + '</td>';
+                excel += row + "</tr>"; 
+            } 
+            excel += "</table>"; 
+                var excelFile = "<html xmlns:o='urn:schemas-microsoft-com:office:office' xmlns:x='urn:schemas-microsoft-com:office:excel' xmlns='http://www.w3.org/TR/REC-html40'>"; 
+                excelFile += '<meta http-equiv="content-type" content="application/vnd.ms-excel; charset=UTF-8">'; 
+                excelFile += '<meta http-equiv="content-type" content="application/vnd.ms-excel'; 
+                excelFile += '; charset=UTF-8">'; 
+                excelFile += "<head>"; 
+                excelFile += "<!--[if gte mso 9]>"; 
+                excelFile += "<xml>"; 
+                excelFile += "<x:ExcelWorkbook>"; 
+                excelFile += "<x:ExcelWorksheets>"; 
+                excelFile += "<x:ExcelWorksheet>"; 
+                excelFile += "<x:Name>"; 
+                excelFile += "{worksheet}"; 
+                excelFile += "</x:Name>"; 
+                excelFile += "<x:WorksheetOptions>"; 
+                excelFile += "<x:DisplayGridlines/>"; 
+                excelFile += "</x:WorksheetOptions>"; 
+                excelFile += "</x:ExcelWorksheet>"; 
+                excelFile += "</x:ExcelWorksheets>"; 
+                excelFile += "</x:ExcelWorkbook>"; 
+                excelFile += "</xml>"; 
+                excelFile += "<![endif]-->"; 
+                excelFile += "</head>"; 
+                excelFile += "<body>"; 
+                excelFile += excel; 
+                excelFile += "</body>"; 
+                excelFile += "</html>"; 
+                var uri = 'data:application/vnd.ms-excel;charset=utf-8,' + encodeURIComponent(excelFile); 
+                var link = document.createElement("a");   
+                link.href = uri; 
+                link.style = "visibility:hidden"; 
+                link.download = FileName + ".xls"; 
+                document.body.appendChild(link); 
+                link.click(); 
+                document.body.removeChild(link); 
+        }
+        $('#ncexport').click(function () {
+            let selectArr = selest_nc.getValue();
+            let selectStr = ''
+            for (let i = 0; i < selectArr.length; i++) {
+                selectStr += selectArr[i].value+','
+            }
+            selectStr = selectStr.substr(0, selectStr.length-1)
+
+            let starTime = new Date($('input[name="query_start_time"]').val()).getTime()/1000;
+            let endTime = new Date($('input[name="query_end_time"]').val()).getTime()/1000;
+            let cid = selectStr
+            let order_time_type = $('#order_time_type').val()
+            $.get('index.php?act=orderstats&op=ExportData&type=merchant', {
+                query_start_time: starTime,
+                query_end_time: endTime,
+                cid: cid,
+                order_time_type:order_time_type
+            }, function (data) {
+                data = JSON.parse(data)
+                if (data && data.data) {
+                    let head = ['北京椰子电子商务有限责任公司']
+                    let time = ''
+                    if (starTime && endTime) {
+                        time = '统计时间:'+$('input[name="query_start_time"]').val()+' - '+$('input[name="query_end_time"]').val()
+                    } else if (starTime) {
+                        time = '统计时间:'+$('input[name="query_start_time"]').val()
+                    }
+                    if (time) {
+                        head.push(time)
+                    }
+                    head.push('总计成功订单数量:' + parseInt(data.total_stats.success_count_total))
+                    head.push('总计成功订单金额:' + parseFloat(data.total_stats.success_refill_amounts_total))
+                    head.push('总计下游扣款金额:' + parseFloat(data.total_stats.success_mch_amounts_toatl))
+                    head.push('总计上游扣款金额:' + parseFloat(data.total_stats.success_channel_amounts_total))
+                    head.push('总计利润金额:' + parseFloat(data.total_stats.profit_amounts_total))
+                    let title = [{value: "序号"},{value: "统计日期"},{value: "主体名称"},{value: "主体ID"},{value: "成功订单数"},{value: "成功金额"},{value: "下游金额"},{value: "上游金额"},{value: "利润"},{value: "订单总量"}, {value: "失败订单数量"},{value: "成功占比"}]
+                    JSONToExcelConvertor(data.data, '下游对账记录', title, head)
+                }
+            })
+        })
+        //多选
+    let selest_nc
+    let default_no_mch = $('input[name="default_no_mch"]').val().split(',');
+    $.get('index.php?act=refill_order&op=merchant_data', function (data) {
+        data = JSON.parse(data)
+        if (default_no_mch) {
+            for (let index = 0; index < default_no_mch.length; index++) {
+                for (let j = 0; j < data.length; j++) {
+                    if (default_no_mch[index] == data[j].value) {
+                        data[j].selected = true
+                    }
+                }
+            }
+        }
+        selest_nc = xmSelect.render({
+            el: '#selest_nc',
+            size: 'mini',
+            filterable: true,
+            style: {
+                minHeight: '27px',
+                lineHeight: '27px',
+                marginLeft: '4px',
+                width: '250px'
+            },
+            data: data
+        })
+    })
+    });
+</script>

+ 53 - 14
admin/templates/default/provider.group.list.php

@@ -30,25 +30,25 @@
             </tbody>
         </table>
     </form>
-    <!--   <table class="table tb-type2" id="prompt">-->
-    <!--    <tbody>-->
-    <!--      <tr class="space odd">-->
-    <!--        <th colspan="12"><div class="title">-->
-    <!--            <h5>--><?php //echo $lang['nc_prompts'];?><!--</h5>-->
-    <!--            <span class="arrow"></span></div></th>-->
-    <!--      </tr>-->
-    <!--      <tr>-->
-    <!--        <td><ul>-->
-    <!--            <li>--><?php //echo $lang['store_help1'];?><!--</li>-->
-    <!--          </ul></td>-->
-    <!--      </tr>-->
-    <!--    </tbody>-->
-    <!--  </table>-->
+    <table class="tb-type1 noborder search">
+        <tr>
+            <td>
+                <a href="#" class="btns"  id="hDel">
+                    <span><i class="icon-edit"></i>批量删除</span>
+                </a>
+            </td>
+        </tr>
+    </table>
     <form method="post" id="merchant_name_form">
         <input type="hidden" name="form_submit" value="ok"/>
         <table class="table tb-type2">
             <thead>
             <tr class="thead">
+                <th class="align-left" id="selectAll">
+                    <label>
+                        <input type="checkbox" name="chbox" value="">
+                    </label>
+                </th>
                 <th>通道组ID</th>
                 <th>通道组名称</th>
                 <th>备注信息</th>
@@ -60,6 +60,9 @@
             <?php if (!empty($output['group_list']) && is_array($output['group_list'])) { ?>
                 <?php foreach ($output['group_list'] as $k => $v) { ?>
                     <tr class="trFlex">
+                        <td class="align-left">
+                            <label for="checkBoxList"><input type="checkbox" id="checkBoxList" name="checkbox" value="<?php echo $v['group_id'];?>"></label>
+                        </td>
                         <td><?php echo $v['group_id']; ?></td>
                         <td><?php echo $v['group_name']; ?></td>
                         <td><?php echo $v['bz']; ?></td>
@@ -87,6 +90,7 @@
         </table>
     </form>
 </div>
+<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL;?>/refill/layer.js"></script>
 <script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/js/jquery.edit.js" charset="utf-8"></script>
 <script>
     $(function () {
@@ -102,5 +106,40 @@
                 $(this)[0].style.backgroundColor = '#fff'
             })
         })
+        //全选
+        $('#selectAll' ).click ( function () {
+            if ($("input[name='chbox']").is(':checked')) {
+                $("input[name='checkbox']").each(function() {
+                    this.checked = true;
+                })
+            } else {
+                $("input[name='checkbox']").each(function() {
+                    this.checked = false;
+                })
+            }
+        })
+        let get_sel_id = function (){
+            let arr = [];
+            $("input:checkbox:checked").each(function () {
+                let sel_id = $(this).val();
+                if(sel_id !== '') {
+                    arr.push(sel_id);
+                }
+            })
+            if (arr.length <= 0) { return}
+            return arr.join(",")
+        }
+        //批量删除
+        $('#hDel').click(function () {
+            layer.confirm('您确定要批量删除', {
+                btn: ['确定', '取消'],
+                title: '批量删除'
+            }, function () {
+                const batch = get_sel_id();
+                window.location.href = `index.php?act=provider_group&op=DelGroups&group_ids= ${batch ? batch : ''}`
+            }, function () {
+                layer.msg('取消成功')
+            });
+        })
     });
 </script>

+ 248 - 223
admin/templates/default/provider.index.php

@@ -2,11 +2,12 @@
     .balance {
         cursor: pointer;
     }
+
     .center {
-        text-align: center!important;
+        text-align: center !important;
     }
 </style>
-<link href="<?php echo ADMIN_TEMPLATES_URL;?>/css/recharge.css?<?php echo rand(1,10);?>" rel="stylesheet" type="text/css" id="cssfile2" />
+<link href="<?php echo ADMIN_TEMPLATES_URL; ?>/css/recharge.css?<?php echo rand(1, 10); ?>" rel="stylesheet" type="text/css" id="cssfile2" />
 <?php defined('InShopNC') or exit('Access Invalid!'); ?>
 
 <div class="page">
@@ -25,192 +26,216 @@
         <input type="hidden" value="index" name="op">
         <table class="tb-type1 noborder search">
             <tbody>
-            <tr>
-                <th><label for="name">通道名称</label></th>
-                <td><input type="text" value="<?php echo $output['name']; ?>" name="name"
-                           id="name" class="txt"></td>
-                <th><label>通道类型</label></th>
-                <td colspan="4"><select name="type">
-                        <option value=""><?php echo $lang['nc_please_choose']; ?></option>
-                        <option value="<?php echo mtopcard\OilCardPaper?>"
-                                <?php if ($_GET['type'] == mtopcard\OilCardPaper){ ?>selected<?php } ?>>油卡</option>
-                        <option value="<?php echo mtopcard\PhoneCardPaper?>"
-                                <?php if ($_GET['type'] == mtopcard\PhoneCardPaper){ ?>selected<?php } ?>>手机充值卡</option>
-                        <option value="<?php echo mtopcard\ThirdCardPaper?>"
-                                <?php if ($_GET['type'] == mtopcard\ThirdCardPaper){ ?>selected<?php } ?>>增值业务</option>
-                    </select></td>
+                <tr>
+                    <th><label for="name">通道名称</label></th>
+                    <td><input type="text" value="<?php echo $output['name']; ?>" name="name" id="name" class="txt"></td>
+                    <th><label>通道类型</label></th>
+                    <td colspan="4"><select name="type">
+                            <option value=""><?php echo $lang['nc_please_choose']; ?></option>
+                            <option value="<?php echo mtopcard\OilCardPaper ?>" <?php if ($_GET['type'] == mtopcard\OilCardPaper) { ?>selected<?php } ?>>油卡</option>
+                            <option value="<?php echo mtopcard\PhoneCardPaper ?>" <?php if ($_GET['type'] == mtopcard\PhoneCardPaper) { ?>selected<?php } ?>>手机充值卡</option>
+                            <option value="<?php echo mtopcard\ThirdCardPaper ?>" <?php if ($_GET['type'] == mtopcard\ThirdCardPaper) { ?>selected<?php } ?>>增值业务</option>
+                        </select></td>
 
-                <th><label>通道质量</label></th>
-                <td>
-                    <select name="quality" class="querySelect">
-                        <option value=""><?php echo $lang['nc_please_choose']; ?></option>
-                        <option value="<?php echo refill\Quality::Normal;?>"
-                                <?php if ($_GET['quality'] == refill\Quality::Normal){ ?>selected<?php } ?>>普充(无流水)
-                        </option>
-                        <option value="<?php echo refill\Quality::Quick;?>"
-                                <?php if ($_GET['quality'] == refill\Quality::Quick){ ?>selected<?php } ?>>快充
-                        </option>
-                        <option value="<?php echo refill\Quality::CardKey;?>"
-                                <?php if ($_GET['quality'] == refill\Quality::CardKey){ ?>selected<?php } ?>>卡密
-                        </option>
-                        <option value="<?php echo refill\Quality::ThirdShop;?>"
-                                <?php if ($_GET['quality'] == refill\Quality::ThirdShop){ ?>selected<?php } ?>>三方
-                        </option>
-                        <option value="<?php echo refill\Quality::SlowTwentyFour;?>"
-                                <?php if ($_GET['quality'] == refill\Quality::SlowTwentyFour){ ?>selected<?php } ?>>慢24(有流水)
-                        </option>
-                        <option value="<?php echo refill\Quality::SlowSix;?>"
-                                <?php if ($_GET['quality'] == refill\Quality::SlowSix){ ?>selected<?php } ?>>慢6
-                        </option>
-                        <option value="<?php echo refill\Quality::SlowTwo;?>"
-                                <?php if ($_GET['quality'] == refill\Quality::SlowTwo){ ?>selected<?php } ?>>慢2
-                        </option>
-                        <option value="<?php echo refill\Quality::SlowFortyEight;?>"
-                                <?php if ($_GET['quality'] == refill\Quality::SlowFortyEight){ ?>selected<?php } ?>>慢48
-                        </option>
-                        <option value="<?php echo refill\Quality::SlowSeventyTwo;?>"
-                                <?php if ($_GET['quality'] == refill\Quality::SlowSeventyTwo){ ?>selected<?php } ?>>慢72
-                        </option>
-                        <option value="<?php echo refill\Quality::Fastest;?>"
-                                <?php if ($_GET['quality'] == refill\Quality::Fastest){ ?>selected<?php } ?>>速充
-                        </option>
-                    </select>
-                </td>
+                    <th><label>通道质量</label></th>
+                    <td>
+                        <select name="quality" class="querySelect">
+                            <option value=""><?php echo $lang['nc_please_choose']; ?></option>
+                            <option value="<?php echo refill\Quality::Normal; ?>" <?php if ($_GET['quality'] == refill\Quality::Normal) { ?>selected<?php } ?>>普充(无流水)
+                            </option>
+                            <option value="<?php echo refill\Quality::Quick; ?>" <?php if ($_GET['quality'] == refill\Quality::Quick) { ?>selected<?php } ?>>快充
+                            </option>
+                            <option value="<?php echo refill\Quality::CardKey; ?>" <?php if ($_GET['quality'] == refill\Quality::CardKey) { ?>selected<?php } ?>>卡密
+                            </option>
+                            <option value="<?php echo refill\Quality::ThirdShop; ?>" <?php if ($_GET['quality'] == refill\Quality::ThirdShop) { ?>selected<?php } ?>>三方
+                            </option>
+                            <option value="<?php echo refill\Quality::SlowTwentyFour; ?>" <?php if ($_GET['quality'] == refill\Quality::SlowTwentyFour) { ?>selected<?php } ?>>慢24(有流水)
+                            </option>
+                            <option value="<?php echo refill\Quality::SlowSix; ?>" <?php if ($_GET['quality'] == refill\Quality::SlowSix) { ?>selected<?php } ?>>慢6
+                            </option>
+                            <option value="<?php echo refill\Quality::SlowTwo; ?>" <?php if ($_GET['quality'] == refill\Quality::SlowTwo) { ?>selected<?php } ?>>慢2
+                            </option>
+                            <option value="<?php echo refill\Quality::SlowFortyEight; ?>" <?php if ($_GET['quality'] == refill\Quality::SlowFortyEight) { ?>selected<?php } ?>>慢48
+                            </option>
+                            <option value="<?php echo refill\Quality::SlowSeventyTwo; ?>" <?php if ($_GET['quality'] == refill\Quality::SlowSeventyTwo) { ?>selected<?php } ?>>慢72
+                            </option>
+                            <option value="<?php echo refill\Quality::Fastest; ?>" <?php if ($_GET['quality'] == refill\Quality::Fastest) { ?>selected<?php } ?>>速充
+                            </option>
+                        </select>
+                    </td>
 
-                <td><a href="javascript:void(0);" id="ncsubmit" class="btn-search "
-                       title="<?php echo $lang['nc_query']; ?>">&nbsp;</a>
-                    <?php if ($output['name'] != '') { ?>
-                        <a href="index.php?act=provider&op=index" class="btns "
-                           title="<?php echo $lang['nc_cancel_search']; ?>"><span><?php echo $lang['nc_cancel_search']; ?></span></a>
-                    <?php } ?>
-                </td>
-            </tr>
+                    <td><a href="javascript:void(0);" id="ncsubmit" class="btn-search " title="<?php echo $lang['nc_query']; ?>">&nbsp;</a>
+                        <?php if ($output['name'] != '') { ?>
+                            <a href="index.php?act=provider&op=index" class="btns " title="<?php echo $lang['nc_cancel_search']; ?>"><span><?php echo $lang['nc_cancel_search']; ?></span></a>
+                        <?php } ?>
+                    </td>
+                    <td style="display: inline-block; margin-left: 400px;">
+                        <a href="index.php?act=provider&op=file_sync" class="btns">
+                            <span><i class="icon-edit"></i>新通道-价格导入</span>
+                        </a>
+                        <a href="index.php?act=provider&op=refresh_price" class="btns">
+                            <span><i class="icon-edit"></i>调价-立即生效</span>
+                        </a>
+                    </td>
+                </tr>
             </tbody>
         </table>
     </form>
-       <table class="table tb-type2" id="prompt">
-        <tbody>
-          <tr class="space odd">
-            <th colspan="12"><div class="title">
-                <h5>上游余额统计</h5>
-                <span class="arrow"></span></div></th>
-          </tr>
-          <tr>
+    <!-- <table class="tb-type1 noborder search">
+        <tr>
             <td>
-                <ul class="row_w">
-                    <li class="lineLi" style="color:#000;">总剩余: <?php echo ncPriceFormat($output['stats']['available_total']);?></li>
-                    <li class="lineLi" style="color:#000;">总欠款:<?php echo ncPriceFormat($output['stats']['debt_total']);?></li>
-                    <li class="lineLi" style="color:#000;">合计:<?php echo ncPriceFormat($output['stats']['available_total'] + $output['stats']['debt_total']);?></li>
-                </ul>
+                <a href="index.php?act=provider&op=file_sync" class="btns">
+                    <span><i class="icon-edit"></i>新通道-价格导入</span>
+                </a>
+                <a href="index.php?act=provider&op=refresh_price" class="btns">
+                    <span><i class="icon-edit"></i>调价-立即生效</span>
+                </a>
             </td>
-          </tr>
+        </tr>
+    </table> -->
+    <table class="table tb-type2" id="prompt">
+        <tbody>
+            <tr class="space odd">
+                <th colspan="12">
+                    <div class="title">
+                        <h5>上游余额统计</h5>
+                        <span class="arrow"></span>
+                    </div>
+                </th>
+            </tr>
+            <tr>
+                <td>
+                    <ul class="row_w">
+                        <li class="lineLi" style="color:#000;">总剩余: <?php echo ncPriceFormat($output['stats']['available_total']); ?></li>
+                        <li class="lineLi" style="color:#000;">总欠款:<?php echo ncPriceFormat($output['stats']['debt_total']); ?></li>
+                        <li class="lineLi" style="color:#000;">合计:<?php echo ncPriceFormat($output['stats']['available_total'] + $output['stats']['debt_total']); ?></li>
+                    </ul>
+                </td>
+            </tr>
         </tbody>
-      </table>
+    </table>
     <form method="post" id="merchant_name_form">
-        <input type="hidden" name="form_submit" value="ok"/>
+        <input type="hidden" name="form_submit" value="ok" />
         <table class="table tb-type2">
             <thead>
-            <tr class="thead">
-                <th>通道id</th>
-                <th>通道名称</th>
-                <th>店铺ID</th>
-                <th>会员ID</th>
-                <th>通道类型</th>
-                <th class="align-center">通道状态</th>
-                <th>调款操作</th>
-                <th class="align-right">订单成功后余额</th>
-                <th class="align-right">接口查询余额</th>
-                <th class="align-center">操作</th>
-            </tr>
+                <tr class="thead">
+                    <th>通道id</th>
+                    <th>通道名称</th>
+                    <th>店铺ID</th>
+                    <th>会员ID</th>
+                    <th>通道类型</th>
+                    <th>通道质量</th>
+                    <th class="align-center">通道状态</th>
+                    <th>调款操作</th>
+                    <th class="align-right">订单成功后余额</th>
+                    <th class="align-right">接口查询余额</th>
+                    <th>价格设置</th>
+                    <th>价格更新日期</th>
+                    <th class="align-center">操作</th>
+                </tr>
             </thead>
             <tbody>
-            <?php if (!empty($output['provider_list']) && is_array($output['provider_list'])) { ?>
-                <?php foreach ($output['provider_list'] as $k => $v) { ?>
-                    <tr class="trFlex">
-                        <td><?php echo $v['provider_id']; ?></td>
-                        <td><?php echo $v['name']; ?> (<?php echo $v['store_name'];?>)</td>
-                        <td><?php echo $v['store_id']; ?></td>
-                        <td><?php echo $v['account_id']; ?></td>
-                        <td><?php echo $output['type_text'][$v['type']-1]; ?></td>
+                <?php if (!empty($output['provider_list']) && is_array($output['provider_list'])) { ?>
+                    <?php foreach ($output['provider_list'] as $k => $v) { ?>
+                        <tr class="trFlex">
+                            <td><?php echo $v['provider_id']; ?></td>
+                            <td><?php echo $v['name']; ?> (<?php echo $v['store_name']; ?>)</td>
+                            <td><?php echo $v['store_id']; ?></td>
+                            <td><?php echo $v['account_id']; ?></td>
+                            <td><?php echo $output['type_text'][$v['type'] - 1]; ?></td>
+                            <td><?php echo $v['quality_text']; ?></td>
+                            <td class="align-center">
+                                <?php if ($v['opened'] == 1) { ?>
+                                    <span style="color: #0bb20c">
+                                    <?php } ?>
+                                    <?php if ($v['opened'] == 2) { ?>
+                                        <span style="color: #f30707">
+                                        <?php } ?>
+                                        <?php echo $output['opened_text'][$v['opened'] - 1]; ?>
+                                        </span>
+                            </td>
+                            <td>
+                                <a href="index.php?act=provider&op=recharge_manual&type=edit&provider_id=<?php echo $v['provider_id'] ?>">调款</a>
+                            </td>
+                            <td id="money" class="align-right">
+                                <span><?php echo $v['available_predeposit'] ?? ''; ?></span>
+                                <div id="money_w" style=" display: inline-block;margin-left: 7px"></div>
+                            </td>
+                            <td id="balance" class="align-right">
+                                <span><?php echo $v['balance'] ?? ''; ?></span>
+                                <div id="balanceall" style=" display: inline-block;margin-left: 7px"></div>
 
-                        <td class="align-center">
-                            <?php if($v['opened'] == 1){?>
-                            <span style="color: #0bb20c">
-                            <?php }?>
-                                <?php if($v['opened'] == 2){?>
-                                <span style="color: #f30707">
-                            <?php }?>
-                            <?php echo $output['opened_text'][$v['opened']-1]; ?>
-                                </span>
-                        </td>
-                        <td>
-                            <a href="index.php?act=provider&op=recharge_manual&type=edit&provider_id=<?php echo $v['provider_id'] ?>">调款</a>
-                        </td>
-                        <td id="money" class="align-right">
-                            <span><?php echo $v['available_predeposit'] ?? ''; ?></span>
-                            <div id="money_w" style=" display: inline-block;margin-left: 7px"></div>
-                        </td>
-                        <td id="balance" class="align-right">
-                           <span><?php echo $v['balance'] ?? ''; ?></span>
-                            <div id="balanceall" style=" display: inline-block;margin-left: 7px"></div>
+                            </td>
+                            <td>
+                                <a href="index.php?act=provider&op=provider_price&provider_id=<?php echo $v['provider_id'] ?>">调价</a>
+                            </td>
+                            <td>
+                                <?php
+                                    $date = $output['prices']["{$v['name']}-{$v['type']}"];
+                                    if (!empty($date)) {
+                                        echo $date;
+                                    } else {
+                                        echo '/';
+                                    }
+                                ?>
 
-                        </td>
-                        <td class="align-center w200">
-                            <div>
-                                <a href="index.php?act=merchant&op=provider_province&id=<?php echo $v['provider_id'] ?>">省份控制</a>
-                                |
-                                <?php if($v['opened'] == 1){?>
-                                    <a href="index.php?act=merchant&op=changeProviderState&state=2&id=<?php echo $v['provider_id'] ?>">关闭通道</a>
-                                <?php }?>
-                                <?php if($v['opened'] == 2){?>
-                                    <a href="index.php?act=merchant&op=changeProviderState&state=1&id=<?php echo $v['provider_id'] ?>">启用通道</a>
-                                <?php }?>
-                            </div>
-                            <div>
-                                <a  href="index.php?act=merchant&op=provider_edit&id=<?php echo $v['provider_id'] ?>">编辑通道</a>
-                                | <a class="deleid" href="#" data_id="<?php echo $v['provider_id'] ?>">删除通道</a>
-                            </div>
-                        </td>
+                            </td>
+                            <td class="align-center w200">
+                                <div>
+                                    <a href="index.php?act=merchant&op=provider_province&id=<?php echo $v['provider_id'] ?>">省份控制</a>
+                                    |
+                                    <?php if ($v['opened'] == 1) { ?>
+                                        <a href="index.php?act=merchant&op=changeProviderState&state=2&id=<?php echo $v['provider_id'] ?>">关闭通道</a>
+                                    <?php } ?>
+                                    <?php if ($v['opened'] == 2) { ?>
+                                        <a href="index.php?act=merchant&op=changeProviderState&state=1&id=<?php echo $v['provider_id'] ?>">启用通道</a>
+                                    <?php } ?>
+                                </div>
+                                <div>
+                                    <a href="index.php?act=merchant&op=provider_edit&id=<?php echo $v['provider_id'] ?>">编辑通道</a>
+                                    | <a class="deleid" href="#" data_id="<?php echo $v['provider_id'] ?>">删除通道</a>
+                                </div>
+                            </td>
+                        </tr>
+                    <?php } ?>
+                <?php } else { ?>
+                    <tr class="no_data">
+                        <td colspan="15"><?php echo $lang['nc_no_record']; ?></td>
                     </tr>
                 <?php } ?>
-            <?php } else { ?>
-                <tr class="no_data">
-                    <td colspan="15"><?php echo $lang['nc_no_record']; ?></td>
-                </tr>
-            <?php } ?>
             </tbody>
             <tfoot>
-            <tr class="tfoot">
-                <td></td>
-                <td colspan="16">
-                    <div class="pagination"><?php echo $output['show_page']; ?></div>
-                </td>
-            </tr>
+                <tr class="tfoot">
+                    <td></td>
+                    <td colspan="16">
+                        <div class="pagination"><?php echo $output['show_page']; ?></div>
+                    </td>
+                </tr>
             </tfoot>
         </table>
     </form>
 </div>
 <script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/js/jquery.edit.js" charset="utf-8"></script>
-<script type="text/javascript" src="<?php echo ADMIN_TEMPLATES_URL;?>/layui/layui.js"></script>
-<link rel="stylesheet" type="text/css" href="<?php echo ADMIN_TEMPLATES_URL; ?>/layui/css/layui.css"/>
+<script type="text/javascript" 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>
-    $(function () {
-        $('#ncsubmit').click(function () {
+    $(function() {
+        $('#ncsubmit').click(function() {
             $('input[name="op"]').val('index');
             $('#formSearch').submit();
         });
         // 表格hover时背景
-        $('.trFlex').each(function () {
-            $(this).hover(function () {
-            $(this)[0].style.backgroundColor = '#cbe9f3'
-            },function() {
-            $(this)[0].style.backgroundColor = '#fff'
+        $('.trFlex').each(function() {
+            $(this).hover(function() {
+                $(this)[0].style.backgroundColor = '#cbe9f3'
+            }, function() {
+                $(this)[0].style.backgroundColor = '#fff'
             })
         })
-        $('.deleid').click(function()  {
+        $('.deleid').click(function() {
             let data_id = $(this).attr('data_id')
             layer.confirm('确定要删除通道 ?', {
-            btn: ['确定', '取消']
+                btn: ['确定', '取消']
             }, function() {
                 window.location.href = `index.php?act=merchant&op=provider_del&id= ${data_id}`
             }, function() {})
@@ -218,90 +243,90 @@
         // 负数余额变红
         $('#money span').each(function(index, item) {
             let text = $(item).text();
-            if(!isNaN(text) && text < 0 ) {
+            if (!isNaN(text) && text < 0) {
                 $(this).css('color', 'red')
-            } else{
+            } else {
                 $(this).css('color', '#555')
             }
         })
         //余额后面显示大写余额
         function cnMoneyFormat(money) {
-          let number_data = money;
-          if(number_data < 0) {
-            let num_data = number_data.substring(1, number_data.length)
-            number_data = parseInt(num_data);
-          } else{
-            number_data = parseInt(number_data);
-          }
-        let yi = 0; //亿
-        let wan = 0; //万
-        let wan_s = 10000; //万
-        let yi_s = 100000000; //亿
-        //取整
-        function qz(data) {
-          data = Math.floor(data);
-          return data;
-        }
-        //为0判断输出
-        function data_if(data, amount) {
-          if (data === 0) {
-            return '';
-          } else {
-            return data + amount;
-          }
-        }
-        //亿
-        function yi_f(data) {
-          yi = qz(data / 100000000);
-          data = data - (yi * yi_s);
-          let data_json = {
-            data1: data_if(yi, '亿'),
-            data2: data,
-          }
-          return data_json;
-        }
-        //万
-        function wan_f(data) {
-          wan = qz(data / 10000);
-          data = data - (wan * wan_s);
-          let data_json = {
-            data1: data_if(wan, '万'),
-            data2: data,
-          }
-          return data_json;
-        }
-        yi = yi_f(number_data);
-        number_data = yi.data2;
-        wan = wan_f(number_data);
-        number_data = wan.data2;
-        let result = yi.data1 + wan.data1;
-        if (result == 0) {
-        return ''
+            let number_data = money;
+            if (number_data < 0) {
+                let num_data = number_data.substring(1, number_data.length)
+                number_data = parseInt(num_data);
+            } else {
+                number_data = parseInt(number_data);
+            }
+            let yi = 0; //亿
+            let wan = 0; //万
+            let wan_s = 10000; //万
+            let yi_s = 100000000; //亿
+            //取整
+            function qz(data) {
+                data = Math.floor(data);
+                return data;
+            }
+            //为0判断输出
+            function data_if(data, amount) {
+                if (data === 0) {
+                    return '';
+                } else {
+                    return data + amount;
+                }
+            }
+            //亿
+            function yi_f(data) {
+                yi = qz(data / 100000000);
+                data = data - (yi * yi_s);
+                let data_json = {
+                    data1: data_if(yi, '亿'),
+                    data2: data,
+                }
+                return data_json;
+            }
+            //万
+            function wan_f(data) {
+                wan = qz(data / 10000);
+                data = data - (wan * wan_s);
+                let data_json = {
+                    data1: data_if(wan, '万'),
+                    data2: data,
+                }
+                return data_json;
+            }
+            yi = yi_f(number_data);
+            number_data = yi.data2;
+            wan = wan_f(number_data);
+            number_data = wan.data2;
+            let result = yi.data1 + wan.data1;
+            if (result == 0) {
+                return ''
+            }
+            return result
         }
-        return result
-    }
         //订单成功后余额
         $('#money div').each(function(index, item) {
             let txt = $(item).prev().text()
             if (txt < 0 && txt < -10000) {
-            $(item).text('('+ '-' + cnMoneyFormat(txt) +')')
-        } else if( txt > 0 && txt > 10000){
-            $(item).text('('+  cnMoneyFormat(txt) +')')
-        } else {
-            $(item).text(cnMoneyFormat(txt))
-        };
+                $(item).text('(' + '-' + cnMoneyFormat(txt) + ')')
+            } else if (txt > 0 && txt > 10000) {
+                $(item).text('(' + cnMoneyFormat(txt) + ')')
+            } else {
+                $(item).text(cnMoneyFormat(txt))
+            };
         })
         //接口查询余额
         $('#balance div').each(function(index, item) {
             let txt = $(item).prev().text()
             if (txt < 0 && txt < -10000) {
-            $(item).text('('+ '-' + cnMoneyFormat(txt) +')')
-        } else if( txt > 0 && txt > 10000){
-            $(item).text('('+  cnMoneyFormat(txt) +')')
-        } else {
-            $(item).text(cnMoneyFormat(txt))
-        };
+                $(item).text('(' + '-' + cnMoneyFormat(txt) + ')')
+            } else if (txt > 0 && txt > 10000) {
+                $(item).text('(' + cnMoneyFormat(txt) + ')')
+            } else {
+                $(item).text(cnMoneyFormat(txt))
+            };
         })
 
     });
-</script>
+</script>

+ 19 - 4
admin/templates/default/provider.order.stats.php

@@ -31,6 +31,9 @@
                 <li><a href="index.php?act=OrderStats&op=index&type=system"><span>平台对账记录</span></a></li>
                 <li><a href="JavaScript:void(0);" class="current"><span>上游对账记录</span></a></li>
                 <li><a href="index.php?act=OrderStats&op=index&type=merchant"><span>下游对账记录</span></a></li>
+                <li><a href="index.php?act=OrderStats&op=refill_balance&type=system"><span>平台结余记录</span></a></li>
+                <li><a href="index.php?act=OrderStats&op=refill_balance&type=provider"><span>上游结余记录</span></a></li>
+                <li><a href="index.php?act=OrderStats&op=refill_balance&type=merchant"><span>下游结余记录</span></a></li>
             </ul>
         </div>
     </div>
@@ -41,6 +44,7 @@
         <input type="hidden" value="provider" name="type">
         <input type="hidden" name="cid" value=""/>
         <input type="hidden" name="default_no_mch" value="<?php echo $_GET['cid']; ?>"/>
+        <input type="hidden" name="reload" value=""/>
         <table class="tb-type1 noborder search">
             <tbody>
             <tr>
@@ -75,6 +79,11 @@
                         <span>导出</span>
                     </a>
                 </td>
+                <td>
+                    <a href="javascript:void(0);" id="ncreload" class="btn">
+                        <span>批量重新统计</span>
+                    </a>
+                </td>
             </tr>
             </tbody>
         </table>
@@ -233,8 +242,16 @@
 <link rel="stylesheet" type="text/css" href="<?php echo ADMIN_TEMPLATES_URL; ?>/layui/css/layui.css"/>
 <script>
     $(function () {
+        $("#ncreload").click(function () {
+            $('input[name="reload"]').val('1');
+            select_set()
+            $('#formSearch').submit();
+        })
         $('#ncsubmit').click(function () {
-            $('input[name="op"]').val('index');
+            select_set()
+            $('#formSearch').submit();
+        });
+        function select_set(){
             let selectArr = selest_nc.getValue();
             let selectStr = ''
             for (let i = 0; i < selectArr.length; i++) {
@@ -242,9 +259,7 @@
             }
             selectStr = selectStr.substr(0, selectStr.length-1)
             $('input[name="cid"]').val(selectStr);
-            $('#formSearch').submit();
-            $('input[name="cid"]').val('');
-        });
+        }
         // 日期选择器
         laydate.render({
             elem: '#startTime',

+ 328 - 0
admin/templates/default/provider.price.set.php

@@ -0,0 +1,328 @@
+<?php defined('InShopNC') or exit('Access Invalid!'); ?>
+<style>
+    .disInput {
+        background: #ccc;
+        cursor: not-allowed;
+    }
+
+    .spec_table {
+        width: 320px;
+        border-right: 1px solid #CBE9F3;
+    }
+
+    .spec_table .batch {
+        vertical-align: middle;
+        display: inline-block;
+        *display: inline
+            /*IE7*/
+        ;
+        margin-left: 4px;
+        position: relative;
+        z-index: 1;
+        *zoom: 1
+            /*IE7*/
+        ;
+    }
+
+    .spec_table .batch i {
+        cursor: pointer;
+    }
+
+    .spec_table .batch-input {
+        background-color: #FFF;
+        white-space: nowrap;
+        padding: 4px 9px;
+        border: solid 1px #BCE8F1;
+        position: absolute;
+        z-index: 1;
+        top: -70px;
+        left: -75px;
+        box-shadow: 3px 3px 0 rgba(153, 153, 153, 0.25);
+    }
+
+    .spec_table .batch-input h6 {
+        font-size: 12px;
+        color: #555;
+    }
+
+    .spec_table .batch-input .text {
+        vertical-align: middle;
+        clear: both;
+        padding: 0 4px;
+        margin-right: 4px;
+    }
+
+    .spec_table .batch-input .arrow {
+        background: url(<?php echo SHOP_SITE_URL; ?>/templates/default/images/seller/ncsc_bg_img.png) no-repeat -240px -20px;
+        display: block;
+        width: 10px;
+        height: 5px;
+        margin-left: -5px;
+        bottom: -5px;
+        left: 50%;
+        position: absolute;
+        z-index: 2;
+    }
+
+    .spec_table .batch-input a.close {
+        font-size: 11px;
+        line-height: 12px;
+        color: #BCE8F1;
+        text-decoration: none;
+        background-color: #FFF;
+        text-align: center;
+        display: block;
+        width: 12px;
+        height: 12px;
+        border-radius: 7px;
+        border: solid 1px #BCE8F1;
+        top: -7px;
+        right: -7px;
+        position: absolute;
+        z-index: 2;
+    }
+
+    .spec_table .text.price {
+        width: 40px;
+    }
+</style>
+<div class="page">
+    <div class="fixed-bar">
+        <div class="item-title">
+            <h3>通道管理</h3>
+            <ul class="tab-base">
+                <li><a href="index.php?act=provider&op=index"><span><?php echo $lang['nc_manage'] ?></span></a></li>
+                <li><a href="index.php?act=provider&op=provider_amount"><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="price_form" enctype="multipart/form-data" method="post">
+        <input type="hidden" name="form_submit" value="ok" />
+        <input type="hidden" name="provider_id" value="<?php echo $_GET['provider_id'] ?>" />
+        <table class="table tb-type2">
+            <tbody>
+                <tr class="noborder">
+                    <td colspan="2">
+                        <label>通道名称:</label>
+                        <label><?php echo $output['provider_name']; ?></label>
+                    </td>
+                </tr>
+                <tr class="noborder">
+                    <td class="vatop rowform">
+                        <label>通道质量:</label>
+                        <label data-quality="<?php echo $output['quality']; ?>"><?php echo $output['quality_text']; ?></label>
+                    </td>
+                </tr>
+
+                <tr class="noborder">
+                    <td colspan="2" class="required"><label class="validation" for="mchid">编辑后延迟生效日期:</label></td>
+                </tr>
+                <tr class="noborder">
+                    <td class="vatop rowform">
+                        <select id="selectEffectType">
+                            <option value="0">立即生效</option>
+                            <option value="1" <?php if(!empty($output['effect_time'])){ echo 'selected';}?>>延迟生效</option>
+                        </select>
+                    </td>
+                    <td class="vatop rowform">
+                        <!-- <input class="txt date" type="hidden" value="0" name="effect_time" placeholder="" autocomplete="off" style="width:120px" /> -->
+                        <input class="txt date" style="display:none;" type="text" id="startTime" name="effect_time" placeholder="" value="<?php echo date("Y-m-d H:i:s", $output['effect_time']);?>" autocomplete="off" style="width:120px" />
+                    </td>
+                    <td class="vatop tips" style="color: red"></td>
+                </tr>
+                <tr>
+                    <td colspan="2" class="required"><label class="validation" for="password">价格:</label></td>
+                </tr>
+                <tr class="noborder" style="border-bottom: 1px solid #CBE9F3;">
+                    <?php foreach ($output['amounts'] as $card_type => $datas) { ?>
+                        <td>
+                            <table class="spec_table tb-type2 setTable">
+                                <tr class="w500">
+                                    <th class="w150 align-center">卡类型</th>
+                                    <th class="w150 align-center">面额</th>
+                                    <th class="w150 align-center">
+                                        费率
+                                        <div class="batch" style="display: inline-block"><i class="icon-edit" title="批量操作"></i>
+                                            <div class="batch-input" style="display:none;">
+                                                <h6>批量设置费率(百分比):</h6>
+                                                <a href="javascript:void(0)" class="close">X</a>
+                                                <input name="" type="text" class="text price" />
+                                                <a href="javascript:void(0)" class="ncsc-btn-mini" data-type="price">设置</a><span class="arrow"></span>
+                                            </div>
+                                        </div>
+                                    </th>
+                                </tr>
+
+                                <tbody class="tbody">
+                                    <?php foreach ($datas as $spec => $val) { ?>
+                                        <tr class="w500">
+                                            <td class="w150 align-center">
+                                                <?php echo $output['all_specs'][$card_type]['goods_name']; ?>
+                                                <input type="hidden" name="card_types[]" value="<?php echo $card_type; ?>">
+                                            </td>
+                                            <td class="w150 align-center">
+                                                <?php echo $spec; ?>
+                                                <input type="hidden" class="num" name="specs[]" value="<?php echo $spec; ?>">
+                                            </td>
+                                            <td class="w150 align-center tdVal">
+                                                <input type="text" name="<?php echo "price-{$card_type}-{$spec}" ?>" class="txt price <?php if ($val['opened'] == 0) echo 'disInput' ?>" <?php if ($val['opened'] == 0) echo 'disabled' ?> data-opened="<?php echo $val['opened']; ?>" value="<?php echo $val['price']; ?>">
+                                            </td>
+
+                                        </tr>
+                                    <?php } ?>
+                                </tbody>
+                            </table>
+                        </td>
+                    <?php } ?>
+                </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: '#startTime',
+        //     type: 'datetime'
+        // });
+
+        let maxDecimal = (number) => {
+            return String(number).replace(/^(.*\..{4}).*$/, "$1")
+        }
+
+        $('.txt.price').on('input', function() {
+            var val = $(this).val();
+            console.log('val', val);
+            $(this).val(maxDecimal(val));
+        })
+
+        $('#selectEffectType').on('change', function() {
+            const val = $(this).val();
+            if (val == 0) {
+                $(this).attr('name', 'effect_time')
+                $('#startTime').attr('name', '');
+                $('#startTime').hide()
+            } else {
+                var date = new Date();
+                var year = date.getFullYear();
+                var month = date.getMonth() + 1;
+                var day = date.getDate();
+                if (month < 10) {
+                    month = '0' + month;
+                }
+                if (day < 10) {
+                    day = '0' + day;
+                }
+
+                var nowTime = year + '-' + month + '-' + day + ' ' + '00' + ':' + '00' + ':' + '00';
+
+
+                $(this).attr('name', '')
+                $('#startTime').attr('name', 'effect_time');
+                $('#startTime').show()
+                laydate.render({
+                    elem: '#startTime',
+                    type: 'datetime',
+                    value: nowTime,
+                    min: nowTime
+                });
+            }
+        })
+
+
+        //按钮先执行验证再提交表单
+        $("#submitBtn").click(function() {
+            if ($('#startTime').is(':visible')) {
+                const curTime = new Date().getTime();
+                const selectTime = new Date($('#startTime').val()).getTime();
+                if (selectTime < curTime) {
+                    alert('延迟生效时间小于当前时间,请重新选择');
+                    return;
+                }
+            }
+            $("#price_form").submit();
+        });
+        // $('#price_form').validate({
+        //     errorPlacement: function(error, element) {
+        //         error.appendTo(element.parent().parent().prev().find('td:first'));
+        //     },
+        //     rules: {
+        //         effect_time: {
+        //             required: true,
+        //         },
+        //     },
+        //     messages: {
+        //         effect_time: {
+        //             required: '延迟生效秒数不能为空',
+        //         },
+        //     }
+        // });
+        // 批量设置价格、库存、预警值
+        $('.batch > .icon-edit').click(function() {
+            $('.batch > .batch-input').hide();
+            $(this).next().show();
+        });
+        $('.batch-input > .close').click(function() {
+            $(this).parent().hide();
+        });
+        $('.batch-input > .ncsc-btn-mini').click(function() {
+            var _value = $(this).prev().val();
+            var _type = $(this).attr('data-type');
+            _type = '.' + _type;
+            // console.log('_type', _type)
+            var trs = $(this).parents('.setTable').children('.tbody').children()
+            var trsArr = []
+            trs.each(function() {
+                let res = $(this).find('td').eq(1).text().replace(/[\  \r\n]+/g, "");
+                // console.log('res', res)
+                trsArr.push(res)
+            })
+            // console.log('trsArr', trsArr)
+            var _valArr = []
+            if (_value && _value > 0 && _value <= 200) {
+                for (var i = 0; i < trsArr.length; i++) {
+                    _valArr[i] = maxDecimal(parseInt(trsArr[i]) / 100 * _value);
+                }
+                // console.log('_valArr', _valArr, trsArr)
+                let vals = $(this).parents('.setTable').children('.tbody').find(_type)
+                // console.log('vals', vals)
+                for (let j = 0; j < vals.length; j++) {
+                    // console.log('vals[j]', j, vals[j], _valArr[j])
+                    if ($(vals[j]).attr('data-opened') == 1) {
+                        vals[j].value = _valArr[j]
+                    }
+                }
+                // console.log('_valArr', _valArr)
+            } else if (_value && _value == 0 && _value <= 200) {
+                for (let i = 0; i < trsArr.length; i++) {
+                    _valArr[i] = 0
+                }
+                // console.log('_valArr', _valArr, trsArr)
+                let vals = $(this).parents('.setTable').children('.tbody').find(_type)
+                console.log('vals', vals)
+                for (let j = 0; j < vals.length; j++) {
+                    // console.log('vals[j]', j, vals[j], _valArr[j])
+                    if ($(vals[j]).attr('data-opened') == 1) {
+                        vals[j].value = _valArr[j]
+                    }
+                }
+                // console.log('_valArr', _valArr)
+            }
+            $(this).parent().hide();
+            $(this).prev().val('');
+        });
+    });
+</script>

+ 377 - 0
admin/templates/default/provider.refill.balance.php

@@ -0,0 +1,377 @@
+<?php defined('InShopNC') or exit('Access Invalid!'); ?>
+<style>
+    .page .fixed-bar .item-title h3 {
+        margin-top:18px !important;
+        margin-bottom:10px !important;
+        font-weight:700 !important;
+    }
+    .tab-base li span {
+        font-size:12px !important;
+    }
+    .layui-form-select .layui-input {
+        height:26px;
+    }
+    input::placeholder{ 
+        color:#333; 
+    }
+    .row_q ul li {
+        height: 30px;
+        line-height: 30px;
+    }
+    .row_w {
+        float: left;
+        margin-right: 40px;
+    }
+</style>
+<div class="page">
+    <div class="fixed-bar">
+        <div class="item-title">
+            <h3>对账管理</h3>
+            <ul class="tab-base">
+                <li><a href="index.php?act=OrderStats&op=index&type=system"><span>平台对账记录</span></a></li>
+                <li><a href="index.php?act=OrderStats&op=index&type=provider"><span>上游对账记录</span></a></li>
+                <li><a href="index.php?act=OrderStats&op=index&type=merchant"><span>下游对账记录</span></a></li>
+                <li><a href="index.php?act=OrderStats&op=refill_balance&type=system"><span>平台结余记录</span></a></li>
+                <li><a href="JavaScript:void(0);" class="current"><span>上游结余记录</span></a></li>
+                <li><a href="index.php?act=OrderStats&op=refill_balance&type=merchant"><span>下游结余记录</span></a></li>
+            </ul>
+        </div>
+    </div>
+    <div class="fixed-empty"></div>
+    <form method="get" name="formSearch" id="formSearch" class="layui-form">
+        <input type="hidden" value="OrderStats" name="act">
+        <input type="hidden" value="refill_balance" name="op">
+        <input type="hidden" value="provider" name="type">
+        <input type="hidden" name="cid" value=""/>
+        <input type="hidden" name="default_no_mch" value="<?php echo $_GET['cid']; ?>"/>
+        <table class="tb-type1 noborder search">
+            <tbody>
+            <tr>
+                <th><label for="query_start_time">统计时间</label></th>
+                <td>
+                    <input class="txt date" type="text" value="<?php echo $_GET['query_start_time']; ?>"
+                           id="startTime" name="query_start_time" autocomplete="off" style="width:120px" />
+                    <label for="query_start_time">~</label>
+                    <input class="txt date" type="text" value="<?php echo $_GET['query_end_time']; ?>"
+                           id="endTime" name="query_end_time" autocomplete="off" style="width:120px" />
+                </td>
+                <th><label>统计日期类型</label></th>
+                <td>
+                    <select name="order_time_type" id="order_time_type">
+                        <option value="">请选择...</option>
+                        <option value="notify_time" <?php if($_GET['order_time_type'] == 'notify_time'){ echo 'selected';}?>>回调日期</option>
+                        <option value="order_time" <?php if($_GET['order_time_type'] == 'order_time'){ echo 'selected';}?>>下单日期</option>
+                    </select>
+                </td>
+                <th><label>通道名称</label></th>
+                <td>
+                 <div id="selest_nc"></div>
+                </td>
+                <td><a href="javascript:void(0);" id="ncsubmit" class="btn-search "
+                       title="<?php echo $lang['nc_query']; ?>">&nbsp;</a>
+                    <?php if ($output['mch_name'] != '') { ?>
+                        <a href="index.php?act=OrderStats&op=index" class="btns "
+                           title="<?php echo $lang['nc_cancel_search']; ?>"><span><?php echo $lang['nc_cancel_search']; ?></span></a>
+                    <?php } ?></td>
+<!--                <td>-->
+<!--                    <a href="javascript:void(0);" id="ncexport" class="btn">-->
+<!--                        <span>导出</span>-->
+<!--                    </a>-->
+<!--                </td>-->
+            </tr>
+            </tbody>
+        </table>
+    </form>
+<!--    <table class="table tb-type2" id="prompt">-->
+<!--        <tbody>-->
+<!--        <tr class="space odd">-->
+<!--            <th colspan="12"><div class="title">-->
+<!--                    <h5>总量统计</h5>-->
+<!--                    <span class="arrow"></span></div></th>-->
+<!--        </tr>-->
+<!--        <tr>-->
+<!--            <td class="row_q">-->
+<!--                <ul class="row_w">-->
+<!--                    <li>回调日期统计</li>-->
+<!--                    <li class="lineLi" style="color:#000;">总计成功订单量: --><?php //echo $output['total_stats']['notify_time']['success_count_total'] ?? 0?><!--</li>-->
+<!--                    <li class="lineLi" style="color:#000;">总计充值中订单量: --><?php //echo $output['total_stats']['notify_time']['send_count_total'] ?? 0?><!--</li>-->
+<!--                    <li class="lineLi" style="color:#000;">总计成功订单金额:--><?php //echo $output['total_stats']['notify_time']['success_refill_amounts_total'] ?? 0?><!--</li>-->
+<!--                    <li class="lineLi" style="color:#000;">总计下游扣款金额:--><?php //echo $output['total_stats']['notify_time']['success_mch_amounts_toatl'] ?? 0?><!--</li>-->
+<!--                    <li class="lineLi" style="color:#000;">总计上游扣款金额:--><?php //echo $output['total_stats']['notify_time']['success_channel_amounts_total'] ?? 0?><!--</li>-->
+<!--                </ul>-->
+<!--                <ul>-->
+<!--                    <li>下单日期统计</li>-->
+<!--                    <li class="lineLi" style="color:#000;">总计成功订单量: --><?php //echo $output['total_stats']['order_time']['success_count_total'] ?? 0?><!--</li>-->
+<!--                    <li class="lineLi" style="color:#000;">总计充值中订单量: --><?php //echo $output['total_stats']['order_time']['send_count_total'] ?? 0?><!--</li>-->
+<!--                    <li class="lineLi" style="color:#000;">总计成功订单金额:--><?php //echo $output['total_stats']['order_time']['success_refill_amounts_total'] ?? 0?><!--</li>-->
+<!--                    <li class="lineLi" style="color:#000;">总计下游扣款金额:--><?php //echo $output['total_stats']['order_time']['success_mch_amounts_toatl'] ?? 0?><!--</li>-->
+<!--                    <li class="lineLi" style="color:#000;">总计上游扣款金额:--><?php //echo $output['total_stats']['order_time']['success_channel_amounts_total'] ?? 0?><!--</li>-->
+<!--                </ul>-->
+<!--            </td>-->
+<!--        </tr>-->
+<!--        </tbody>-->
+<!--    </table>-->
+    <form method="post" id="merchant_name_form">
+        <input type="hidden" name="form_submit" value="ok"/>
+        <table class="table tb-type2">
+            <thead>
+            <tr class="thead">
+                <th>记录ID</th>
+                <th>父ID</th>
+                <th>主体名称</th>
+                <th>主体ID</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-left">更新日期</th>
+                <th class="align-center">确认状态</th>
+                <th class="align-center">统计日期类型</th>
+                <th class="align-left">备注</th>
+<!--                <th class="align-center">操作</th>-->
+            </tr>
+            </thead>
+            <tbody>
+            <?php if (!empty($output['stats_list']) && is_array($output['stats_list'])) { ?>
+                <?php foreach ($output['stats_list'] as $k => $v) { ?>
+                    <tr class="trFlex">
+                        <td><?php echo $v['balance_id']; ?></td>
+                        <td><?php echo $v['parent_id']; ?></td>
+                        <td><?php echo $v['cname']; ?></td>
+                        <td><?php echo $v['cid']; ?></td>
+                        <td class="align-left"><?php echo $v['start_stamp'] ? date('Y-m-d H:i', $v['start_stamp']) : '/'; ?></td>
+                        <td class="align-left"><?php echo $v['end_text']; ?></td>
+                        <td class="align-center"><?php echo $v['success_count']; ?></td>
+                        <td class="align-center"><?php echo $v['refill_amount']; ?></td>
+                        <td class="align-center"><?php echo $v['mch_amount']; ?></td>
+                        <td class="align-center"><?php echo $v['channel_amount']; ?></td>
+                        <td class="align-center"><?php echo $v['profit_amount']; ?></td>
+                        <td class="align-center"><?php echo $v['transfer_in']; ?></td>
+                        <td class="align-center"><?php echo $v['transfer_out']; ?></td>
+                        <td class="align-center"><?php echo $v['refund_amount']; ?></td>
+                        <td class="align-center"><?php echo $v['except_amount']; ?></td>
+                        <td class="align-center"><?php echo $v['accumulate_balance']; ?></td>
+                        <td class="align-center"><?php echo $v['balance']; ?></td>
+                        <td class="align-left"><?php echo date("Y-m-d H:i:s", $v['update_time']); ?></td>
+                        <td class="align-center">
+                            <?php if($v['confirmed'] == 0){?>
+                                <span style="color: #fd9d0e">未确认</span>
+                            <?php }else{?>
+                                <span style="color: #0bb20c">已确认</span>
+                            <?php }?>
+                        </td>
+                        <td class="align-center"><?php echo $output['order_time_type_text'][$v['time_type']]; ?></td>
+                        <td class="align-left"><?php echo $v['remark']; ?></td>
+<!--                        <td class="align-center w200">-->
+<!--                            <a href="index.php?act=merchant&op=OrderStatsReload&stat_id=--><?php //echo $v['stat_id'];?><!--">重新统计</a>-->
+<!--                            |<a href="index.php?act=merchant&op=OrderStatsCheck&stat_id=--><?php //echo $v['stat_id'] ?><!--">编辑</a>-->
+<!--                        </td>-->
+                    </tr>
+                <?php } ?>
+            <?php } else { ?>
+                <tr class="no_data">
+                    <td colspan="20"><?php echo $lang['nc_no_record']; ?></td>
+                </tr>
+            <?php } ?>
+            </tbody>
+            <tfoot>
+            <tr class="tfoot">
+                <td></td>
+                <td colspan="20">
+                    <div class="pagination"><?php echo $output['show_page']; ?></div>
+                </td>
+            </tr>
+            </tfoot>
+        </table>
+    </form>
+</div>
+<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/js/dialog/dialog.js" id="dialog_js" charset="utf-8"></script>
+<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/js/jquery-ui/jquery.ui.js"></script>
+<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/js/ajaxfileupload/ajaxfileupload.js"></script>
+<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/js/jquery.Jcrop/jquery.Jcrop.js"></script>
+<link href="<?php echo RESOURCE_SITE_URL; ?>/js/jquery.Jcrop/jquery.Jcrop.min.css" rel="stylesheet" type="text/css"
+      id="cssfile2"/>
+<script type="text/javascript" src="<?php echo ADMIN_TEMPLATES_URL;?>/js/xm-select.js"></script>
+<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/js/jquery.edit.js" charset="utf-8"></script>
+<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/laydate/laydate.js"></script>
+<script type="text/javascript" src="<?php echo ADMIN_TEMPLATES_URL;?>/layui/layui.js"></script>
+<link rel="stylesheet" type="text/css" href="<?php echo ADMIN_TEMPLATES_URL; ?>/layui/css/layui.css"/>
+<script>
+    $(function () {
+        $('#ncsubmit').click(function () {
+            let selectArr = selest_nc.getValue();
+            let selectStr = ''
+            for (let i = 0; i < selectArr.length; i++) {
+                selectStr += selectArr[i].value+','
+            }
+            selectStr = selectStr.substr(0, selectStr.length-1)
+            $('input[name="cid"]').val(selectStr);
+            $('#formSearch').submit();
+            $('input[name="cid"]').val('');
+        });
+        // 日期选择器
+        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'
+            })
+        })
+        function JSONToExcelConvertor(JSONData, FileName, ShowLabel, headData) { 
+            //先转化json 
+            var arrData = typeof JSONData != 'object' ? JSON.parse(JSONData) : JSONData; 
+            var excel = '<table>';   
+            // 标题
+            for (const key in headData) {
+                var head = "<tr>";
+                var td = "<td colspan='12' style='font-size:16px;'>"+ headData[key] + '</td>';
+                excel += td + "</tr>";
+            }
+            //设置表头 
+            var row = "<tr>"; 
+            for (var i = 0, l = ShowLabel.length; i < l; i++) { 
+                row += "<th style='font-size:14px;'>" + ShowLabel[i].value + '</th>'; 
+            } 
+            //换行 
+            excel += row + "</tr>"; 
+            //设置数据 
+            for (var i = 0; i < arrData.length; i++) { 
+                var row = "<tr>"; 
+                let code = i+1
+                row += "<td>" +code+ "</td>"
+                row += '<td style=font-size:14px;'+ 'mso-number-format:"\@"'+ '>' + arrData[i].time_text + '</td>';
+                row += '<td style=font-size:14px;'+ 'mso-number-format:"\@"'+ '>' + arrData[i].cname + '</td>';
+                row += '<td style=font-size:14px;'+ 'mso-number-format:"\@"'+ '>' + arrData[i].cid + '</td>';
+                row += '<td style=font-size:14px;'+ 'mso-number-format:"\@"'+ '>' + arrData[i].success_count + '</td>';
+                row += '<td style=font-size:14px;'+ 'mso-number-format:"\@"'+ '>' + arrData[i].success_refill_amounts + '</td>';
+                row += '<td style=font-size:14px;'+ 'mso-number-format:"\@"'+ '>' + arrData[i].success_channel_amounts + '</td>';
+                row += '<td style=font-size:14px;'+ 'mso-number-format:"\@"'+ '>' + arrData[i].success_mch_amounts + '</td>';
+                row += '<td style=font-size:14px;'+ 'mso-number-format:"\@"'+ '>' + arrData[i].profit_amounts + '</td>';
+                row += '<td style=font-size:14px;'+ 'mso-number-format:"\@"'+ '>' + arrData[i].order_count + '</td>';
+                row += '<td style=font-size:14px;'+ 'mso-number-format:"\@"'+ '>' + arrData[i].cancel_count + '</td>';
+                row += '<td style=font-size:14px;'+ 'mso-number-format:"\@"'+ '>' + arrData[i].success_ratio + '</td>';
+                excel += row + "</tr>"; 
+            } 
+                excel += "</table>"; 
+                var excelFile = "<html xmlns:o='urn:schemas-microsoft-com:office:office' xmlns:x='urn:schemas-microsoft-com:office:excel' xmlns='http://www.w3.org/TR/REC-html40'>"; 
+                excelFile += '<meta http-equiv="content-type" content="application/vnd.ms-excel; charset=UTF-8">'; 
+                excelFile += '<meta http-equiv="content-type" content="application/vnd.ms-excel'; 
+                excelFile += '; charset=UTF-8">'; 
+                excelFile += "<head>"; 
+                excelFile += "<!--[if gte mso 9]>"; 
+                excelFile += "<xml>"; 
+                excelFile += "<x:ExcelWorkbook>"; 
+                excelFile += "<x:ExcelWorksheets>"; 
+                excelFile += "<x:ExcelWorksheet>"; 
+                excelFile += "<x:Name>"; 
+                excelFile += "{worksheet}"; 
+                excelFile += "</x:Name>"; 
+                excelFile += "<x:WorksheetOptions>"; 
+                excelFile += "<x:DisplayGridlines/>"; 
+                excelFile += "</x:WorksheetOptions>"; 
+                excelFile += "</x:ExcelWorksheet>"; 
+                excelFile += "</x:ExcelWorksheets>"; 
+                excelFile += "</x:ExcelWorkbook>"; 
+                excelFile += "</xml>"; 
+                excelFile += "<![endif]-->"; 
+                excelFile += "</head>"; 
+                excelFile += "<body>"; 
+                excelFile += excel; 
+                excelFile += "</body>"; 
+                excelFile += "</html>"; 
+                var uri = 'data:application/vnd.ms-excel;charset=utf-8,' + encodeURIComponent(excelFile); 
+                var link = document.createElement("a");   
+                link.href = uri; 
+                link.style = "visibility:hidden"; 
+                link.download = FileName + ".xls"; 
+                document.body.appendChild(link); 
+                link.click(); 
+                document.body.removeChild(link); 
+        }
+        $('#ncexport').click(function () {
+            let selectArr = selest_nc.getValue();
+            let selectStr = ''
+            for (let i = 0; i < selectArr.length; i++) {
+                selectStr += selectArr[i].value+','
+            }
+            selectStr = selectStr.substr(0, selectStr.length-1)
+            let starTime = new Date($('input[name="query_start_time"]').val()).getTime()/1000;
+            let endTime = new Date($('input[name="query_end_time"]').val()).getTime()/1000;
+            let cid = selectStr
+            let order_time_type = $('#order_time_type').val()
+            $.get('index.php?act=orderstats&op=ExportData&type=provider', {
+                query_start_time: starTime,
+                query_end_time: endTime,
+                cid: cid,
+                order_time_type:order_time_type
+            }, function (data) {
+                data = JSON.parse(data)
+                if (data && data.data) {
+                    let head = ['北京椰子电子商务有限责任公司']
+                    let time = ''
+                    if (starTime && endTime) {
+                        time = '统计时间:'+$('input[name="query_start_time"]').val()+' - '+$('input[name="query_end_time"]').val()
+                    } else if (starTime) {
+                        time = '统计时间:'+$('input[name="query_start_time"]').val()
+                    }
+                    if (time) {
+                        head.push(time)
+                    }
+                    head.push('总计成功订单数量:' + parseInt(data.total_stats.success_count_total))
+                    head.push('总计成功订单金额:' + parseFloat(data.total_stats.success_refill_amounts_total))
+                    head.push('总计下游扣款金额:' + parseFloat(data.total_stats.success_mch_amounts_toatl))
+                    head.push('总计上游扣款金额:' + parseFloat(data.total_stats.success_channel_amounts_total))
+                    head.push('总计利润金额:' + parseFloat(data.total_stats.profit_amounts_total))
+                    let title = [{value: "序号"},{value: "统计日期"},{value: "主体名称"},{value: "主体ID"},{value: "成功订单数"},{value: "成功金额"},{value: "上游金额"},{value: "下游金额"},{value: "利润"},{value: "订单总量"}, {value: "失败订单数量"},{value: "成功占比"}]
+                    JSONToExcelConvertor(data.data, '上游对账记录', title, head)
+                }
+            })
+        })
+        //多选
+    let selest_nc
+    let default_no_mch = $('input[name="default_no_mch"]').val().split(',');
+    $.get('index.php?act=refill_order&op=provider_data', function (data) {
+        data = JSON.parse(data)
+        if (default_no_mch) {
+            for (let index = 0; index < default_no_mch.length; index++) {
+                for (let j = 0; j < data.length; j++) {
+                    if (default_no_mch[index] == data[j].value) {
+                        data[j].selected = true
+                    }
+                }
+            }
+        }
+        selest_nc = xmSelect.render({
+            el: '#selest_nc',
+            size: 'mini',
+            filterable: true,
+            style: {
+                minHeight: '27px',
+                lineHeight: '27px',
+                marginLeft: '4px',
+                width: '250px'
+            },
+            language: 'zn',
+            data: data
+        })
+    })
+    });
+</script>

File diff suppressed because it is too large
+ 667 - 629
admin/templates/default/refill.order.index.php


+ 12 - 0
admin/templates/default/system.order.stats.php

@@ -17,6 +17,9 @@
                 <li><a href="JavaScript:void(0);" class="current"><span>平台对账记录</span></a></li>
                 <li><a href="index.php?act=OrderStats&op=index&type=provider"><span>上游对账记录</span></a></li>
                 <li><a href="index.php?act=OrderStats&op=index&type=merchant"><span>下游对账记录</span></a></li>
+                <li><a href="index.php?act=OrderStats&op=refill_balance&type=system"><span>平台结余记录</span></a></li>
+                <li><a href="index.php?act=OrderStats&op=refill_balance&type=provider"><span>上游结余记录</span></a></li>
+                <li><a href="index.php?act=OrderStats&op=refill_balance&type=merchant"><span>下游结余记录</span></a></li>
             </ul>
         </div>
     </div>
@@ -24,6 +27,7 @@
     <form method="get" name="formSearch" id="formSearch">
         <input type="hidden" value="OrderStats" name="act">
         <input type="hidden" value="index" name="op">
+        <input type="hidden" value="system" name="type">
         <table class="tb-type1 noborder search">
             <tbody>
             <tr>
@@ -100,6 +104,7 @@
                 <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>
@@ -120,6 +125,13 @@
                         <td class="align-center"><?php echo $v['success_refill_amounts']; ?></td>
                         <td class="align-center"><?php echo $v['success_mch_amounts']; ?></td>
                         <td class="align-center"><?php echo $v['success_channel_amounts']; ?></td>
+                        <td class="align-center">
+                            <?php if($v['send_count'] != 0){?>
+                            <span style="color: #f30707">
+                            <?php }?>
+                            <?php echo $v['send_count']; ?>
+                            </span>
+                        </td>
                         <td class="align-center"><?php echo $v['profit_amounts']; ?></td>
                         <td class="align-center"><?php echo $v['service_amounts']; ?></td>
                         <td class="align-center"><?php echo $v['order_count']; ?></td>

+ 302 - 0
admin/templates/default/system.refill.balance.php

@@ -0,0 +1,302 @@
+<?php defined('InShopNC') or exit('Access Invalid!'); ?>
+<style>
+    .row_q ul li {
+        height: 30px;
+        line-height: 30px;
+    }
+    .row_w {
+        float: left;
+        margin-right: 40px;
+    }
+</style>
+<div class="page">
+    <div class="fixed-bar">
+        <div class="item-title">
+            <h3>对账管理</h3>
+            <ul class="tab-base">
+                <li><a href="index.php?act=OrderStats&op=index&type=system"><span>平台对账记录</span></a></li>
+                <li><a href="index.php?act=OrderStats&op=index&type=provider"><span>上游对账记录</span></a></li>
+                <li><a href="index.php?act=OrderStats&op=index&type=merchant"><span>下游对账记录</span></a></li>
+                <li><a href="JavaScript:void(0);" class="current"><span>平台结余记录</span></a></li>
+                <li><a href="index.php?act=OrderStats&op=refill_balance&type=provider"><span>上游结余记录</span></a></li>
+                <li><a href="index.php?act=OrderStats&op=refill_balance&type=merchant"><span>下游结余记录</span></a></li>
+            </ul>
+        </div>
+    </div>
+    <div class="fixed-empty"></div>
+    <form method="get" name="formSearch" id="formSearch">
+        <input type="hidden" value="OrderStats" name="act">
+        <input type="hidden" value="refill_balance" name="op">
+        <input type="hidden" value="system" name="type">
+        <table class="tb-type1 noborder search">
+            <tbody>
+            <tr>
+                <th><label for="query_start_time">结余统计时间</label></th>
+                <td>
+                    <input class="txt date" type="text" value="<?php echo $_GET['query_start_time']; ?>"
+                           id="startTime" name="query_start_time" autocomplete="off" style="width:120px" />
+                    <label for="query_start_time">~</label>
+                    <input class="txt date" type="text" value="<?php echo $_GET['query_end_time']; ?>"
+                           id="endTime" name="query_end_time" autocomplete="off" style="width:120px" /></td>
+                <td>
+                <th><label>统计日期类型</label></th>
+                <td>
+                    <select name="order_time_type" id="order_time_type">
+                        <option value="">请选择...</option>
+                        <option value="notify_time" <?php if($_GET['order_time_type'] == 'notify_time'){ echo 'selected';}?>>回调日期</option>
+                        <option value="order_time" <?php if($_GET['order_time_type'] == 'order_time'){ echo 'selected';}?>>下单日期</option>
+                    </select>
+                </td>
+                </td>
+                <td><a href="javascript:void(0);" id="ncsubmit" class="btn-search "
+                       title="<?php echo $lang['nc_query']; ?>">&nbsp;</a>
+                    <?php if ($output['mch_name'] != '') { ?>
+                        <a href="index.php?act=OrderStats&op=index" class="btns "
+                           title="<?php echo $lang['nc_cancel_search']; ?>"><span><?php echo $lang['nc_cancel_search']; ?></span></a>
+                    <?php } ?></td>
+<!--                <td>-->
+<!--                    <a href="javascript:void(0);" id="ncexport" class="btn">-->
+<!--                        <span>导出</span>-->
+<!--                    </a>-->
+<!--                </td>-->
+            </tr>
+            </tbody>
+        </table>
+    </form>
+<!--       <table class="table tb-type2" id="prompt">-->
+<!--        <tbody>-->
+<!--          <tr class="space odd">-->
+<!--            <th colspan="12"><div class="title">-->
+<!--                <h5>总量统计</h5>-->
+<!--                <span class="arrow"></span></div></th>-->
+<!--          </tr>-->
+<!--          <tr>-->
+<!--            <td class="row_q">-->
+<!--                <ul class="row_w">-->
+<!--                    <li>回调日期统计</li>-->
+<!--                    <li class="lineLi" style="color:#000;">总计成功订单量: --><?php //echo $output['total_stats']['notify_time']['success_count_total'] ?? 0?><!--</li>-->
+<!--                    <li class="lineLi" style="color:#000;">总计成功订单金额:--><?php //echo $output['total_stats']['notify_time']['success_refill_amounts_total'] ?? 0?><!--</li>-->
+<!--                    <li class="lineLi" style="color:#000;">总计下游扣款金额:--><?php //echo $output['total_stats']['notify_time']['success_mch_amounts_toatl'] ?? 0?><!--</li>-->
+<!--                    <li class="lineLi" style="color:#000;">总计上游扣款金额:--><?php //echo $output['total_stats']['notify_time']['success_channel_amounts_total'] ?? 0?><!--</li>-->
+<!--                    <li class="lineLi" style="color:#000;">总计利润:--><?php //echo $output['total_stats']['notify_time']['profit_amounts_total'] ?? 0?><!--</li>-->
+<!--                </ul>-->
+<!--                <ul>-->
+<!--                    <li>下单日期统计</li>-->
+<!--                    <li class="lineLi" style="color:#000;">总计成功订单量: --><?php //echo $output['total_stats']['order_time']['success_count_total'] ?? 0?><!--</li>-->
+<!--                    <li class="lineLi" style="color:#000;">总计成功订单金额:--><?php //echo $output['total_stats']['order_time']['success_refill_amounts_total'] ?? 0?><!--</li>-->
+<!--                    <li class="lineLi" style="color:#000;">总计下游扣款金额:--><?php //echo $output['total_stats']['order_time']['success_mch_amounts_toatl'] ?? 0?><!--</li>-->
+<!--                    <li class="lineLi" style="color:#000;">总计上游扣款金额:--><?php //echo $output['total_stats']['order_time']['success_channel_amounts_total'] ?? 0?><!--</li>-->
+<!--                    <li class="lineLi" style="color:#000;">总计利润:--><?php //echo $output['total_stats']['order_time']['profit_amounts_total'] ?? 0?><!--</li>-->
+<!--                </ul>-->
+<!--            </td>-->
+<!--          </tr>-->
+<!--        </tbody>-->
+<!--      </table>-->
+    <form method="post" id="merchant_name_form">
+        <input type="hidden" name="form_submit" value="ok"/>
+        <table class="table tb-type2">
+            <thead>
+            <tr class="thead">
+                <th>记录ID</th>
+                <th>父ID</th>
+                <th>主体名称</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-left">更新日期</th>
+                <th class="align-center">确认状态</th>
+                <th class="align-center">统计日期类型</th>
+                <th class="align-left">备注</th>
+                <!--                <th class="align-center">操作</th>-->
+            </tr>
+            </thead>
+            <tbody>
+            <?php if (!empty($output['stats_list']) && is_array($output['stats_list'])) { ?>
+                <?php foreach ($output['stats_list'] as $k => $v) { ?>
+                    <tr class="trFlex">
+                        <td><?php echo $v['balance_id']; ?></td>
+                        <td><?php echo $v['parent_id']; ?></td>
+                        <td><?php echo $v['cname']; ?></td>
+                        <td class="align-left"><?php echo $v['start_stamp'] ? date('Y-m-d H:i', $v['start_stamp']) : '/'; ?></td>
+                        <td class="align-left"><?php echo $v['end_text']; ?></td>
+                        <td class="align-center"><?php echo $v['success_count']; ?></td>
+                        <td class="align-center"><?php echo $v['refill_amount']; ?></td>
+                        <td class="align-center"><?php echo $v['mch_amount']; ?></td>
+                        <td class="align-center"><?php echo $v['channel_amount']; ?></td>
+                        <td class="align-center"><?php echo $v['profit_amount']; ?></td>
+                        <td class="align-center"><?php echo $v['transfer_in']; ?></td>
+                        <td class="align-center"><?php echo $v['transfer_out']; ?></td>
+                        <td class="align-center"><?php echo $v['refund_amount']; ?></td>
+                        <td class="align-center"><?php echo $v['except_amount']; ?></td>
+                        <td class="align-center"><?php echo $v['accumulate_balance']; ?></td>
+                        <td class="align-center"><?php echo $v['balance']; ?></td>
+                        <td class="align-left"><?php echo date("Y-m-d H:i:s", $v['update_time']); ?></td>
+                        <td class="align-center">
+                            <?php if($v['confirmed'] == 0){?>
+                                <span style="color: #fd9d0e">未确认</span>
+                            <?php }else{?>
+                                <span style="color: #0bb20c">已确认</span>
+                            <?php }?>
+                        </td>
+                        <td class="align-center"><?php echo $output['order_time_type_text'][$v['time_type']]; ?></td>
+                        <td class="align-left"><?php echo $v['remark']; ?></td>
+                        <!--                        <td class="align-center w200">-->
+<!--                            <a href="index.php?act=merchant&op=OrderStatsReload&stat_id=--><?php //echo $v['stat_id'];?><!--">重新统计</a>-->
+<!--                        </td>-->
+                    </tr>
+                <?php } ?>
+            <?php } else { ?>
+                <tr class="no_data">
+                    <td colspan="19"><?php echo $lang['nc_no_record']; ?></td>
+                </tr>
+            <?php } ?>
+            </tbody>
+            <tfoot>
+            <tr class="tfoot">
+                <td></td>
+                <td colspan="19">
+                    <div class="pagination"><?php echo $output['show_page']; ?></div>
+                </td>
+            </tr>
+            </tfoot>
+        </table>
+    </form>
+</div>
+<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/js/jquery.edit.js" charset="utf-8"></script>
+<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/laydate/laydate.js"></script>
+<script>
+    $(function () {
+        $('#ncsubmit').click(function () {
+            $('#formSearch').submit();
+        });
+        // 日期选择器
+        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'
+            })
+        })
+        function JSONToExcelConvertor(JSONData, FileName, ShowLabel, headData) { 
+            //先转化json 
+            let arrData = typeof JSONData != 'object' ? JSON.parse(JSONData) : JSONData; 
+            let excel = '<table>';   
+            // 标题
+            for (const key in headData) {
+                var head = "<tr>";
+                var td = "<td colspan='13' style='font-size:16px;'>"+ headData[key] + '</td>';
+                excel += td + "</tr>";
+            }
+            //设置表头 
+            let row = "<tr>"; 
+            for (var i = 0, l = ShowLabel.length; i < l; i++) { 
+                row += "<th style='font-size:14px;'>" + ShowLabel[i].value + '</th>'; 
+            }
+            //换行 
+            excel += row + "</tr>"; 
+            //设置数据 
+            for (var i = 0; i < arrData.length; i++) { 
+                var tr = "<tr>";
+                let code = i+1
+                tr += "<td>" +code+ "</td>"
+                tr += '<td style=font-size:14px;'+ 'mso-number-format:"\@"'+ '>' + arrData[i].time_text + '</td>';
+                tr += '<td style=font-size:14px;'+ 'mso-number-format:"\@"'+ '>' + arrData[i].cname + '</td>';
+                tr += '<td style=font-size:14px;'+ 'mso-number-format:"\@"'+ '>' + arrData[i].cid + '</td>';
+                tr += '<td style=font-size:14px;'+ 'mso-number-format:"\@"'+ '>' + arrData[i].success_count + '</td>';
+                tr += '<td style=font-size:14px;'+ 'mso-number-format:"\@"'+ '>' + arrData[i].success_refill_amounts + '</td>';
+                tr += '<td style=font-size:14px;'+ 'mso-number-format:"\@"'+ '>' + arrData[i].success_mch_amounts + '</td>';
+                tr += '<td style=font-size:14px;'+ 'mso-number-format:"\@"'+ '>' + arrData[i].success_channel_amounts + '</td>';
+                tr += '<td style=font-size:14px;'+ 'mso-number-format:"\@"'+ '>' + arrData[i].profit_amounts + '</td>';
+                tr += '<td style=font-size:14px;'+ 'mso-number-format:"\@"'+ '>' + arrData[i].service_amounts + '</td>';
+                tr += '<td style=font-size:14px;'+ 'mso-number-format:"\@"'+ '>' + arrData[i].order_count + '</td>';
+                tr += '<td style=font-size:14px;'+ 'mso-number-format:"\@"'+ '>' + arrData[i].cancel_count + '</td>';
+                tr += '<td style=font-size:14px;'+ 'mso-number-format:"\@"'+ '>' + arrData[i].success_ratio + '</td>';
+                excel += tr + "</tr>";
+            } 
+                excel += "</table>"; 
+                var excelFile = "<html xmlns:o='urn:schemas-microsoft-com:office:office' xmlns:x='urn:schemas-microsoft-com:office:excel' xmlns='http://www.w3.org/TR/REC-html40'>"; 
+                excelFile += '<meta http-equiv="content-type" content="application/vnd.ms-excel; charset=UTF-8">'; 
+                excelFile += '<meta http-equiv="content-type" content="application/vnd.ms-excel'; 
+                excelFile += '; charset=UTF-8">'; 
+                excelFile += "<head>"; 
+                excelFile += "<!--[if gte mso 9]>";
+                excelFile += "<xml>";
+                excelFile += "<x:ExcelWorkbook>"; 
+                excelFile += "<x:ExcelWorksheets>"; 
+                excelFile += "<x:ExcelWorksheet>"; 
+                excelFile += "<x:Name>"; 
+                excelFile += "{worksheet}"; 
+                excelFile += "</x:Name>"; 
+                excelFile += "<x:WorksheetOptions>"; 
+                excelFile += "<x:DisplayGridlines/>"; 
+                excelFile += "</x:WorksheetOptions>"; 
+                excelFile += "</x:ExcelWorksheet>"; 
+                excelFile += "</x:ExcelWorksheets>"; 
+                excelFile += "</x:ExcelWorkbook>"; 
+                excelFile += "</xml>"; 
+                excelFile += "<![endif]-->"; 
+                excelFile += "</head>"; 
+                excelFile += "<body>"; 
+                excelFile += excel; 
+                excelFile += "</body>"; 
+                excelFile += "</html>"; 
+                var uri = 'data:application/vnd.ms-excel;charset=utf-8,' + encodeURIComponent(excelFile); 
+                var link = document.createElement("a");   
+                link.href = uri; 
+                link.style = "visibility:hidden"; 
+                link.download = FileName + ".xls"; 
+                document.body.appendChild(link); 
+                link.click(); 
+                document.body.removeChild(link); 
+        }
+        $('#ncexport').click(function () {
+            let starTime = new Date($('input[name="query_start_time"]').val()).getTime()/1000;
+            let endTime = new Date($('input[name="query_end_time"]').val()).getTime()/1000;
+            let order_time_type = $('#order_time_type').val();
+            $.get('index.php?act=orderstats&op=ExportData', {
+                query_start_time: starTime,
+                query_end_time: endTime,
+                order_time_type:order_time_type
+            }, function (data) {
+                data = JSON.parse(data)
+                if (data && data.data) {
+                    let head = ['北京椰子电子商务有限责任公司']
+                    let time = ''
+                    if (starTime && endTime) {
+                        time = '统计时间:'+$('input[name="query_start_time"]').val()+' - '+$('input[name="query_end_time"]').val()
+                        head.push(time)
+                    } else if (starTime) {
+                        time = '统计时间:'+$('input[name="query_start_time"]').val()
+                        head.push(time)
+                    }
+                    head.push('总计成功订单数量:' + parseInt(data.total_stats.success_count_total))
+                    head.push('总计成功订单金额:' + parseFloat(data.total_stats.success_refill_amounts_total))
+                    head.push('总计下游扣款金额:' + parseFloat(data.total_stats.success_mch_amounts_toatl))
+                    head.push('总计上游扣款金额:' + parseFloat(data.total_stats.success_channel_amounts_total))
+                    head.push('总计利润金额:' + parseFloat(data.total_stats.profit_amounts_total))
+                    let title = [{value: "序号"},{value: "统计日期"},{value: "主体名称"},{value: "主体ID"},{value: "成功订单数"},{value: "成功金额"},{value: "下游金额"},{value: "上游金额"},{value: "利润"},{value: "服务费"},{value: "订单总量"}, {value: "失败订单数量"},{value: "成功占比"}]
+                    JSONToExcelConvertor(data.data, '平台对账记录', title, head)
+                }
+            })
+        })
+    });
+</script>

+ 10 - 42
data/config/dev/refill.ini.php

@@ -20,8 +20,8 @@ $tianjt_oil = ['name' => 'tianjt', 'store_id' => 7,'qualitys' => '1',
     'amount' => [
         100 => [['goods_id' => 6290, 'price' => 97.0, 'quality' => 1, 'card_type' => 'sinopec']],
         200 => [['goods_id' => 6291, 'price' => 194, 'quality' => 1, 'card_type' => 'sinopec']],
-        500 => [['goods_id' => 6292, 'price' => 485, 'quality' => 1, 'card_type' => 'sinopec']],
-        1000 => [['goods_id' => 6293, 'price' => 970, 'quality' => 1, 'card_type' => 'sinopec']]
+        500 => [['goods_id' => 6292, 'price' => 486, 'quality' => 1, 'card_type' => 'sinopec']],
+        1000 => [['goods_id' => 6293, 'price' => 971, 'quality' => 1, 'card_type' => 'sinopec']]
     ],
     'period' => ['start' => '8:30', 'end' => '22:20'], 'refill_type' => 'api'];
 
@@ -214,67 +214,35 @@ $lingzh_phone = ['name' => 'lingzh', 'store_id' => 28,'qualitys' => '1,3,4,5,6',
     'amount' => [
         10 => [
             ['goods_id' => 6389, 'price' => 9.53, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6389, 'price' => 9.51, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom'],
-            ['goods_id' => 6389, 'price' => 9.53, 'quality' => 3, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6389, 'price' => 8.95, 'quality' => 4, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6389, 'price' => 8.99, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6389, 'price' => 8.99, 'quality' => 6, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
+            ['goods_id' => 6389, 'price' => 9.51, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
         ],
         20 => [
             ['goods_id' => 6390, 'price' => 19.06, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6390, 'price' => 19.02, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom'],
-            ['goods_id' => 6390, 'price' => 19.06, 'quality' => 3, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6390, 'price' => 17.9, 'quality' => 4, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6390, 'price' => 17.98, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6390, 'price' => 17.98, 'quality' => 6, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']
+            ['goods_id' => 6390, 'price' => 19.02, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
         ],
         30 => [
             ['goods_id' => 6391, 'price' => 28.59, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6391, 'price' => 28.53, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom'],
-            ['goods_id' => 6391, 'price' => 28.59, 'quality' => 3, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6391, 'price' => 26.85, 'quality' => 4, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6391, 'price' => 26.97, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6391, 'price' => 26.97, 'quality' => 6, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']
+            ['goods_id' => 6391, 'price' => 28.53, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
         ],
         50 => [
             ['goods_id' => 6392, 'price' => 47.65, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6392, 'price' => 47.55, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom'],
-            ['goods_id' => 6392, 'price' => 47.65, 'quality' => 3, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6392, 'price' => 44.75, 'quality' => 4, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6392, 'price' => 44.95, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6392, 'price' => 44.95, 'quality' => 6, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']
+            ['goods_id' => 6392, 'price' => 47.55, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
         ],
         100 => [
             ['goods_id' => 6393, 'price' => 95.3, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6393, 'price' => 95.1, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom'],
-            ['goods_id' => 6393, 'price' => 95.3, 'quality' => 3, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6393, 'price' => 89.5, 'quality' => 4, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6393, 'price' => 89.9, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6393, 'price' => 89.9, 'quality' => 6, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']
+            ['goods_id' => 6393, 'price' => 95.1, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
         ],
         200 => [
             ['goods_id' => 6394, 'price' => 190.60, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6394, 'price' => 190.20, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom'],
-            ['goods_id' => 6394, 'price' => 190.60, 'quality' => 3, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6394, 'price' => 179, 'quality' => 4, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6394, 'price' => 179.8, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6394, 'price' => 179.8, 'quality' => 6, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']
+            ['goods_id' => 6394, 'price' => 190.20, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
         ],
         300 => [
             ['goods_id' => 6395, 'price' => 285.90, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6395, 'price' => 285.30, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom'],
-            ['goods_id' => 6395, 'price' => 285.90, 'quality' => 3, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6395, 'price' => 268.5, 'quality' => 4, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6395, 'price' => 269.7, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6395, 'price' => 269.7, 'quality' => 6, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']
+            ['goods_id' => 6395, 'price' => 285.30, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
         ],
         500 => [
             ['goods_id' => 6396, 'price' => 476.50, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6396, 'price' => 475.50, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom'],
-            ['goods_id' => 6396, 'price' => 476.50, 'quality' => 3, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6396, 'price' => 447.5,  'quality' => 4, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6396, 'price' => 449.5, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6396, 'price' => 449.5, 'quality' => 6, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']
+            ['goods_id' => 6396, 'price' => 475.50, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
         ]
     ],
     'official_sn' => true, 'refill_type' => 'api'];

+ 1 - 33
data/config/win/refill.ini.php

@@ -276,71 +276,39 @@ $bjb_phone = ['name' => 'bjb', 'store_id' => 12,'qualitys' => '1',
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 
-$lingzh_phone = ['name' => 'lingzh', 'store_id' => 28,'qualitys' => '1,3,4,5,6',
+$lingzh_phone = ['name' => 'lingzh', 'store_id' => 28,'qualitys' => '1',
     'amount' => [
         10 => [
             ['goods_id' => 6389, 'price' => 9.53, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6389, 'price' => 9.51, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom'],
-            ['goods_id' => 6389, 'price' => 9.53, 'quality' => 3, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6389, 'price' => 8.95, 'quality' => 4, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6389, 'price' => 8.99, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6389, 'price' => 8.99, 'quality' => 6, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
         ],
         20 => [
             ['goods_id' => 6390, 'price' => 19.06, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6390, 'price' => 19.02, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom'],
-            ['goods_id' => 6390, 'price' => 19.06, 'quality' => 3, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6390, 'price' => 17.9, 'quality' => 4, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6390, 'price' => 17.98, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6390, 'price' => 17.98, 'quality' => 6, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']
         ],
         30 => [
             ['goods_id' => 6391, 'price' => 28.44, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6391, 'price' => 28.44, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom'],
-            ['goods_id' => 6391, 'price' => 28.59, 'quality' => 3, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6391, 'price' => 26.85, 'quality' => 4, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6391, 'price' => 26.97, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6391, 'price' => 26.97, 'quality' => 6, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']
         ],
         50 => [
             ['goods_id' => 6392, 'price' => 47.4, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6392, 'price' => 47.4, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom'],
-            ['goods_id' => 6392, 'price' => 47.65, 'quality' => 3, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6392, 'price' => 44.75, 'quality' => 4, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6392, 'price' => 44.95, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6392, 'price' => 44.95, 'quality' => 6, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']
         ],
         100 => [
             ['goods_id' => 6393, 'price' => 94.8, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6393, 'price' => 94.8, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom'],
-            ['goods_id' => 6393, 'price' => 95.3, 'quality' => 3, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6393, 'price' => 89.5, 'quality' => 4, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6393, 'price' => 89.9, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6393, 'price' => 89.9, 'quality' => 6, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']
         ],
         200 => [
             ['goods_id' => 6394, 'price' => 189.60, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6394, 'price' => 189.60, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom'],
-            ['goods_id' => 6394, 'price' => 190.60, 'quality' => 3, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6394, 'price' => 179, 'quality' => 4, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6394, 'price' => 179.8, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6394, 'price' => 179.8, 'quality' => 6, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']
         ],
         300 => [
             ['goods_id' => 6395, 'price' => 285.90, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6395, 'price' => 285.30, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom'],
-            ['goods_id' => 6395, 'price' => 285.90, 'quality' => 3, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6395, 'price' => 268.5, 'quality' => 4, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6395, 'price' => 269.7, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6395, 'price' => 269.7, 'quality' => 6, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']
         ],
         500 => [
             ['goods_id' => 6396, 'price' => 476.50, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6396, 'price' => 475.50, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom'],
-            ['goods_id' => 6396, 'price' => 476.50, 'quality' => 3, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6396, 'price' => 447.5,  'quality' => 4, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6396, 'price' => 449.5, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6396, 'price' => 449.5, 'quality' => 6, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']
         ]
     ],
     'official_sn' => true, 'refill_type' => 'api'];

+ 207 - 163
data/config/xyz/refill.ini.php

@@ -276,71 +276,39 @@ $bjb_phone = ['name' => 'bjb', 'store_id' => 12,'qualitys' => '1',
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 
-$lingzh_phone = ['name' => 'lingzh', 'store_id' => 28,'qualitys' => '1,3,4,5,6',
+$lingzh_phone = ['name' => 'lingzh', 'store_id' => 28,'qualitys' => '1',
     'amount' => [
         10 => [
             ['goods_id' => 6389, 'price' => 9.53, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6389, 'price' => 9.51, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom'],
-            ['goods_id' => 6389, 'price' => 9.53, 'quality' => 3, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6389, 'price' => 8.95, 'quality' => 4, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6389, 'price' => 8.99, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6389, 'price' => 8.99, 'quality' => 6, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
         ],
         20 => [
             ['goods_id' => 6390, 'price' => 19.06, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6390, 'price' => 19.02, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom'],
-            ['goods_id' => 6390, 'price' => 19.06, 'quality' => 3, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6390, 'price' => 17.9, 'quality' => 4, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6390, 'price' => 17.98, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6390, 'price' => 17.98, 'quality' => 6, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']
         ],
         30 => [
             ['goods_id' => 6391, 'price' => 28.44, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6391, 'price' => 28.44, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom'],
-            ['goods_id' => 6391, 'price' => 28.59, 'quality' => 3, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6391, 'price' => 26.85, 'quality' => 4, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6391, 'price' => 26.97, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6391, 'price' => 26.97, 'quality' => 6, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']
         ],
         50 => [
             ['goods_id' => 6392, 'price' => 47.4, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6392, 'price' => 47.4, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom'],
-            ['goods_id' => 6392, 'price' => 47.65, 'quality' => 3, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6392, 'price' => 44.75, 'quality' => 4, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6392, 'price' => 44.95, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6392, 'price' => 44.95, 'quality' => 6, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']
         ],
         100 => [
             ['goods_id' => 6393, 'price' => 94.8, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6393, 'price' => 94.8, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom'],
-            ['goods_id' => 6393, 'price' => 95.3, 'quality' => 3, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6393, 'price' => 89.5, 'quality' => 4, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6393, 'price' => 89.9, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6393, 'price' => 89.9, 'quality' => 6, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']
         ],
         200 => [
             ['goods_id' => 6394, 'price' => 189.60, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6394, 'price' => 189.60, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom'],
-            ['goods_id' => 6394, 'price' => 190.60, 'quality' => 3, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6394, 'price' => 179, 'quality' => 4, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6394, 'price' => 179.8, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6394, 'price' => 179.8, 'quality' => 6, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']
         ],
         300 => [
             ['goods_id' => 6395, 'price' => 285.90, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6395, 'price' => 285.30, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom'],
-            ['goods_id' => 6395, 'price' => 285.90, 'quality' => 3, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6395, 'price' => 268.5, 'quality' => 4, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6395, 'price' => 269.7, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6395, 'price' => 269.7, 'quality' => 6, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']
         ],
         500 => [
             ['goods_id' => 6396, 'price' => 476.50, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6396, 'price' => 475.50, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom'],
-            ['goods_id' => 6396, 'price' => 476.50, 'quality' => 3, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6396, 'price' => 447.5,  'quality' => 4, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6396, 'price' => 449.5, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6396, 'price' => 449.5, 'quality' => 6, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']
         ]
     ],
     'official_sn' => true, 'refill_type' => 'api'];
@@ -558,46 +526,46 @@ $xc_phone = ['name' => 'xc', 'store_id' => 34, 'qualitys' => '4',
 
 $xunyin_phone = ['name' => 'xunyin', 'store_id' => 35,'qualitys' => '2',
     'amount' => [
-        10 => [
-            ['goods_id' => 6438, 'price' => 10.05, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6438, 'price' => 10.15, 'quality' => 2, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 6438, 'price' => 10, 'quality' => 2, 'card_type' => 'chinatelecom']
-        ],
-        20 => [
-            ['goods_id' => 6439, 'price' => 20.1, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6439, 'price' => 20.3, 'quality' => 2, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 6439, 'price' => 20, 'quality' => 2, 'card_type' => 'chinatelecom']
-        ],
-        30 => [
-            ['goods_id' => 6440, 'price' => 30.15, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6440, 'price' => 30.24, 'quality' => 2, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 6440, 'price' => 29.85, 'quality' => 2, 'card_type' => 'chinatelecom']
-        ],
+//        10 => [
+//            ['goods_id' => 6438, 'price' => 10.01, 'quality' => 2, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 6438, 'price' => 10.01, 'quality' => 2, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 6438, 'price' => 10.01, 'quality' => 2, 'card_type' => 'chinatelecom']
+//        ],
+//        20 => [
+//            ['goods_id' => 6439, 'price' => 20.02, 'quality' => 2, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 6439, 'price' => 20.02, 'quality' => 2, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 6439, 'price' => 20.02, 'quality' => 2, 'card_type' => 'chinatelecom']
+//        ],
+//        30 => [
+//            ['goods_id' => 6440, 'price' => 30.03, 'quality' => 2, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 6440, 'price' => 30.03, 'quality' => 2, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 6440, 'price' => 29.03, 'quality' => 2, 'card_type' => 'chinatelecom']
+//        ],
         50 => [
-            ['goods_id' => 6441, 'price' => 50.1, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6441, 'price' => 50.1, 'quality' => 2, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 6441, 'price' => 49.75, 'quality' => 2, 'card_type' => 'chinatelecom']
+            ['goods_id' => 6441, 'price' => 50.05, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6441, 'price' => 50.05, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 6441, 'price' => 50.05, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
 
         100 => [
-            ['goods_id' => 6442, 'price' => 100.2, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6442, 'price' => 100.2, 'quality' => 2, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 6442, 'price' => 100.2, 'quality' => 2, 'card_type' => 'chinatelecom']
+            ['goods_id' => 6442, 'price' => 100.1, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6442, 'price' => 100.1, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 6442, 'price' => 100.1, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         200 => [
-            ['goods_id' => 6443, 'price' => 200.4, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6443, 'price' => 200.4, 'quality' => 2, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 6443, 'price' => 200.4, 'quality' => 2, 'card_type' => 'chinatelecom']
+            ['goods_id' => 6443, 'price' => 200.2, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6443, 'price' => 200.2, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 6443, 'price' => 200.2, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         300 => [
-            ['goods_id' => 6444, 'price' => 300.6, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6444, 'price' => 300.6, 'quality' => 2, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 6444, 'price' => 300.6, 'quality' => 2, 'card_type' => 'chinatelecom']
+            ['goods_id' => 6444, 'price' => 300.3, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6444, 'price' => 300.3, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 6444, 'price' => 300.3, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         500 => [
-            ['goods_id' => 6445, 'price' => 501, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6445, 'price' => 501, 'quality' => 2, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 6445, 'price' => 501, 'quality' => 2, 'card_type' => 'chinatelecom']
+            ['goods_id' => 6445, 'price' => 500.5, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6445, 'price' => 500.5, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 6445, 'price' => 500.5, 'quality' => 2, 'card_type' => 'chinatelecom']
         ]
     ],
     'official_sn' => true, 'refill_type' => 'api'];
@@ -1003,17 +971,16 @@ $yunsuoyao_phone = ['name' => 'yunsuoyao', 'store_id' => 55, 'qualitys' => '1',
             ['goods_id' => 6576, 'price' => 190.2, 'quality' => 1, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6576, 'price' => 189.6, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
-
-        300 => [
-            ['goods_id' => 6577, 'price' => 285.9, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6577, 'price' => 287.4, 'quality' => 1, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 6577, 'price' => 285.9, 'quality' => 1, 'card_type' => 'chinatelecom']
-        ],
-        500 => [
-            ['goods_id' => 6578, 'price' => 476.5, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6578, 'price' => 479, 'quality' => 1, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 6578, 'price' => 476.5, 'quality' => 1, 'card_type' => 'chinatelecom']
-        ]
+//        300 => [
+//            ['goods_id' => 6577, 'price' => 285.9, 'quality' => 1, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 6577, 'price' => 287.4, 'quality' => 1, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 6577, 'price' => 285.9, 'quality' => 1, 'card_type' => 'chinatelecom']
+//        ],
+//        500 => [
+//            ['goods_id' => 6578, 'price' => 476.5, 'quality' => 1, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 6578, 'price' => 479, 'quality' => 1, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 6578, 'price' => 476.5, 'quality' => 1, 'card_type' => 'chinatelecom']
+//        ]
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 
@@ -1523,16 +1490,16 @@ $qijutang_phone = ['name' => 'qijutang', 'store_id' => 75, 'qualitys' => '1',
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 
-$lingzhman48_phone = ['name' => 'lingzhman48', 'store_id' => 76, 'qualitys' => '8',
+$lingzhman48_phone = ['name' => 'lingzhman48', 'store_id' => 76, 'qualitys' => '5',
     'amount' => [
-        10 => [['goods_id' => 6732, 'price' => 8.95, 'quality' => 8, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        20 => [['goods_id' => 6733, 'price' => 17.9, 'quality' => 8, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        30 => [['goods_id' => 6734, 'price' => 26.85, 'quality' => 8, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        50 => [['goods_id' => 6735, 'price' => 44.75, 'quality' => 8, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        100 => [['goods_id' => 6736, 'price' => 89.5, 'quality' => 8, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        200 => [['goods_id' => 6737, 'price' => 179, 'quality' => 8, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        300 => [['goods_id' => 6738, 'price' => 268.5, 'quality' => 8, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        500 => [['goods_id' => 6739, 'price' => 447.5, 'quality' => 8, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']]
+        10 => [['goods_id' => 6732, 'price' => 9.3, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        20 => [['goods_id' => 6733, 'price' => 18.6, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        30 => [['goods_id' => 6734, 'price' => 27.9, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        50 => [['goods_id' => 6735, 'price' => 46.5, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        100 => [['goods_id' => 6736, 'price' => 93, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        200 => [['goods_id' => 6737, 'price' => 186, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        300 => [['goods_id' => 6738, 'price' => 279, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        500 => [['goods_id' => 6739, 'price' => 465, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']]
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 
@@ -1616,30 +1583,30 @@ $zhenqi_phone = ['name' => 'zhenqi', 'store_id' => 82, 'qualitys' => '2',
 
 $yunsuoyaofs_phone = ['name' => 'yunsuoyaofs', 'store_id' => 83, 'qualitys' => '1',
     'amount' => [
-        10 => [['goods_id' => 6769, 'price' => 9.54, 'quality' => 1, 'card_type' => 'chinamobile']],
-        20 => [['goods_id' => 6770, 'price' => 19.08, 'quality' => 1, 'card_type' => 'chinamobile']],
+//        10 => [['goods_id' => 6769, 'price' => 9.54, 'quality' => 1, 'card_type' => 'chinamobile']],
+//        20 => [['goods_id' => 6770, 'price' => 19.08, 'quality' => 1, 'card_type' => 'chinamobile']],
         30 => [
             ['goods_id' => 6771, 'price' => 28.5, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6771, 'price' => 28.65, 'quality' => 1, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 6771, 'price' => 28.8, 'quality' => 1, 'card_type' => 'chinatelecom']
+            ['goods_id' => 6771, 'price' => 28.77, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         50 => [
             ['goods_id' => 6772, 'price' => 47.5, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6772, 'price' => 47.75, 'quality' => 1, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 6772, 'price' => 48, 'quality' => 1, 'card_type' => 'chinatelecom']
+            ['goods_id' => 6772, 'price' => 47.95, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         100 => [
             ['goods_id' => 6773, 'price' => 95, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6773, 'price' => 95.5, 'quality' => 1, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 6773, 'price' => 96, 'quality' => 1, 'card_type' => 'chinatelecom']
+            ['goods_id' => 6773, 'price' => 95.9, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         200 => [
             ['goods_id' => 6774, 'price' => 190, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6774, 'price' => 191, 'quality' => 1, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 6774, 'price' => 192, 'quality' => 1, 'card_type' => 'chinatelecom']
+            ['goods_id' => 6774, 'price' => 191.8, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
-        300 => [['goods_id' => 6775, 'price' => 286.2, 'quality' => 1, 'card_type' => 'chinamobile']],
-        500 => [['goods_id' => 6776, 'price' => 477, 'quality' => 1, 'card_type' => 'chinamobile']]
+//        300 => [['goods_id' => 6775, 'price' => 286.2, 'quality' => 1, 'card_type' => 'chinamobile']],
+//        500 => [['goods_id' => 6776, 'price' => 477, 'quality' => 1, 'card_type' => 'chinamobile']]
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 
@@ -2533,86 +2500,86 @@ $yunchonggong_yd_phone = ['name' => 'yunchonggong_yd', 'store_id' => 120, 'quali
 $guochuang_nation_phone = ['name' => 'guochuang_nation', 'store_id' => 121, 'qualitys' => '2',
     'amount' => [
         1  => [
-            ['goods_id' => 7051, 'price' => 1.017, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7051, 'price' => 1.25, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7051, 'price' => 1.031, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         2  => [
-            ['goods_id' => 7052, 'price' => 2.034, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7052, 'price' => 2.05, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7052, 'price' => 2.062, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         3  => [
-            ['goods_id' => 7053, 'price' => 3.051, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7053, 'price' => 3.075, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7053, 'price' => 3.093, 'quality' => 2, 'card_type' => 'chinatelecom']
 
         ],
         4  => [
-            ['goods_id' => 7054, 'price' => 4.068, 'quality' => 2, 'card_type' => 'chinaunicom']
+            ['goods_id' => 7054, 'price' => 4.1, 'quality' => 2, 'card_type' => 'chinaunicom']
         ],
         5  => [
             ['goods_id' => 7055, 'price' => 5.305, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 7055, 'price' => 5.085, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7055, 'price' => 5.125, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7055, 'price' => 5.155, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         6  => [
             ['goods_id' => 7056, 'price' => 6.306, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 7056, 'price' => 6.102, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7056, 'price' => 6.15, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7056, 'price' => 6.186, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         7  => [
             ['goods_id' => 7057, 'price' => 7.308, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 7057, 'price' => 7.119, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7057, 'price' => 7.175, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7057, 'price' => 7.217, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         8  => [
             ['goods_id' => 7058, 'price' => 8.308, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 7058, 'price' => 8.136, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7058, 'price' => 8.2, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7058, 'price' => 8.248, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         9  => [
             ['goods_id' => 7059, 'price' => 9.3105, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 7059, 'price' => 9.153, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7059, 'price' => 9.225, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7059, 'price' => 9.279, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
 
         10 => [
-            ['goods_id' => 7060, 'price' => 10.31, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 7060, 'price' => 10.38, 'quality' => 2, 'card_type' => 'chinamobile'],
             ['goods_id' => 7060, 'price' => 10.05, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7060, 'price' => 10.23, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         20 => [
             ['goods_id' => 7061, 'price' => 20.62, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 7061, 'price' => 20.1, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7061, 'price' => 20.08, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7061, 'price' => 20.46, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         30 => [
             ['goods_id' => 7062, 'price' => 30.27, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 7062, 'price' => 30.024, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7062, 'price' => 30.045, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7062, 'price' => 30.24, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         50 => [
             ['goods_id' => 7063, 'price' => 50.1, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 7063, 'price' => 50.04, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7063, 'price' => 50.075, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7063, 'price' => 50.175, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         100 => [
             ['goods_id' => 7064, 'price' => 100.2, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 7064, 'price' => 100.08, 'quality' => 2, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 7064, 'price' => 100.1, 'quality' => 2, 'card_type' => 'chinatelecom']
+            ['goods_id' => 7064, 'price' => 100.15, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7064, 'price' => 100.3, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         200 => [
             ['goods_id' => 7065, 'price' => 200.4, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 7065, 'price' => 200.16, 'quality' => 2, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 7065, 'price' => 200.2, 'quality' => 2, 'card_type' => 'chinatelecom']
+            ['goods_id' => 7065, 'price' => 200.3, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7065, 'price' => 200.6, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         300 => [
             ['goods_id' => 7066, 'price' => 300.6, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 7066, 'price' => 300.24, 'quality' => 2, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 7066, 'price' => 300.3, 'quality' => 2, 'card_type' => 'chinatelecom']
+            ['goods_id' => 7066, 'price' => 300.45, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7066, 'price' => 300.9, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         500 => [
             ['goods_id' => 7067, 'price' => 501, 'quality' => 2, 'card_type' => 'chinamobile'],
             ['goods_id' => 7067, 'price' => 500.5, 'quality' => 2, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 7067, 'price' => 500.5, 'quality' => 2, 'card_type' => 'chinatelecom']
+            ['goods_id' => 7067, 'price' => 501.5, 'quality' => 2, 'card_type' => 'chinatelecom']
         ]
     ],
     'official_sn' => true, 'refill_type' => 'api'];
@@ -3406,27 +3373,27 @@ $guantu_phone = ['name' => 'guantu', 'store_id' => 157, 'qualitys' => '1',
 
 $yiqian_phone = ['name' => 'yiqian', 'store_id' => 158,'qualitys' => '2',
     'amount' => [
-        10 => [
-            ['goods_id' => 7333, 'price' => 10.36, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 7333, 'price' => 10, 'quality' => 2, 'card_type' => 'chinaunicom']
+//        10 => [
+//            ['goods_id' => 7333, 'price' => 10.36, 'quality' => 2, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 7333, 'price' => 10, 'quality' => 2, 'card_type' => 'chinaunicom']
 //            ['goods_id' => 7333, 'price' => 9.985, 'quality' => 2, 'card_type' => 'chinatelecom']
-        ],
+//        ],
 
-        20 => [
-            ['goods_id' => 7334, 'price' => 20.72, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 7334, 'price' => 20, 'quality' => 2, 'card_type' => 'chinaunicom'],
+//        20 => [
+//            ['goods_id' => 7334, 'price' => 20.72, 'quality' => 2, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 7334, 'price' => 20, 'quality' => 2, 'card_type' => 'chinaunicom'],
 //            ['goods_id' => 7334, 'price' => 19.97, 'quality' => 2, 'card_type' => 'chinatelecom']
-        ],
+//        ],
 
         30 => [
-            ['goods_id' => 7335, 'price' => 30.3, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 7335, 'price' => 29.94, 'quality' => 2, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 7335, 'price' => 30.3, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 7335, 'price' => 30.045, 'quality' => 2, 'card_type' => 'chinaunicom'],
 //            ['goods_id' => 7335, 'price' => 29.955, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
 
         50 => [
 //            ['goods_id' => 7336, 'price' => 49.925, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 7336, 'price' => 49.9, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7336, 'price' => 50.075, 'quality' => 2, 'card_type' => 'chinaunicom'],
 //            ['goods_id' => 7336, 'price' => 49.925, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
 //        平时价格
@@ -3456,25 +3423,25 @@ $yiqian_phone = ['name' => 'yiqian', 'store_id' => 158,'qualitys' => '2',
         //周末高价
         100 => [
             ['goods_id' => 7337, 'price' => 100.2, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 7337, 'price' => 99.8, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7337, 'price' => 100.15, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7337, 'price' => 100.2, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
 
         200 => [
             ['goods_id' => 7338, 'price' => 200.4, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 7338, 'price' => 199.6, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7338, 'price' => 200.3, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7338, 'price' => 200.4, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
 
         300 => [
             ['goods_id' => 7339, 'price' => 300.6, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 7339, 'price' => 299.4, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7339, 'price' => 300.45, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7339, 'price' => 300.6, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
 
         500 => [
             ['goods_id' => 7340, 'price' => 501, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 7340, 'price' => 499, 'quality' => 2, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 7340, 'price' => 500.75, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7340, 'price' => 501, 'quality' => 2, 'card_type' => 'chinatelecom']
         ]
     ],
@@ -4277,24 +4244,24 @@ $youhenew_phone = ['name' => 'youhenew', 'store_id' => 179,'qualitys' => '1',
 //            ['goods_id' => 7513, 'price' => 19.06, 'quality' => 1, 'card_type' => 'chinatelecom']
 //        ],
         30 => [
-//            ['goods_id' => 7514, 'price' => 28.74, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 7514, 'price' => 28.59, 'quality' => 1, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 7514, 'price' => 28.59, 'quality' => 1, 'card_type' => 'chinatelecom']
+            ['goods_id' => 7514, 'price' => 28.86, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 7514, 'price' => 28.5, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7514, 'price' => 28.5, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         50 => [
-            ['goods_id' => 7515, 'price' => 47.9, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 7515, 'price' => 47.65, 'quality' => 1, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 7515, 'price' => 47.65, 'quality' => 1, 'card_type' => 'chinatelecom']
+            ['goods_id' => 7515, 'price' => 48.1, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 7515, 'price' => 47.5, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7515, 'price' => 47.5, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         100 => [
-            ['goods_id' => 7516, 'price' => 95.8, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 7516, 'price' => 95.3, 'quality' => 1, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 7516, 'price' => 95.3, 'quality' => 1, 'card_type' => 'chinatelecom']
+            ['goods_id' => 7516, 'price' => 96.2, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 7516, 'price' => 95, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7516, 'price' => 95, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         200 => [
-            ['goods_id' => 7517, 'price' => 191.6, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 7517, 'price' => 190.6, 'quality' => 1, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 7517, 'price' => 190.6, 'quality' => 1, 'card_type' => 'chinatelecom']
+            ['goods_id' => 7517, 'price' => 192.4, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 7517, 'price' => 190, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7517, 'price' => 190, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
 //        300 => [
 //            ['goods_id' => 7518, 'price' => 287.4, 'quality' => 1, 'card_type' => 'chinamobile'],
@@ -4322,33 +4289,33 @@ $huoshenguo_phone = ['name' => 'huoshenguo', 'store_id' => 180,'qualitys' => '1'
 //            ['goods_id' => 7521, 'price' => 19.1, 'quality' => 1, 'card_type' => 'chinatelecom']
 //        ],
         30 => [
-            ['goods_id' => 7522, 'price' => 28.74, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 7522, 'price' => 28.26, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7522, 'price' => 28.89, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 7522, 'price' => 28.38, 'quality' => 1, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7522, 'price' => 28.44, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         50 => [
-            ['goods_id' => 7523, 'price' => 47.9, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 7523, 'price' => 47.1, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7523, 'price' => 48.15, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 7523, 'price' => 47.3, 'quality' => 1, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7523, 'price' => 47.4, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         100 => [
-            ['goods_id' => 7524, 'price' => 95.8, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 7524, 'price' => 94.2, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7524, 'price' => 96.3, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 7524, 'price' => 94.6, 'quality' => 1, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7524, 'price' => 94.8, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         200 => [
-            ['goods_id' => 7525, 'price' => 191.6, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 7525, 'price' => 188.4, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7525, 'price' => 192.6, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 7525, 'price' => 189.2, 'quality' => 1, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7525, 'price' => 189.6, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         300 => [
-            ['goods_id' => 7526, 'price' => 287.4, 'quality' => 1, 'card_type' => 'chinamobile'],
-//            ['goods_id' => 7526, 'price' => 283.8, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7526, 'price' => 288.9, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 7526, 'price' => 283.8, 'quality' => 1, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7526, 'price' => 284.4, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         500 => [
-            ['goods_id' => 7527, 'price' => 479, 'quality' => 1, 'card_type' => 'chinamobile'],
-//            ['goods_id' => 7527, 'price' => 473, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7527, 'price' => 481.5, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 7527, 'price' => 473, 'quality' => 1, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7527, 'price' => 474, 'quality' => 1, 'card_type' => 'chinatelecom']
         ]
     ],
@@ -4763,27 +4730,28 @@ $zhenghe_phone = ['name' => 'zhenghe', 'store_id' => 192,'qualitys' => '2',
 //        10 => [['goods_id' => 7625, 'price' => 10.05, 'quality' => 2, 'card_type' => 'chinamobile']],
 //        20 => [['goods_id' => 7626, 'price' => 20.1, 'quality' => 2, 'card_type' => 'chinamobile']],
         30 => [
-            ['goods_id' => 7627, 'price' => 30.15, 'quality' => 2, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 7627, 'price' => 30.15, 'quality' => 2, 'card_type' => 'chinamobile'],
             ['goods_id' => 7627, 'price' => 30, 'quality' => 2, 'card_type' => 'chinaunicom'],
         ],
         50 => [
-            ['goods_id' => 7628, 'price' => 50.25, 'quality' => 2, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 7628, 'price' => 50.25, 'quality' => 2, 'card_type' => 'chinamobile'],
             ['goods_id' => 7628, 'price' => 50, 'quality' => 2, 'card_type' => 'chinaunicom'],
         ],
         100 => [
-            ['goods_id' => 7629, 'price' => 100.5, 'quality' => 2, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 7629, 'price' => 100.5, 'quality' => 2, 'card_type' => 'chinamobile'],
             ['goods_id' => 7629, 'price' => 100, 'quality' => 2, 'card_type' => 'chinaunicom'],
         ],
         200 => [
-            ['goods_id' => 7630, 'price' => 201, 'quality' => 2, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 7630, 'price' => 201, 'quality' => 2, 'card_type' => 'chinamobile'],
             ['goods_id' => 7630, 'price' => 200, 'quality' => 2, 'card_type' => 'chinaunicom'],
-
         ],
         300 => [
-            ['goods_id' => 7631, 'price' => 301.5, 'quality' => 2, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 7631, 'price' => 301.5, 'quality' => 2, 'card_type' => 'chinamobile'],
             ['goods_id' => 7631, 'price' => 300, 'quality' => 2, 'card_type' => 'chinaunicom']
         ],
-        500 => [['goods_id' => 7632, 'price' => 502.5, 'quality' => 2, 'card_type' => 'chinamobile']]
+//        500 => [
+//            ['goods_id' => 7632, 'price' => 502.5, 'quality' => 2, 'card_type' => 'chinamobile']
+//        ]
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 
@@ -5019,22 +4987,22 @@ $feimingyunew_phone = ['name' => 'feimingyunew', 'store_id' => 199, 'qualitys' =
         30 => [
             ['goods_id' => 7675, 'price' => 28.83, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 7675, 'price' => 28.26, 'quality' => 1, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 7675, 'price' => 28.35, 'quality' => 1, 'card_type' => 'chinatelecom']
+            ['goods_id' => 7675, 'price' => 28.47, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         50 => [
             ['goods_id' => 7676, 'price' => 48.05, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 7676, 'price' => 47.1, 'quality' => 1, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 7676, 'price' => 47.25, 'quality' => 1, 'card_type' => 'chinatelecom'],
+            ['goods_id' => 7676, 'price' => 47.45, 'quality' => 1, 'card_type' => 'chinatelecom'],
         ],
         100 => [
             ['goods_id' => 7677, 'price' => 96.1, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 7677, 'price' => 94.2, 'quality' => 1, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 7677, 'price' => 94.5, 'quality' => 1, 'card_type' => 'chinatelecom']
+            ['goods_id' => 7677, 'price' => 94.9, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         200 => [
             ['goods_id' => 7678, 'price' => 192.2, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 7678, 'price' => 188.4, 'quality' => 1, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 7678, 'price' => 189, 'quality' => 1, 'card_type' => 'chinatelecom']
+            ['goods_id' => 7678, 'price' => 189.8, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
 //        300 => [
 //            ['goods_id' => 7679, 'price' => 288.3, 'quality' => 1, 'card_type' => 'chinamobile'],
@@ -5311,13 +5279,87 @@ $youheman_phone = ['name' => 'youheman', 'store_id' => 208, 'qualitys' => '5',
 //        20 => [['goods_id' => 7747, 'price' => 18.5, 'quality' => 5, 'card_type' => 'chinaunicom,chinatelecom']],
 //        30 => [['goods_id' => 7748, 'price' => 27.75, 'quality' => 5, 'card_type' => 'chinaunicom,chinatelecom']],
 //        50 => [['goods_id' => 7749, 'price' => 46.25, 'quality' => 5, 'card_type' => 'chinaunicom,chinatelecom']],
-        100 => [['goods_id' => 7750, 'price' => 92.5, 'quality' => 5, 'card_type' => 'chinaunicom,chinatelecom']],
-        200 => [['goods_id' => 7751, 'price' => 185, 'quality' => 5, 'card_type' => 'chinaunicom,chinatelecom']],
+        100 => [['goods_id' => 7750, 'price' => 91.5, 'quality' => 5, 'card_type' => 'chinaunicom,chinatelecom']],
+        200 => [['goods_id' => 7751, 'price' => 183, 'quality' => 5, 'card_type' => 'chinaunicom,chinatelecom']],
 //        300 => [['goods_id' => 7752, 'price' => 277.5, 'quality' => 5, 'card_type' => 'chinaunicom,chinatelecom']],
 //        500 => [['goods_id' => 7753, 'price' => 462.5, 'quality' => 5, 'card_type' => 'chinaunicom,chinatelecom']]
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 
+$huoshenguoman_phone = ['name' => 'huoshenguoman', 'store_id' => 209, 'qualitys' => '5',
+    'amount' => [
+//        10 => [
+//            ['goods_id' => 7754, 'price' => 9.15, 'quality' => 5, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 7754, 'price' => 9.2, 'quality' => 5, 'card_type' => 'chinatelecom']
+//        ],
+//        20 => [
+//            ['goods_id' => 7755, 'price' => 18.3, 'quality' => 5, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 7755, 'price' => 18.4, 'quality' => 5, 'card_type' => 'chinatelecom']
+//        ],
+//        30 => [
+//            ['goods_id' => 7756, 'price' => 27.45, 'quality' => 5, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 7756, 'price' => 27.6, 'quality' => 5, 'card_type' => 'chinatelecom']
+//        ],
+//        50 => [
+//            ['goods_id' => 7757, 'price' => 45.75, 'quality' => 5, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 7757, 'price' => 46, 'quality' => 5, 'card_type' => 'chinatelecom']
+//        ],
+        100 => [
+            ['goods_id' => 7758, 'price' => 91.5, 'quality' => 5, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7758, 'price' => 92, 'quality' => 5, 'card_type' => 'chinatelecom']
+        ],
+        200 => [
+            ['goods_id' => 7759, 'price' => 183, 'quality' => 5, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7759, 'price' => 184, 'quality' => 5, 'card_type' => 'chinatelecom']
+        ],
+//        300 => [
+//            ['goods_id' => 7760, 'price' => 274.5, 'quality' => 5, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 7760, 'price' => 276, 'quality' => 5, 'card_type' => 'chinatelecom']
+//        ],
+//        500 => [
+//            ['goods_id' => 7761, 'price' => 457.5, 'quality' => 5, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 7761, 'price' => 460, 'quality' => 5, 'card_type' => 'chinatelecom']
+//        ]
+    ],
+    'official_sn' => true, 'refill_type' => 'api'];
+
+$guitong_phone = ['name' => 'guitong', 'store_id' => 210, 'qualitys' => '1',
+    'amount' => [
+//        10 => [
+//            ['goods_id' => 7762, 'price' => 9.54, 'quality' => 1, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 7762, 'price' => 9.54, 'quality' => 1, 'card_type' => 'chinatelecom']
+//        ],
+//        20 => [
+//            ['goods_id' => 7763, 'price' => 19.08, 'quality' => 1, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 7763, 'price' => 19.08, 'quality' => 1, 'card_type' => 'chinatelecom']
+//        ],
+//        30 => [
+//            ['goods_id' => 7764, 'price' => 28.62, 'quality' => 1, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 7764, 'price' => 28.62, 'quality' => 1, 'card_type' => 'chinatelecom']
+//        ],
+        50 => [
+            ['goods_id' => 7765, 'price' => 47.7, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7765, 'price' => 47.7, 'quality' => 1, 'card_type' => 'chinatelecom']
+        ],
+        100 => [
+            ['goods_id' => 7766, 'price' => 95.4, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7766, 'price' => 95.4, 'quality' => 1, 'card_type' => 'chinatelecom']
+        ],
+        200 => [
+            ['goods_id' => 7767, 'price' => 190.8, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7767, 'price' => 190.8, 'quality' => 1, 'card_type' => 'chinatelecom']
+        ],
+//        300 => [
+//            ['goods_id' => 7768, 'price' => 286.2, 'quality' => 1, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 7768, 'price' => 286.2, 'quality' => 1, 'card_type' => 'chinatelecom']
+//        ],
+//        500 => [
+//            ['goods_id' => 7769, 'price' => 477, 'quality' => 1, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 7769, 'price' => 477, 'quality' => 1, 'card_type' => 'chinatelecom']
+//        ]
+    ],
+    'official_sn' => true, 'refill_type' => 'api'];
+
 $phone_providers = [
 //    ['name' => 'beixt', 'cfg' => $beixt_phone],
 //    ['name' => 'bxtwt', 'cfg' => $bxtwt_phone],
@@ -5488,6 +5530,8 @@ $phone_providers = [
     ['name' => 'kailinyu', 'cfg' => $kailinyu_phone],
     ['name' => 'kuaikuaifs', 'cfg' => $kuaikuaifs_phone],
     ['name' => 'youheman', 'cfg' => $youheman_phone],
+    ['name' => 'huoshenguoman', 'cfg' => $huoshenguoman_phone],
+    ['name' => 'guitong', 'cfg' => $guitong_phone],
 
 ];
 $config['phone_providers'] = $phone_providers;

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

@@ -48,14 +48,14 @@ $config['tablepre']	= 'lrlz_';
 $config['db'][1]['dbhost']       = MASTER_DBHOST;
 $config['db'][1]['dbport']       = '3306';
 $config['db'][1]['dbuser']       = 'root';
-$config['db'][1]['dbpwd']        = 'yezi131419';
+$config['db'][1]['dbpwd']        = 'XTZ@shop@951688';
 $config['db'][1]['dbname']       = 'xyzshop';
 $config['db'][1]['dbcharset']    = 'UTF-8';
 
 $config['db']['slave'][0]['dbhost']     = SLAVE_DBHOST;
 $config['db']['slave'][0]['dbport']     = '3306';
 $config['db']['slave'][0]['dbuser']     = 'root';
-$config['db']['slave'][0]['dbpwd']      = 'yezi131419';
+$config['db']['slave'][0]['dbpwd']      = 'XTZ@shop@951688';
 $config['db']['slave'][0]['dbname']     = 'xyzshop';
 $config['db']['slave'][0]['dbcharset']  = 'UTF-8';
 

+ 9 - 41
data/config/xyztest/refill.ini.php

@@ -242,71 +242,39 @@ $bjb_phone = ['name' => 'bjb', 'store_id' => 12,'qualitys' => '1',
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 
-$lingzh_phone = ['name' => 'lingzh', 'store_id' => 28,'qualitys' => '1,3,4,5,6',
+$lingzh_phone = ['name' => 'lingzh', 'store_id' => 28,'qualitys' => '1',
     'amount' => [
         10 => [
             ['goods_id' => 6389, 'price' => 9.53, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6389, 'price' => 9.51, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom'],
-            ['goods_id' => 6389, 'price' => 9.53, 'quality' => 3, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6389, 'price' => 8.95, 'quality' => 4, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6389, 'price' => 8.99, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6389, 'price' => 8.99, 'quality' => 6, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
+            ['goods_id' => 6389, 'price' => 9.51, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
         ],
         20 => [
             ['goods_id' => 6390, 'price' => 19.06, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6390, 'price' => 19.02, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom'],
-            ['goods_id' => 6390, 'price' => 19.06, 'quality' => 3, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6390, 'price' => 17.9, 'quality' => 4, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6390, 'price' => 17.98, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6390, 'price' => 17.98, 'quality' => 6, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']
+            ['goods_id' => 6390, 'price' => 19.02, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
         ],
         30 => [
             ['goods_id' => 6391, 'price' => 28.44, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6391, 'price' => 28.44, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom'],
-            ['goods_id' => 6391, 'price' => 28.59, 'quality' => 3, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6391, 'price' => 26.85, 'quality' => 4, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6391, 'price' => 26.97, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6391, 'price' => 26.97, 'quality' => 6, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']
+            ['goods_id' => 6391, 'price' => 28.44, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
         ],
         50 => [
             ['goods_id' => 6392, 'price' => 47.4, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6392, 'price' => 47.4, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom'],
-            ['goods_id' => 6392, 'price' => 47.65, 'quality' => 3, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6392, 'price' => 44.75, 'quality' => 4, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6392, 'price' => 44.95, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6392, 'price' => 44.95, 'quality' => 6, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']
+            ['goods_id' => 6392, 'price' => 47.4, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
         ],
         100 => [
             ['goods_id' => 6393, 'price' => 94.8, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6393, 'price' => 94.8, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom'],
-            ['goods_id' => 6393, 'price' => 95.3, 'quality' => 3, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6393, 'price' => 89.5, 'quality' => 4, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6393, 'price' => 89.9, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6393, 'price' => 89.9, 'quality' => 6, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']
+            ['goods_id' => 6393, 'price' => 94.8, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
         ],
         200 => [
             ['goods_id' => 6394, 'price' => 189.60, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6394, 'price' => 189.60, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom'],
-            ['goods_id' => 6394, 'price' => 190.60, 'quality' => 3, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6394, 'price' => 179, 'quality' => 4, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6394, 'price' => 179.8, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6394, 'price' => 179.8, 'quality' => 6, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']
+            ['goods_id' => 6394, 'price' => 189.60, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
         ],
         300 => [
             ['goods_id' => 6395, 'price' => 285.90, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6395, 'price' => 285.30, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom'],
-            ['goods_id' => 6395, 'price' => 285.90, 'quality' => 3, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6395, 'price' => 268.5, 'quality' => 4, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6395, 'price' => 269.7, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6395, 'price' => 269.7, 'quality' => 6, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']
+            ['goods_id' => 6395, 'price' => 285.30, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
         ],
         500 => [
             ['goods_id' => 6396, 'price' => 476.50, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6396, 'price' => 475.50, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom'],
-            ['goods_id' => 6396, 'price' => 476.50, 'quality' => 3, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6396, 'price' => 447.5,  'quality' => 4, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6396, 'price' => 449.5, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6396, 'price' => 449.5, 'quality' => 6, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']
+            ['goods_id' => 6396, 'price' => 475.50, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
         ]
     ],
     'official_sn' => true, 'refill_type' => 'api'];

+ 223 - 201
data/config/yl/refill.ini.php

@@ -276,71 +276,39 @@ $bjb_phone = ['name' => 'bjb', 'store_id' => 12,'qualitys' => '1',
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 
-$lingzh_phone = ['name' => 'lingzh', 'store_id' => 28,'qualitys' => '1,3,4,5,6',
+$lingzh_phone = ['name' => 'lingzh', 'store_id' => 28,'qualitys' => '1',
     'amount' => [
         10 => [
             ['goods_id' => 6389, 'price' => 9.53, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6389, 'price' => 9.51, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom'],
-            ['goods_id' => 6389, 'price' => 9.53, 'quality' => 3, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6389, 'price' => 8.95, 'quality' => 4, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6389, 'price' => 8.99, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6389, 'price' => 8.99, 'quality' => 6, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
         ],
         20 => [
             ['goods_id' => 6390, 'price' => 19.06, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6390, 'price' => 19.02, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom'],
-            ['goods_id' => 6390, 'price' => 19.06, 'quality' => 3, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6390, 'price' => 17.9, 'quality' => 4, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6390, 'price' => 17.98, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6390, 'price' => 17.98, 'quality' => 6, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']
         ],
         30 => [
             ['goods_id' => 6391, 'price' => 28.44, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6391, 'price' => 28.44, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom'],
-            ['goods_id' => 6391, 'price' => 28.59, 'quality' => 3, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6391, 'price' => 26.85, 'quality' => 4, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6391, 'price' => 26.97, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6391, 'price' => 26.97, 'quality' => 6, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']
         ],
         50 => [
             ['goods_id' => 6392, 'price' => 47.4, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6392, 'price' => 47.4, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom'],
-            ['goods_id' => 6392, 'price' => 47.65, 'quality' => 3, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6392, 'price' => 44.75, 'quality' => 4, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6392, 'price' => 44.95, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6392, 'price' => 44.95, 'quality' => 6, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']
         ],
         100 => [
             ['goods_id' => 6393, 'price' => 94.8, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6393, 'price' => 94.8, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom'],
-            ['goods_id' => 6393, 'price' => 95.3, 'quality' => 3, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6393, 'price' => 89.5, 'quality' => 4, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6393, 'price' => 89.9, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6393, 'price' => 89.9, 'quality' => 6, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']
         ],
         200 => [
             ['goods_id' => 6394, 'price' => 189.60, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6394, 'price' => 189.60, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom'],
-            ['goods_id' => 6394, 'price' => 190.60, 'quality' => 3, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6394, 'price' => 179, 'quality' => 4, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6394, 'price' => 179.8, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6394, 'price' => 179.8, 'quality' => 6, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']
         ],
         300 => [
             ['goods_id' => 6395, 'price' => 285.90, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6395, 'price' => 285.30, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom'],
-            ['goods_id' => 6395, 'price' => 285.90, 'quality' => 3, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6395, 'price' => 268.5, 'quality' => 4, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6395, 'price' => 269.7, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6395, 'price' => 269.7, 'quality' => 6, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']
         ],
         500 => [
             ['goods_id' => 6396, 'price' => 476.50, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6396, 'price' => 475.50, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom'],
-            ['goods_id' => 6396, 'price' => 476.50, 'quality' => 3, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6396, 'price' => 447.5,  'quality' => 4, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6396, 'price' => 449.5, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6396, 'price' => 449.5, 'quality' => 6, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']
         ]
     ],
     'official_sn' => true, 'refill_type' => 'api'];
@@ -558,46 +526,46 @@ $xc_phone = ['name' => 'xc', 'store_id' => 34, 'qualitys' => '4',
 
 $xunyin_phone = ['name' => 'xunyin', 'store_id' => 35,'qualitys' => '2',
     'amount' => [
-        10 => [
-            ['goods_id' => 6438, 'price' => 10.05, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6438, 'price' => 10.15, 'quality' => 2, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 6438, 'price' => 10, 'quality' => 2, 'card_type' => 'chinatelecom']
-        ],
-        20 => [
-            ['goods_id' => 6439, 'price' => 20.1, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6439, 'price' => 20.3, 'quality' => 2, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 6439, 'price' => 20, 'quality' => 2, 'card_type' => 'chinatelecom']
-        ],
-        30 => [
-            ['goods_id' => 6440, 'price' => 30.15, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6440, 'price' => 30.24, 'quality' => 2, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 6440, 'price' => 29.85, 'quality' => 2, 'card_type' => 'chinatelecom']
-        ],
+//        10 => [
+//            ['goods_id' => 6438, 'price' => 10.01, 'quality' => 2, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 6438, 'price' => 10.01, 'quality' => 2, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 6438, 'price' => 10.01, 'quality' => 2, 'card_type' => 'chinatelecom']
+//        ],
+//        20 => [
+//            ['goods_id' => 6439, 'price' => 20.02, 'quality' => 2, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 6439, 'price' => 20.02, 'quality' => 2, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 6439, 'price' => 20.02, 'quality' => 2, 'card_type' => 'chinatelecom']
+//        ],
+//        30 => [
+//            ['goods_id' => 6440, 'price' => 30.03, 'quality' => 2, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 6440, 'price' => 30.03, 'quality' => 2, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 6440, 'price' => 29.03, 'quality' => 2, 'card_type' => 'chinatelecom']
+//        ],
         50 => [
-            ['goods_id' => 6441, 'price' => 50.1, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6441, 'price' => 50.1, 'quality' => 2, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 6441, 'price' => 49.75, 'quality' => 2, 'card_type' => 'chinatelecom']
+            ['goods_id' => 6441, 'price' => 50.05, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6441, 'price' => 50.05, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 6441, 'price' => 50.05, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
 
         100 => [
-            ['goods_id' => 6442, 'price' => 100.2, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6442, 'price' => 100.2, 'quality' => 2, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 6442, 'price' => 100.2, 'quality' => 2, 'card_type' => 'chinatelecom']
+            ['goods_id' => 6442, 'price' => 100.1, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6442, 'price' => 100.1, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 6442, 'price' => 100.1, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         200 => [
-            ['goods_id' => 6443, 'price' => 200.4, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6443, 'price' => 200.4, 'quality' => 2, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 6443, 'price' => 200.4, 'quality' => 2, 'card_type' => 'chinatelecom']
+            ['goods_id' => 6443, 'price' => 200.2, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6443, 'price' => 200.2, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 6443, 'price' => 200.2, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         300 => [
-            ['goods_id' => 6444, 'price' => 300.6, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6444, 'price' => 300.6, 'quality' => 2, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 6444, 'price' => 300.6, 'quality' => 2, 'card_type' => 'chinatelecom']
+            ['goods_id' => 6444, 'price' => 300.3, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6444, 'price' => 300.3, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 6444, 'price' => 300.3, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         500 => [
-            ['goods_id' => 6445, 'price' => 501, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6445, 'price' => 501, 'quality' => 2, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 6445, 'price' => 501, 'quality' => 2, 'card_type' => 'chinatelecom']
+            ['goods_id' => 6445, 'price' => 500.5, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6445, 'price' => 500.5, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 6445, 'price' => 500.5, 'quality' => 2, 'card_type' => 'chinatelecom']
         ]
     ],
     'official_sn' => true, 'refill_type' => 'api'];
@@ -656,34 +624,34 @@ $zhongst_phone = ['name' => 'zhongst', 'store_id' => 39, 'qualitys' => '2',
         ],
 
         30 => [
-            ['goods_id' => 6466, 'price' => 30.36, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6466, 'price' => 30.09, 'quality' => 2, 'card_type' => 'chinamobile'],
             ['goods_id' => 6466, 'price' => 30.12, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6466, 'price' => 30.45, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
 
         50 => [
-            ['goods_id' => 6467, 'price' => 50.1, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6467, 'price' => 50.05, 'quality' => 2, 'card_type' => 'chinamobile'],
             ['goods_id' => 6467, 'price' => 50.1, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6467, 'price' => 50.2, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
 
         100 => [
-            ['goods_id' => 6468, 'price' => 100.2, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6468, 'price' => 100.1, 'quality' => 2, 'card_type' => 'chinamobile'],
             ['goods_id' => 6468, 'price' => 100.2, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6468, 'price' => 99.9, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         200 => [
-            ['goods_id' => 6469, 'price' => 200.4, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6469, 'price' => 200.2, 'quality' => 2, 'card_type' => 'chinamobile'],
             ['goods_id' => 6469, 'price' => 200.4, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6469, 'price' => 199.8, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         300 => [
-            ['goods_id' => 6470, 'price' => 300.6, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6470, 'price' => 300.3, 'quality' => 2, 'card_type' => 'chinamobile'],
             ['goods_id' => 6470, 'price' => 300.6, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6470, 'price' => 299.7, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         500 => [
-            ['goods_id' => 6471, 'price' => 501, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6471, 'price' => 500.5, 'quality' => 2, 'card_type' => 'chinamobile'],
             ['goods_id' => 6471, 'price' => 501, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6471, 'price' => 499.5, 'quality' => 2, 'card_type' => 'chinatelecom']
         ]
@@ -1003,17 +971,16 @@ $yunsuoyao_phone = ['name' => 'yunsuoyao', 'store_id' => 55, 'qualitys' => '1',
             ['goods_id' => 6576, 'price' => 190.2, 'quality' => 1, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6576, 'price' => 189.6, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
-
-        300 => [
-            ['goods_id' => 6577, 'price' => 285.9, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6577, 'price' => 287.4, 'quality' => 1, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 6577, 'price' => 285.9, 'quality' => 1, 'card_type' => 'chinatelecom']
-        ],
-        500 => [
-            ['goods_id' => 6578, 'price' => 476.5, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6578, 'price' => 479, 'quality' => 1, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 6578, 'price' => 476.5, 'quality' => 1, 'card_type' => 'chinatelecom']
-        ]
+//        300 => [
+//            ['goods_id' => 6577, 'price' => 285.9, 'quality' => 1, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 6577, 'price' => 287.4, 'quality' => 1, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 6577, 'price' => 285.9, 'quality' => 1, 'card_type' => 'chinatelecom']
+//        ],
+//        500 => [
+//            ['goods_id' => 6578, 'price' => 476.5, 'quality' => 1, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 6578, 'price' => 479, 'quality' => 1, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 6578, 'price' => 476.5, 'quality' => 1, 'card_type' => 'chinatelecom']
+//        ]
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 
@@ -1523,16 +1490,16 @@ $qijutang_phone = ['name' => 'qijutang', 'store_id' => 75, 'qualitys' => '1',
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 
-$lingzhman48_phone = ['name' => 'lingzhman48', 'store_id' => 76, 'qualitys' => '8',
+$lingzhman48_phone = ['name' => 'lingzhman48', 'store_id' => 76, 'qualitys' => '5',
     'amount' => [
-        10 => [['goods_id' => 6732, 'price' => 8.95, 'quality' => 8, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        20 => [['goods_id' => 6733, 'price' => 17.9, 'quality' => 8, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        30 => [['goods_id' => 6734, 'price' => 26.85, 'quality' => 8, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        50 => [['goods_id' => 6735, 'price' => 44.75, 'quality' => 8, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        100 => [['goods_id' => 6736, 'price' => 89.5, 'quality' => 8, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        200 => [['goods_id' => 6737, 'price' => 179, 'quality' => 8, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        300 => [['goods_id' => 6738, 'price' => 268.5, 'quality' => 8, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        500 => [['goods_id' => 6739, 'price' => 447.5, 'quality' => 8, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']]
+        10 => [['goods_id' => 6732, 'price' => 9.3, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        20 => [['goods_id' => 6733, 'price' => 18.6, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        30 => [['goods_id' => 6734, 'price' => 27.9, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        50 => [['goods_id' => 6735, 'price' => 46.5, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        100 => [['goods_id' => 6736, 'price' => 93, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        200 => [['goods_id' => 6737, 'price' => 186, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        300 => [['goods_id' => 6738, 'price' => 279, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        500 => [['goods_id' => 6739, 'price' => 465, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']]
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 
@@ -1616,30 +1583,30 @@ $zhenqi_phone = ['name' => 'zhenqi', 'store_id' => 82, 'qualitys' => '2',
 
 $yunsuoyaofs_phone = ['name' => 'yunsuoyaofs', 'store_id' => 83, 'qualitys' => '1',
     'amount' => [
-        10 => [['goods_id' => 6769, 'price' => 9.54, 'quality' => 1, 'card_type' => 'chinamobile']],
-        20 => [['goods_id' => 6770, 'price' => 19.08, 'quality' => 1, 'card_type' => 'chinamobile']],
+//        10 => [['goods_id' => 6769, 'price' => 9.54, 'quality' => 1, 'card_type' => 'chinamobile']],
+//        20 => [['goods_id' => 6770, 'price' => 19.08, 'quality' => 1, 'card_type' => 'chinamobile']],
         30 => [
             ['goods_id' => 6771, 'price' => 28.5, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6771, 'price' => 28.65, 'quality' => 1, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 6771, 'price' => 28.8, 'quality' => 1, 'card_type' => 'chinatelecom']
+            ['goods_id' => 6771, 'price' => 28.77, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         50 => [
             ['goods_id' => 6772, 'price' => 47.5, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6772, 'price' => 47.75, 'quality' => 1, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 6772, 'price' => 48, 'quality' => 1, 'card_type' => 'chinatelecom']
+            ['goods_id' => 6772, 'price' => 47.95, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         100 => [
             ['goods_id' => 6773, 'price' => 95, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6773, 'price' => 95.5, 'quality' => 1, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 6773, 'price' => 96, 'quality' => 1, 'card_type' => 'chinatelecom']
+            ['goods_id' => 6773, 'price' => 95.9, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         200 => [
             ['goods_id' => 6774, 'price' => 190, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6774, 'price' => 191, 'quality' => 1, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 6774, 'price' => 192, 'quality' => 1, 'card_type' => 'chinatelecom']
+            ['goods_id' => 6774, 'price' => 191.8, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
-        300 => [['goods_id' => 6775, 'price' => 286.2, 'quality' => 1, 'card_type' => 'chinamobile']],
-        500 => [['goods_id' => 6776, 'price' => 477, 'quality' => 1, 'card_type' => 'chinamobile']]
+//        300 => [['goods_id' => 6775, 'price' => 286.2, 'quality' => 1, 'card_type' => 'chinamobile']],
+//        500 => [['goods_id' => 6776, 'price' => 477, 'quality' => 1, 'card_type' => 'chinamobile']]
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 
@@ -1691,22 +1658,22 @@ $yunchonggong_phone = ['name' => 'yunchonggong', 'store_id' => 87,'qualitys' =>
         30 => [
             ['goods_id' => 6799, 'price' => 28.74, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6799, 'price' => 28.53, 'quality' => 1, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 6799, 'price' => 28.35, 'quality' => 1, 'card_type' => 'chinatelecom']
+            ['goods_id' => 6799, 'price' => 28.5, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         50 => [
             ['goods_id' => 6800, 'price' => 47.9, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6800, 'price' => 47.55, 'quality' => 1, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 6800, 'price' => 47.25, 'quality' => 1, 'card_type' => 'chinatelecom']
+            ['goods_id' => 6800, 'price' => 47.5, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         100 => [
             ['goods_id' => 6801, 'price' => 95.8, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6801, 'price' => 95.1, 'quality' => 1, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 6801, 'price' => 94.5, 'quality' => 1, 'card_type' => 'chinatelecom']
+            ['goods_id' => 6801, 'price' => 95, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         200 => [
             ['goods_id' => 6802, 'price' => 191.6, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6802, 'price' => 190.2, 'quality' => 1, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 6802, 'price' => 189, 'quality' => 1, 'card_type' => 'chinatelecom']
+            ['goods_id' => 6802, 'price' => 190, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
 //        300 => [
 //            ['goods_id' => 6803, 'price' => 288, 'quality' => 1, 'card_type' => 'chinamobile'],
@@ -1995,7 +1962,7 @@ $miaoxt_phone = ['name' => 'miaoxt', 'store_id' => 101, 'qualitys' => '2',
             ['goods_id' => 6902, 'price' => 20.34, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         30 => [
-            ['goods_id' => 6903, 'price' => 30.075, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6903, 'price' => 30.105, 'quality' => 2, 'card_type' => 'chinamobile'],
             ['goods_id' => 6903, 'price' => 30.03, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6903, 'price' => 30.51, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
@@ -2005,22 +1972,22 @@ $miaoxt_phone = ['name' => 'miaoxt', 'store_id' => 101, 'qualitys' => '2',
             ['goods_id' => 6904, 'price' => 50.05, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         100 => [
-            ['goods_id' => 6905, 'price' => 100.1, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6905, 'price' => 100.25, 'quality' => 2, 'card_type' => 'chinamobile'],
             ['goods_id' => 6905, 'price' => 100.1, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6905, 'price' => 100.1, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         200 => [
-            ['goods_id' => 6906, 'price' => 200.2, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6906, 'price' => 200.5, 'quality' => 2, 'card_type' => 'chinamobile'],
             ['goods_id' => 6906, 'price' => 200.2, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6906, 'price' => 200.2, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         300 => [
-            ['goods_id' => 6907, 'price' => 300.3, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6907, 'price' => 300.75, 'quality' => 2, 'card_type' => 'chinamobile'],
             ['goods_id' => 6907, 'price' => 300.3, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6907, 'price' => 300.3, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         500 => [
-            ['goods_id' => 6908, 'price' => 500.5, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6908, 'price' => 501.25, 'quality' => 2, 'card_type' => 'chinamobile'],
             ['goods_id' => 6908, 'price' => 500.5, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6908, 'price' => 500.5, 'quality' => 2, 'card_type' => 'chinatelecom']
         ]
@@ -2533,86 +2500,86 @@ $yunchonggong_yd_phone = ['name' => 'yunchonggong_yd', 'store_id' => 120, 'quali
 $guochuang_nation_phone = ['name' => 'guochuang_nation', 'store_id' => 121, 'qualitys' => '2',
     'amount' => [
         1  => [
-            ['goods_id' => 7051, 'price' => 1.017, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7051, 'price' => 1.25, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7051, 'price' => 1.031, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         2  => [
-            ['goods_id' => 7052, 'price' => 2.034, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7052, 'price' => 2.05, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7052, 'price' => 2.062, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         3  => [
-            ['goods_id' => 7053, 'price' => 3.051, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7053, 'price' => 3.075, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7053, 'price' => 3.093, 'quality' => 2, 'card_type' => 'chinatelecom']
 
         ],
         4  => [
-            ['goods_id' => 7054, 'price' => 4.068, 'quality' => 2, 'card_type' => 'chinaunicom']
+            ['goods_id' => 7054, 'price' => 4.1, 'quality' => 2, 'card_type' => 'chinaunicom']
         ],
         5  => [
             ['goods_id' => 7055, 'price' => 5.305, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 7055, 'price' => 5.085, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7055, 'price' => 5.125, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7055, 'price' => 5.155, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         6  => [
             ['goods_id' => 7056, 'price' => 6.306, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 7056, 'price' => 6.102, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7056, 'price' => 6.15, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7056, 'price' => 6.186, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         7  => [
             ['goods_id' => 7057, 'price' => 7.308, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 7057, 'price' => 7.119, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7057, 'price' => 7.175, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7057, 'price' => 7.217, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         8  => [
             ['goods_id' => 7058, 'price' => 8.308, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 7058, 'price' => 8.136, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7058, 'price' => 8.2, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7058, 'price' => 8.248, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         9  => [
             ['goods_id' => 7059, 'price' => 9.3105, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 7059, 'price' => 9.153, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7059, 'price' => 9.225, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7059, 'price' => 9.279, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
 
         10 => [
-            ['goods_id' => 7060, 'price' => 10.31, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 7060, 'price' => 10.38, 'quality' => 2, 'card_type' => 'chinamobile'],
             ['goods_id' => 7060, 'price' => 10.05, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7060, 'price' => 10.23, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         20 => [
             ['goods_id' => 7061, 'price' => 20.62, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 7061, 'price' => 20.1, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7061, 'price' => 20.08, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7061, 'price' => 20.46, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         30 => [
             ['goods_id' => 7062, 'price' => 30.27, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 7062, 'price' => 30.024, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7062, 'price' => 30.045, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7062, 'price' => 30.24, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         50 => [
             ['goods_id' => 7063, 'price' => 50.1, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 7063, 'price' => 50.04, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7063, 'price' => 50.075, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7063, 'price' => 50.175, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         100 => [
             ['goods_id' => 7064, 'price' => 100.2, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 7064, 'price' => 100.08, 'quality' => 2, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 7064, 'price' => 100.1, 'quality' => 2, 'card_type' => 'chinatelecom']
+            ['goods_id' => 7064, 'price' => 100.15, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7064, 'price' => 100.3, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         200 => [
             ['goods_id' => 7065, 'price' => 200.4, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 7065, 'price' => 200.16, 'quality' => 2, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 7065, 'price' => 200.2, 'quality' => 2, 'card_type' => 'chinatelecom']
+            ['goods_id' => 7065, 'price' => 200.3, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7065, 'price' => 200.6, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         300 => [
             ['goods_id' => 7066, 'price' => 300.6, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 7066, 'price' => 300.24, 'quality' => 2, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 7066, 'price' => 300.3, 'quality' => 2, 'card_type' => 'chinatelecom']
+            ['goods_id' => 7066, 'price' => 300.45, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7066, 'price' => 300.9, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         500 => [
             ['goods_id' => 7067, 'price' => 501, 'quality' => 2, 'card_type' => 'chinamobile'],
             ['goods_id' => 7067, 'price' => 500.5, 'quality' => 2, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 7067, 'price' => 500.5, 'quality' => 2, 'card_type' => 'chinatelecom']
+            ['goods_id' => 7067, 'price' => 501.5, 'quality' => 2, 'card_type' => 'chinatelecom']
         ]
     ],
     'official_sn' => true, 'refill_type' => 'api'];
@@ -3257,10 +3224,12 @@ $dashang_normal_phone = ['name' => 'dashang_normal', 'store_id' => 148, 'quality
             ['goods_id' => 7272, 'price' => 189.8, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         300 => [
+            ['goods_id' => 7273, 'price' => 288.9, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 7273, 'price' => 284.4, 'quality' => 1, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7273, 'price' => 286.5, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         500 => [
+            ['goods_id' => 7274, 'price' => 481.5, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 7274, 'price' => 474, 'quality' => 1, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7274, 'price' => 477.5, 'quality' => 1, 'card_type' => 'chinatelecom']
         ]
@@ -3406,27 +3375,27 @@ $guantu_phone = ['name' => 'guantu', 'store_id' => 157, 'qualitys' => '1',
 
 $yiqian_phone = ['name' => 'yiqian', 'store_id' => 158,'qualitys' => '2',
     'amount' => [
-        10 => [
-            ['goods_id' => 7333, 'price' => 10.36, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 7333, 'price' => 10, 'quality' => 2, 'card_type' => 'chinaunicom']
+//        10 => [
+//            ['goods_id' => 7333, 'price' => 10.36, 'quality' => 2, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 7333, 'price' => 10, 'quality' => 2, 'card_type' => 'chinaunicom']
 //            ['goods_id' => 7333, 'price' => 9.985, 'quality' => 2, 'card_type' => 'chinatelecom']
-        ],
+//        ],
 
-        20 => [
-            ['goods_id' => 7334, 'price' => 20.72, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 7334, 'price' => 20, 'quality' => 2, 'card_type' => 'chinaunicom'],
+//        20 => [
+//            ['goods_id' => 7334, 'price' => 20.72, 'quality' => 2, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 7334, 'price' => 20, 'quality' => 2, 'card_type' => 'chinaunicom'],
 //            ['goods_id' => 7334, 'price' => 19.97, 'quality' => 2, 'card_type' => 'chinatelecom']
-        ],
+//        ],
 
         30 => [
-            ['goods_id' => 7335, 'price' => 30.3, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 7335, 'price' => 29.94, 'quality' => 2, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 7335, 'price' => 30.3, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 7335, 'price' => 30.045, 'quality' => 2, 'card_type' => 'chinaunicom'],
 //            ['goods_id' => 7335, 'price' => 29.955, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
 
         50 => [
 //            ['goods_id' => 7336, 'price' => 49.925, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 7336, 'price' => 49.9, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7336, 'price' => 50.075, 'quality' => 2, 'card_type' => 'chinaunicom'],
 //            ['goods_id' => 7336, 'price' => 49.925, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
 //        平时价格
@@ -3456,25 +3425,25 @@ $yiqian_phone = ['name' => 'yiqian', 'store_id' => 158,'qualitys' => '2',
         //周末高价
         100 => [
             ['goods_id' => 7337, 'price' => 100.2, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 7337, 'price' => 99.8, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7337, 'price' => 100.15, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7337, 'price' => 100.2, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
 
         200 => [
             ['goods_id' => 7338, 'price' => 200.4, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 7338, 'price' => 199.6, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7338, 'price' => 200.3, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7338, 'price' => 200.4, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
 
         300 => [
             ['goods_id' => 7339, 'price' => 300.6, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 7339, 'price' => 299.4, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7339, 'price' => 300.45, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7339, 'price' => 300.6, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
 
         500 => [
             ['goods_id' => 7340, 'price' => 501, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 7340, 'price' => 499, 'quality' => 2, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 7340, 'price' => 500.75, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7340, 'price' => 501, 'quality' => 2, 'card_type' => 'chinatelecom']
         ]
     ],
@@ -4322,33 +4291,33 @@ $huoshenguo_phone = ['name' => 'huoshenguo', 'store_id' => 180,'qualitys' => '1'
 //            ['goods_id' => 7521, 'price' => 19.1, 'quality' => 1, 'card_type' => 'chinatelecom']
 //        ],
         30 => [
-            ['goods_id' => 7522, 'price' => 28.74, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 7522, 'price' => 28.26, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7522, 'price' => 28.89, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 7522, 'price' => 28.38, 'quality' => 1, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7522, 'price' => 28.44, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         50 => [
-            ['goods_id' => 7523, 'price' => 47.9, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 7523, 'price' => 47.1, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7523, 'price' => 48.15, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 7523, 'price' => 47.3, 'quality' => 1, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7523, 'price' => 47.4, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         100 => [
-            ['goods_id' => 7524, 'price' => 95.8, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 7524, 'price' => 94.2, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7524, 'price' => 96.3, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 7524, 'price' => 94.6, 'quality' => 1, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7524, 'price' => 94.8, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         200 => [
-            ['goods_id' => 7525, 'price' => 191.6, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 7525, 'price' => 188.4, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7525, 'price' => 192.6, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 7525, 'price' => 189.2, 'quality' => 1, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7525, 'price' => 189.6, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         300 => [
-            ['goods_id' => 7526, 'price' => 287.4, 'quality' => 1, 'card_type' => 'chinamobile'],
-//            ['goods_id' => 7526, 'price' => 283.8, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7526, 'price' => 288.9, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 7526, 'price' => 283.8, 'quality' => 1, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7526, 'price' => 284.4, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         500 => [
-            ['goods_id' => 7527, 'price' => 479, 'quality' => 1, 'card_type' => 'chinamobile'],
-//            ['goods_id' => 7527, 'price' => 473, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7527, 'price' => 481.5, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 7527, 'price' => 473, 'quality' => 1, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7527, 'price' => 474, 'quality' => 1, 'card_type' => 'chinatelecom']
         ]
     ],
@@ -4763,27 +4732,28 @@ $zhenghe_phone = ['name' => 'zhenghe', 'store_id' => 192,'qualitys' => '2',
 //        10 => [['goods_id' => 7625, 'price' => 10.05, 'quality' => 2, 'card_type' => 'chinamobile']],
 //        20 => [['goods_id' => 7626, 'price' => 20.1, 'quality' => 2, 'card_type' => 'chinamobile']],
         30 => [
-            ['goods_id' => 7627, 'price' => 30.15, 'quality' => 2, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 7627, 'price' => 30.15, 'quality' => 2, 'card_type' => 'chinamobile'],
             ['goods_id' => 7627, 'price' => 30, 'quality' => 2, 'card_type' => 'chinaunicom'],
         ],
         50 => [
-            ['goods_id' => 7628, 'price' => 50.25, 'quality' => 2, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 7628, 'price' => 50.25, 'quality' => 2, 'card_type' => 'chinamobile'],
             ['goods_id' => 7628, 'price' => 50, 'quality' => 2, 'card_type' => 'chinaunicom'],
         ],
         100 => [
-            ['goods_id' => 7629, 'price' => 100.5, 'quality' => 2, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 7629, 'price' => 100.5, 'quality' => 2, 'card_type' => 'chinamobile'],
             ['goods_id' => 7629, 'price' => 100, 'quality' => 2, 'card_type' => 'chinaunicom'],
         ],
         200 => [
-            ['goods_id' => 7630, 'price' => 201, 'quality' => 2, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 7630, 'price' => 201, 'quality' => 2, 'card_type' => 'chinamobile'],
             ['goods_id' => 7630, 'price' => 200, 'quality' => 2, 'card_type' => 'chinaunicom'],
-
         ],
         300 => [
-            ['goods_id' => 7631, 'price' => 301.5, 'quality' => 2, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 7631, 'price' => 301.5, 'quality' => 2, 'card_type' => 'chinamobile'],
             ['goods_id' => 7631, 'price' => 300, 'quality' => 2, 'card_type' => 'chinaunicom']
         ],
-        500 => [['goods_id' => 7632, 'price' => 502.5, 'quality' => 2, 'card_type' => 'chinamobile']]
+//        500 => [
+//            ['goods_id' => 7632, 'price' => 502.5, 'quality' => 2, 'card_type' => 'chinamobile']
+//        ]
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 
@@ -5018,23 +4988,23 @@ $feimingyunew_phone = ['name' => 'feimingyunew', 'store_id' => 199, 'qualitys' =
 //        ],
         30 => [
             ['goods_id' => 7675, 'price' => 28.83, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 7675, 'price' => 28.26, 'quality' => 1, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 7675, 'price' => 28.35, 'quality' => 1, 'card_type' => 'chinatelecom']
+            ['goods_id' => 7675, 'price' => 28.56, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7675, 'price' => 28.38, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         50 => [
             ['goods_id' => 7676, 'price' => 48.05, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 7676, 'price' => 47.1, 'quality' => 1, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 7676, 'price' => 47.25, 'quality' => 1, 'card_type' => 'chinatelecom'],
+            ['goods_id' => 7676, 'price' => 47.6, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7676, 'price' => 47.3, 'quality' => 1, 'card_type' => 'chinatelecom'],
         ],
         100 => [
             ['goods_id' => 7677, 'price' => 96.1, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 7677, 'price' => 94.2, 'quality' => 1, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 7677, 'price' => 94.5, 'quality' => 1, 'card_type' => 'chinatelecom']
+            ['goods_id' => 7677, 'price' => 95.2, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7677, 'price' => 94.6, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         200 => [
             ['goods_id' => 7678, 'price' => 192.2, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 7678, 'price' => 188.4, 'quality' => 1, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 7678, 'price' => 189, 'quality' => 1, 'card_type' => 'chinatelecom']
+            ['goods_id' => 7678, 'price' => 190.4, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7678, 'price' => 189.2, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
 //        300 => [
 //            ['goods_id' => 7679, 'price' => 288.3, 'quality' => 1, 'card_type' => 'chinamobile'],
@@ -5305,6 +5275,56 @@ $kuaikuaifs_phone = ['name' => 'kuaikuaifs', 'store_id' => 207, 'qualitys' => '2
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 
+$youheman_phone = ['name' => 'youheman', 'store_id' => 208, 'qualitys' => '5',
+    'amount' => [
+//        10 => [['goods_id' => 7746, 'price' => 9.25, 'quality' => 5, 'card_type' => 'chinaunicom,chinatelecom']],
+//        20 => [['goods_id' => 7747, 'price' => 18.5, 'quality' => 5, 'card_type' => 'chinaunicom,chinatelecom']],
+//        30 => [['goods_id' => 7748, 'price' => 27.75, 'quality' => 5, 'card_type' => 'chinaunicom,chinatelecom']],
+//        50 => [['goods_id' => 7749, 'price' => 46.25, 'quality' => 5, 'card_type' => 'chinaunicom,chinatelecom']],
+        100 => [['goods_id' => 7750, 'price' => 91.5, 'quality' => 5, 'card_type' => 'chinaunicom,chinatelecom']],
+        200 => [['goods_id' => 7751, 'price' => 183, 'quality' => 5, 'card_type' => 'chinaunicom,chinatelecom']],
+//        300 => [['goods_id' => 7752, 'price' => 277.5, 'quality' => 5, 'card_type' => 'chinaunicom,chinatelecom']],
+//        500 => [['goods_id' => 7753, 'price' => 462.5, 'quality' => 5, 'card_type' => 'chinaunicom,chinatelecom']]
+    ],
+    'official_sn' => true, 'refill_type' => 'api'];
+
+$huoshenguoman_phone = ['name' => 'huoshenguoman', 'store_id' => 209, 'qualitys' => '5',
+    'amount' => [
+//        10 => [
+//            ['goods_id' => 7754, 'price' => 9.15, 'quality' => 5, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 7754, 'price' => 9.2, 'quality' => 5, 'card_type' => 'chinatelecom']
+//        ],
+//        20 => [
+//            ['goods_id' => 7755, 'price' => 18.3, 'quality' => 5, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 7755, 'price' => 18.4, 'quality' => 5, 'card_type' => 'chinatelecom']
+//        ],
+//        30 => [
+//            ['goods_id' => 7756, 'price' => 27.45, 'quality' => 5, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 7756, 'price' => 27.6, 'quality' => 5, 'card_type' => 'chinatelecom']
+//        ],
+//        50 => [
+//            ['goods_id' => 7757, 'price' => 45.75, 'quality' => 5, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 7757, 'price' => 46, 'quality' => 5, 'card_type' => 'chinatelecom']
+//        ],
+        100 => [
+            ['goods_id' => 7758, 'price' => 91.5, 'quality' => 5, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7758, 'price' => 92, 'quality' => 5, 'card_type' => 'chinatelecom']
+        ],
+        200 => [
+            ['goods_id' => 7759, 'price' => 183, 'quality' => 5, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7759, 'price' => 184, 'quality' => 5, 'card_type' => 'chinatelecom']
+        ],
+//        300 => [
+//            ['goods_id' => 7760, 'price' => 274.5, 'quality' => 5, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 7760, 'price' => 276, 'quality' => 5, 'card_type' => 'chinatelecom']
+//        ],
+//        500 => [
+//            ['goods_id' => 7761, 'price' => 457.5, 'quality' => 5, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 7761, 'price' => 460, 'quality' => 5, 'card_type' => 'chinatelecom']
+//        ]
+    ],
+    'official_sn' => true, 'refill_type' => 'api'];
+
 $phone_providers = [
 //    ['name' => 'beixt', 'cfg' => $beixt_phone],
 //    ['name' => 'bxtwt', 'cfg' => $bxtwt_phone],
@@ -5324,19 +5344,19 @@ $phone_providers = [
 //    ['name' => 'xc', 'cfg' => $xc_phone],
 //    ['name' => 'xunyin', 'cfg' => $xunyin_phone],
 //    ['name' => 'wantong', 'cfg' => $wantong_phone],
-//    ['name' => 'yunling', 'cfg' => $yunling_phone],
-//    ['name' => 'zhongst', 'cfg' => $zhongst_phone],
+    ['name' => 'yunling', 'cfg' => $yunling_phone],
+    ['name' => 'zhongst', 'cfg' => $zhongst_phone],
 //    ['name' => 'luqian', 'cfg' => $luqian_phone],
 //    ['name' => 'afandfs', 'cfg' => $afandfs_phone],
-//    ['name' => 'yunlingfs', 'cfg' => $yunlingfs_phone],
+    ['name' => 'yunlingfs', 'cfg' => $yunlingfs_phone],
 //    ['name' => 'tiancheng', 'cfg' => $tiancheng_phone],
 //    ['name' => 'xunao', 'cfg' => $xunao_phone],
 //    ['name' => 'weiyiman', 'cfg' => $weiyiman_phone],
 //    ['name' => 'yonghe', 'cfg' => $yonghe_phone],
 //    ['name' => 'jumikc', 'cfg' => $jumi_phone],
-//    ['name' => 'qianqian', 'cfg' => $qianqian_phone],
+    ['name' => 'qianqian', 'cfg' => $qianqian_phone],
 //    ['name' => 'fengye', 'cfg' => $fengye_phone],
-//    ['name' => 'yunsuoyao', 'cfg' => $yunsuoyao_phone],
+    ['name' => 'yunsuoyao', 'cfg' => $yunsuoyao_phone],
 //    ['name' => 'afd', 'cfg' => $afd_phone],
 //    ['name' => 'qianqianman', 'cfg' => $qianqianman_phone],
 //    ['name' => 'weiyiwt', 'cfg' => $weiyiwt_phone],
@@ -5356,15 +5376,15 @@ $phone_providers = [
 //    ['name' => 'yunlingds', 'cfg' => $yunlingds_phone],
 //    ['name' => 'lingzhman', 'cfg' => $lingzhman_phone],
 //    ['name' => 'qijutang', 'cfg' => $qijutang_phone],
-//    ['name' => 'lingzhman48', 'cfg' => $lingzhman48_phone],
+    ['name' => 'lingzhman48', 'cfg' => $lingzhman48_phone],
 //    ['name' => 'cangbu', 'cfg' => $cangbu_phone],
 //    ['name' => 'tongykami', 'cfg' => $tongykami_phone],
 //    ['name' => 'zhenqi', 'cfg' => $zhenqi_phone],
-//    ['name' => 'yunsuoyaofs', 'cfg' => $yunsuoyaofs_phone],
+    ['name' => 'yunsuoyaofs', 'cfg' => $yunsuoyaofs_phone],
 //    ['name' => 'zhenqi1m', 'cfg' => $zhenqi1m_phone],
 //    ['name' => 'hongxudayz', 'cfg' => $hongxudayz_phone],
 //    ['name' => 'hongxudagy', 'cfg' => $hongxudagy_phone],
-//    ['name' => 'yunchonggong', 'cfg' => $yunchonggong_phone],
+    ['name' => 'yunchonggong', 'cfg' => $yunchonggong_phone],
 //    ['name' => 'yunchonggongman', 'cfg' => $yunchonggongman_phone],
 //    ['name' => 'hongxudayz996', 'cfg' => $hongxudayz996_phone],
 //    ['name' => 'hongxudagy996', 'cfg' => $hongxudagy996_phone],
@@ -5378,13 +5398,13 @@ $phone_providers = [
 //    ['name' => 'kangkai', 'cfg' => $kangkai_phone],
     ['name' => 'lechong', 'cfg' => $lechong_phone],
 //    ['name' => 'xinhengyang', 'cfg' => $xinhengyang_phone],
-//    ['name' => 'miaoxt', 'cfg' => $miaoxt_phone],
+    ['name' => 'miaoxt', 'cfg' => $miaoxt_phone],
 //    ['name' => 'tianyan', 'cfg' => $tianyan_phone],
 //    ['name' => 'yunsuoyaoman', 'cfg' => $yunsuoyaoman_phone],
 //    ['name' => 'youhe', 'cfg' => $youhe_phone],
-//    ['name' => 'wenye', 'cfg' => $wenye_phone],
+    ['name' => 'wenye', 'cfg' => $wenye_phone],
 //    ['name' => 'xinyang', 'cfg' => $xinyang_phone],
-//    ['name' => 'guochuang', 'cfg' => $guochuang_phone],
+    ['name' => 'guochuang', 'cfg' => $guochuang_phone],
     ['name' => 'xianghongrui', 'cfg' => $xianghongrui_phone],
 //    ['name' => 'dianchong', 'cfg' => $dianchong_phone],
     ['name' => 'wangliantx', 'cfg' => $wangliantx_phone],
@@ -5392,46 +5412,46 @@ $phone_providers = [
 //    ['name' => 'wenye_san', 'cfg' => $wenye_san_phone],
 //    ['name' => 'xianghongruifs', 'cfg' => $xianghongruifs_phone],
     ['name' => 'yilin', 'cfg' => $yilin_phone],
-//    ['name' => 'miaoxt_fs', 'cfg' => $miaoxt_fs_phone],
+    ['name' => 'miaoxt_fs', 'cfg' => $miaoxt_fs_phone],
 //    ['name' => 'xianzhibb', 'cfg' => $xianzhibb_phone],
 //    ['name' => 'yikatong', 'cfg' => $yikatong_phone],
 //    ['name' => 'yunchonggong_yd', 'cfg' => $yunchonggong_yd_phone],
-//    ['name' => 'guochuang_nation', 'cfg' => $guochuang_nation_phone],
+    ['name' => 'guochuang_nation', 'cfg' => $guochuang_nation_phone],
 //    ['name' => 'tianyanman', 'cfg' => $tianyanman_phone],
 //    ['name' => 'shimier', 'cfg' => $shimier_phone],
 //    ['name' => 'zhongst_mix', 'cfg' => $zhongst_mix_phone],
-//    ['name' => 'jinfeng', 'cfg' => $jinfeng_phone],
+    ['name' => 'jinfeng', 'cfg' => $jinfeng_phone],
     ['name' => 'hangtong', 'cfg' => $hangtong_phone],
 //    ['name' => 'dashang', 'cfg' => $dashang_phone],
-//    ['name' => 'yuanta', 'cfg' => $yuanta_phone],
+    ['name' => 'yuanta', 'cfg' => $yuanta_phone],
 //    ['name' => 'menggu_hf', 'cfg' => $menggu_hf_phone],
 //    ['name' => 'duojing', 'cfg' => $duojing_phone],
     ['name' => 'chizeng', 'cfg' => $chizeng_phone],
 //    ['name' => 'jinxin', 'cfg' => $jinxin_phone],
 //    ['name' => 'kachong', 'cfg' => $kachong_phone],
-//    ['name' => 'xingzy_normal', 'cfg' => $xingzy_normal_phone],
+    ['name' => 'xingzy_normal', 'cfg' => $xingzy_normal_phone],
 //    ['name' => 'pushang', 'cfg' => $pushang_phone],
 //    ['name' => 'huafutong', 'cfg' => $huafutong_phone],
 //    ['name' => 'dinghui', 'cfg' => $dinghui_phone],
 //    ['name' => 'xiaoniu_hf', 'cfg' => $xiaoniu_hf_phone],
-//    ['name' => 'shuoruan', 'cfg' => $shuoruan_phone],
+    ['name' => 'shuoruan', 'cfg' => $shuoruan_phone],
     ['name' => 'linzhu', 'cfg' => $linzhu_phone],
 //    ['name' => 'huafutongman', 'cfg' => $huafutongman_phone],
 //    ['name' => 'feimingyu', 'cfg' => $feimingyu_phone],
-//    ['name' => 'dashang_normal', 'cfg' => $dashang_normal_phone],
-//    ['name' => 'yunchonggongfs', 'cfg' => $yunchonggongfs_phone],
+    ['name' => 'dashang_normal', 'cfg' => $dashang_normal_phone],
+    ['name' => 'yunchonggongfs', 'cfg' => $yunchonggongfs_phone],
 //    ['name' => 'dingchi', 'cfg' => $dingchi_phone],
 //    ['name' => 'yikatongfs', 'cfg' => $yikatongfs_phone],
 //    ['name' => 'lexiangyd', 'cfg' => $lexiangyd_phone],
 //    ['name' => 'lexianglt', 'cfg' => $lexianglt_phone],
 //    ['name' => 'lexiangdx', 'cfg' => $lexiangdx_phone],
     ['name' => 'guantu', 'cfg' => $guantu_phone],
-//    ['name' => 'yiqian', 'cfg' => $yiqian_phone],
-//    ['name' => 'yinghuochong', 'cfg' => $yinghuochong_phone],
+    ['name' => 'yiqian', 'cfg' => $yiqian_phone],
+    ['name' => 'yinghuochong', 'cfg' => $yinghuochong_phone],
 //    ['name' => 'meixu', 'cfg' => $meixu_phone],
 //    ['name' => 'fuyuan', 'cfg' => $fuyuan_phone],
-//    ['name' => 'dongye', 'cfg' => $dongye_phone],
-//    ['name' => 'dongyefs', 'cfg' => $dongyefs_phone],
+    ['name' => 'dongye', 'cfg' => $dongye_phone],
+    ['name' => 'dongyefs', 'cfg' => $dongyefs_phone],
 //    ['name' => 'baixuan', 'cfg' => $baixuan_phone],
 //    ['name' => 'baixuan_normal', 'cfg' => $baixuan_normal_phone],
 //    ['name' => 'cangbuyd', 'cfg' => $cangbuyd_phone],
@@ -5444,36 +5464,38 @@ $phone_providers = [
     ['name' => 'cangxin', 'cfg' => $cangxin_phone],
     ['name' => 'cangxin_high', 'cfg' => $cangxin_high_phone],
 //    ['name' => 'jiyemei', 'cfg' => $jiyemei_phone],
-//    ['name' => 'baixuannew_high', 'cfg' => $baixuannew_high_phone],
-//    ['name' => 'baixuannew_normal', 'cfg' => $baixuannew_normal_phone],
+    ['name' => 'baixuannew_high', 'cfg' => $baixuannew_high_phone],
+    ['name' => 'baixuannew_normal', 'cfg' => $baixuannew_normal_phone],
     ['name' => 'youhenew', 'cfg' => $youhenew_phone],
-//    ['name' => 'huoshenguo', 'cfg' => $huoshenguo_phone],
+    ['name' => 'huoshenguo', 'cfg' => $huoshenguo_phone],
     ['name' => 'huoshenguo_high', 'cfg' => $huoshenguo_high_phone],
     ['name' => 'chizeng_normal', 'cfg' => $chizeng_normal_phone],
     ['name' => 'xinhengyangnew', 'cfg' => $xinhengyangnew_phone],
-//    ['name' => 'tianchen', 'cfg' => $tianchen_phone],
+    ['name' => 'tianchen', 'cfg' => $tianchen_phone],
 //    ['name' => 'yunchonggong_lt', 'cfg' => $yunchonggong_lt_phone],
-//    ['name' => 'tianchen_fs', 'cfg' => $tianchen_fs_phone],
+    ['name' => 'tianchen_fs', 'cfg' => $tianchen_fs_phone],
     ['name' => 'ruixunda_lt', 'cfg' => $ruixunda_lt_phone],
 //    ['name' => 'ruizhi', 'cfg' => $ruizhi_phone],
 //    ['name' => 'ruierxun', 'cfg' => $ruierxun_phone],
-//    ['name' => 'ningying', 'cfg' => $ningying_phone],
+    ['name' => 'ningying', 'cfg' => $ningying_phone],
 //    ['name' => 'cangxin_yi', 'cfg' => $cangxin_yi_phone],
     ['name' => 'zhenghe', 'cfg' => $zhenghe_phone],
 //    ['name' => 'lexiang', 'cfg' => $lexiang_phone],
 //    ['name' => 'kuaikuai', 'cfg' => $kuaikuai_phone],
-//    ['name' => 'jianjiao', 'cfg' => $jianjiao_phone],
-//    ['name' => 'ningying_normal', 'cfg' => $ningying_normal_phone],
+    ['name' => 'jianjiao', 'cfg' => $jianjiao_phone],
+    ['name' => 'ningying_normal', 'cfg' => $ningying_normal_phone],
 //    ['name' => 'yuanrun', 'cfg' => $yuanrun_phone],
-//    ['name' => 'feimingyunew', 'cfg' => $feimingyunew_phone],
+    ['name' => 'feimingyunew', 'cfg' => $feimingyunew_phone],
 //    ['name' => 'hangtongyj', 'cfg' => $hangtongyj_phone],
-//    ['name' => 'ruixundaman', 'cfg' => $ruixundaman_phone],
+    ['name' => 'ruixundaman', 'cfg' => $ruixundaman_phone],
 //    ['name' => 'ruizhi_tax', 'cfg' => $ruizhi_tax_phone],
 //    ['name' => 'pengxinda', 'cfg' => $pengxinda_phone],
     ['name' => 'huazhong', 'cfg' => $huazhong_phone],
     ['name' => 'yamiaoman', 'cfg' => $yamiaoman_phone],
 //    ['name' => 'kailinyu', 'cfg' => $kailinyu_phone],
 //    ['name' => 'kuaikuaifs', 'cfg' => $kuaikuaifs_phone],
+    ['name' => 'youheman', 'cfg' => $youheman_phone],
+    ['name' => 'huoshenguoman', 'cfg' => $huoshenguoman_phone],
 ];
 $config['phone_providers'] = $phone_providers;
 

+ 19 - 0
data/logic/queue.logic.php

@@ -8,6 +8,9 @@
  *
 
  */
+
+use refill\chprice_helper;
+
 defined('InShopNC') or exit('Access Invalid!');
 
 require_once(BASE_HELPER_PATH . '/push_sender.php');
@@ -31,6 +34,7 @@ require_once(BASE_HELPER_PATH . '/mcard/mcard.php');
 require_once(BASE_HELPER_PATH . '/util_helper.php');
 require_once(BASE_HELPER_PATH . '/third_author/signaturer.php');
 require_once(BASE_HELPER_PATH . '/refill/RefillFactory.php');
+require_once(BASE_HELPER_PATH . '/refill/chprice_helper.php');
 
 
 class queueLogic
@@ -1437,4 +1441,19 @@ class queueLogic
             return callback($ret, "放入通知队列 ret = {$ret}",$params);
         }
     }
+
+    public function AysncChangePrice($params)
+    {
+        $price_id = intval($params['price_id']);
+        if($price_id > 0) {
+            $chprice_helper = new chprice_helper();
+            $chprice_helper->effect($price_id);
+
+            $publisher = new message\publisher();
+            $publisher->modify_refill_channel();
+            return callback(true, "成功更新价格",$params);
+        } else {
+            return callback(false, 'AysncChangePrice 参数为空');
+        }
+    }
 }

+ 3 - 0
data/model/provider_group.model.php

@@ -27,6 +27,9 @@ class provider_groupModel extends Model
     {
         return $this->field($field)->where($condition)->order($order)->limit($limit)->page($page)->select();
     }
+    public function delGroup($condition){
+        return $this->where($condition)->delete();
+    }
 
     public function getGroupInfo($condition, $field = '*')
     {

+ 21 - 0
data/model/provider_price.model.php

@@ -0,0 +1,21 @@
+<?php
+
+defined('InShopNC') or exit('Access Invalid!');
+
+class provider_priceModel extends Model
+{
+    public function __construct()
+    {
+        parent::__construct('provider_price');
+    }
+
+    public function getPirce($cond,$fields = '*', $master = false,$lock=false)
+    {
+        return $this->field($fields)->where($cond)->master($master)->lock($lock)->find();
+    }
+
+    public function getPirces($cond,$fields = '*')
+    {
+        return $this->field($fields)->where($cond)->select();
+    }
+}

+ 37 - 0
data/model/refill_balance.model.php

@@ -0,0 +1,37 @@
+<?php
+
+
+defined('InShopNC') or exit('Access Invalid!');
+
+
+class refill_balanceModel extends Model
+{
+    public function __construct()
+    {
+        parent::__construct('refill_balance');
+    }
+
+    public function getBalanceList($condition, $pageSize = 20, $limit = null)
+    {
+        if ($condition) {
+            $this->where($condition);
+        }
+
+        $this->order('balance_id desc');
+
+        if ($limit) {
+            $this->limit($limit);
+        } else {
+            $this->page($pageSize);
+        }
+
+
+        return $this->select();
+    }
+
+    public function getBalance($condition)
+    {
+        return $this->where($condition)->find();
+    }
+
+}

+ 25 - 0
data/model/refill_order.model.php

@@ -189,4 +189,29 @@ class refill_orderModel extends Model
         }
         return $orders;
     }
+
+    public function getAllRefillStats($condition)
+    {
+        $len = 1000;
+
+        $i = 0;
+        $stats = [];
+        $field = '*';
+        while (true)
+        {
+            $start = $i * $len;
+            $items = $this->table('refill_stats')
+                ->field($field)
+                ->where($condition)
+                ->order('time_stamp desc')
+                ->limit("{$start},{$len}")
+                ->select();
+            $stats = array_merge($stats,$items);
+            if (empty($items) || count($items) < $len) {
+                break;
+            }
+            $i++;
+        }
+        return $stats;
+    }
 }

+ 14 - 0
docker/compose/stanley/admin/docker-compose.yml

@@ -1,6 +1,20 @@
 version: "3.7"
 
 services:
+  nginxweb:
+    image: nginx:alpine
+    ports:
+      - "80:80"
+    volumes:
+      - ../../../../:/var/www/html
+      - /Volumes/Transcend/upload:/var/www/html/data/upload
+      - /Users/stanley-king/work/WebProject/wapshop/dist:/var/www/html/mshop
+      - ../conf/etc/localtime:/etc/localtime:ro
+      - ../conf/nginx/cert:/etc/nginx/cert
+      - ../conf/nginx/nginx.conf:/etc/nginx/nginx.conf:ro
+    container_name: "panda-nginxweb"
+    command: [nginx,'-g','daemon off;']
+
   mchsrv:
     image: php-zts:7.3.18
     ports:

+ 4 - 4
docker/compose/xyzt/acc/docker-compose.yml

@@ -1,7 +1,7 @@
 version: "3.7"
 
 services:
-  nginxsrv:
+  nginx:
     image: nginx:alpine
     ports:
       - "8080:80"
@@ -11,7 +11,7 @@ services:
       - ../conf/nginx/nginx.conf:/etc/nginx/nginx.conf:ro
       - /nfs/upload:/var/www/html/data/upload
       - /nfs/tmerchant:/var/www/html/merchant
-    container_name: "panda-nginx"
+    container_name: "test-nginx"
     command: [nginx,'-g','daemon off;']
     extra_hosts:
       - "docker.hostip:172.17.0.1"
@@ -20,7 +20,7 @@ services:
         limits:
           cpus: '8'
 
-  mobilesrv:
+  mobile:
     image: php-zts:7.3.18
     ports:
       - "9100:9100"
@@ -31,7 +31,7 @@ services:
       - /nfs/upload:/var/www/html/data/upload
       - /mnt/testlog:/var/www/html/data/log
       - ../conf/php/mobile-spwan-start:/usr/local/bin/docker-spwan-start
-    container_name: "panda-mobile"
+    container_name: "test-mobile"
     command: ['docker-spwan-start']
     deploy:
       resources:

+ 2 - 2
docker/compose/xyzt/admin/docker-compose.yml

@@ -12,7 +12,7 @@ services:
       - ../conf/php/mch-spwan-start:/usr/local/bin/docker-spwan-start
       - /nfs/upload:/var/www/html/data/upload
       - /mnt/testlog:/var/www/html/data/log
-    container_name: "panda-merchant"
+    container_name: "test-merchant"
     command: [docker-spwan-start]
 
   websrv:
@@ -26,5 +26,5 @@ services:
       - ../conf/php-fpm/php-fpm.conf:/usr/local/etc/php-fpm.conf
       - /nfs/upload:/var/www/html/data/upload
       - /mnt/testlog:/var/www/html/data/log
-    container_name: "panda-web"
+    container_name: "test-web"
     command: [php-fpm]

+ 2 - 2
docker/compose/xyzt/cli/docker-compose.yml

@@ -9,7 +9,7 @@ services:
       - ../conf/php/php.ini:/usr/local/etc/php/php.ini
       - /nfs/upload:/var/www/html/data/upload
       - /mnt/testlog:/var/www/html/data/log
-    container_name: "panda-php"
+    container_name: "test-php"
     deploy:
       resources:
         limits:
@@ -23,7 +23,7 @@ services:
       - ../conf/php/php-swoole.ini:/usr/local/etc/php/php.ini
       - /nfs/upload:/var/www/html/data/upload
       - /mnt/testlog:/var/www/html/data/log
-    container_name: "panda-swoole"
+    container_name: "test-swoole"
     deploy:
       resources:
         limits:

+ 3 - 3
docker/compose/xyzt/master-crond/docker-compose.yml

@@ -10,7 +10,7 @@ services:
       - ../conf/crontab/root:/var/spool/cron/crontabs/root
       - /nfs/upload:/var/www/html/data/upload
       - /mnt/testlog:/var/www/html/data/log
-    container_name: "panda-master-crontab"
+    container_name: "test-crontab"
     command: [crond,"-f"]
 
   cronsec:
@@ -21,7 +21,7 @@ services:
       - ../conf/php/php.ini:/usr/local/etc/php/php.ini
       - /nfs/upload:/var/www/html/data/upload
       - /mnt/testlog:/var/www/html/data/log
-    container_name: "panda-cronsec"
+    container_name: "test-cronsec"
     command: [php,"/var/www/html/crontab/index.php",'minutes','second_queue']
 
   accedit:
@@ -32,5 +32,5 @@ services:
       - ../conf/php/php.ini:/usr/local/etc/php/php.ini
       - /nfs/upload:/var/www/html/data/upload
       - /mnt/testlog:/var/www/html/data/log
-    container_name: "panda-accedit"
+    container_name: "test-accedit"
     command: [php,"/var/www/html/crontab/index.php",'minutes','account_edit']

docker/compose/xyzt/sender/docker-compose.yml → docker/compose/xyzt/tsender/docker-compose.yml


+ 1 - 1
docker/compose/xyzt/slave-crond/docker-compose.yml

@@ -10,5 +10,5 @@ services:
       - ../conf/crontab/root:/var/spool/cron/crontabs/root
       - /nfs/upload:/var/www/html/data/upload
       - /mnt/testlog:/var/www/html/data/log
-    container_name: "panda-master-crontab"
+    container_name: "test-slavecron"
     command: [crond,"-f"]

+ 8 - 8
docker/compose/xyzt/stat/docker-compose.yml

@@ -9,7 +9,7 @@ services:
       - /nfs/upload:/var/www/html/data/upload
       - /mnt/testlog:/var/www/html/data/log
       - /mnt/stdata:/var/www/html/data/stdata
-    container_name: "panda-reader"
+    container_name: "test-reader"
     command: ['python','reader.py', '-h', '172.26.105.127', '-p', '6379']
 
   mchreadersrv:
@@ -20,7 +20,7 @@ services:
       - /nfs/upload:/var/www/html/data/upload
       - /mnt/shoplog:/var/www/html/data/log
       - /mnt/stdata:/var/www/html/data/stdata
-    container_name: "panda-mchreader"
+    container_name: "test-mchreader"
     command: ['python','mchreader.py', '-h', '172.26.105.127', '-p', '6379']
 
   speedreader:
@@ -31,7 +31,7 @@ services:
       - /nfs/upload:/var/www/html/data/upload
       - /mnt/shoplog:/var/www/html/data/log
       - /mnt/stdata:/var/www/html/data/stdata
-    container_name: "panda-speedreader"
+    container_name: "test-speedreader"
     command: ['python','speed_reader.py', '-h', '172.26.105.127', '-p', '6379']
     deploy:
       resources:
@@ -45,7 +45,7 @@ services:
       - ../conf/etc/localtime:/etc/localtime:ro
       - /mnt/testlog:/var/www/html/data/log
       - /mnt/stdata:/var/www/html/data/stdata
-    container_name: "panda-ratio"
+    container_name: "test-ratio"
     command: ['python','ratio.py', '-h', '172.26.105.127', '-p', '6379']
 
   flasksrv:
@@ -58,7 +58,7 @@ services:
       - /nfs/upload:/var/www/html/data/upload
       - /mnt/testlog:/var/www/html/data/log
       - /mnt/stdata:/var/www/html/data/stdata
-    container_name: "panda-flask"
+    container_name: "test-flask"
     command: ['python','app.py']
 
   mratiosrv:
@@ -69,7 +69,7 @@ services:
       - /nfs/upload:/var/www/html/data/upload
       - /mnt/testlog:/var/www/html/data/log
       - /mnt/stdata:/var/www/html/data/stdata
-    container_name: "panda-mratio"
+    container_name: "test-mratio"
     command: ['python','mratio.py','-h', '172.26.105.127', '-p', '6379']
 
   mcounts:
@@ -80,7 +80,7 @@ services:
       - /nfs/upload:/var/www/html/data/upload
       - /mnt/shoplog:/var/www/html/data/log
       - /mnt/stdata:/var/www/html/data/stdata
-    container_name: "panda-mcounts"
+    container_name: "test-mcounts"
     command: ['python','mcounts.py','-h', '172.26.105.127', '-p', '6379']
 
   chspeed:
@@ -91,5 +91,5 @@ services:
       - /nfs/upload:/var/www/html/data/upload
       - /mnt/shoplog:/var/www/html/data/log
       - /mnt/stdata:/var/www/html/data/stdata
-    container_name: "panda-chspeed"
+    container_name: "test-chspeed"
     command: ['python','chspeed.py','-h', '172.26.105.127', '-p', '6379']

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

@@ -9,5 +9,5 @@ services:
       - ../conf/etc/localtime:/etc/localtime:ro
       - ../conf/redis/6379.conf:/etc/redis/redis.conf
       - /mnt/tredisdata:/data
-    container_name: "panda-redis"
+    container_name: "test-redis"
     command: [redis-server,"/etc/redis/redis.conf"]

docker/compose/xyzt/worker/docker-compose.yml → docker/compose/xyzt/tworker/docker-compose.yml


+ 0 - 0
docker/compose/xyz/worker/restart_all.sh


docker/compose/xyzt/worker/restart_cordsrv.sh → docker/compose/xyzt/tworker/restart_cordsrv.sh


docker/compose/xyzt/worker/stop_all.sh → docker/compose/xyzt/tworker/stop_all.sh


+ 0 - 4
docker/compose/xyzt/worker/restart_all.sh

@@ -1,4 +0,0 @@
-docker-compose stop -t 1200 cordsrv
-docker-compose down
-docker-compose up -d
-docker-compose ps

+ 1 - 0
docker/compose/yl/conf/crontab/slave_root

@@ -1,5 +1,6 @@
 # do daily/weekly/monthly maintenance
 # min	hour	day	month	weekday	command
+*/1    *   *   *   *   php /var/www/html/crontab/index.php minutes update_channel_balance
 0   1   *   *   *   php /var/www/html/crontab/index.php date refill_clear
 1   0   *   *   *   php /var/www/html/crontab/index.php date merchant_nightime
 1   6   *   *   *   php /var/www/html/crontab/index.php date merchant_daytime

+ 63 - 63
global.php

@@ -10,67 +10,67 @@ declare(strict_types=0);
 error_reporting(E_ALL & ~E_NOTICE & ~E_STRICT);
 @date_default_timezone_set('Asia/Shanghai');
 
-define('InShopNC',true);
-define('BASE_CORE_PATH',     BASE_ROOT_PATH.'/core');
-define('BASE_DATA_PATH',     BASE_ROOT_PATH.'/data');
-define('BASE_MODEL_PATH',    BASE_DATA_PATH.'/model');
-define('BASE_UPLOAD_PATH',   BASE_DATA_PATH.'/upload');
-define('BASE_RESOURCE_PATH', BASE_DATA_PATH.'/resource');
-define('BASE_MOBILE_PATH',   BASE_ROOT_PATH.'/mobile');
-define('BASE_CRONTAB_PATH',  BASE_ROOT_PATH.'/crontab');
-define('BASE_UTIL_PATH',     BASE_ROOT_PATH.'/util');
-define('BASE_HELPER_PATH',   BASE_ROOT_PATH.'/helper');
-define('BASE_AVATAR_PATH',   BASE_UPLOAD_PATH.'/shop/avatar');
-define('DS','/');
-
-define('StartTime',microtime(true));
-define('TIMESTAMP',time());
-
-define('DIR_SHOP','shop');
-define('DIR_CMS','cms');
-define('DIR_CIRCLE','circle');
-define('DIR_MICROSHOP','microshop');
-define('DIR_ADMIN','admin');
-define('DIR_API','api');
-define('DIR_MOBILE','mobile');
-define('DIR_WAP','wap');
-define('DIR_RESOURCE','data/resource');
-define('DIR_UPLOAD','data/upload');
-
-define('ATTACH_PATH','shop');
-define('ATTACH_COMMON',ATTACH_PATH.'/common');
-define('ATTACH_AVATAR',ATTACH_PATH.'/avatar');
-define('ATTACH_EDITOR',ATTACH_PATH.'/editor');
-define('ATTACH_MEMBERTAG',ATTACH_PATH.'/membertag');
-define('ATTACH_STORE',ATTACH_PATH.'/store');
-define('ATTACH_GOODS',ATTACH_PATH.'/store/goods');
-define('ATTACH_STORE_DECORATION',ATTACH_PATH.'/store/decoration');
-define('ATTACH_LOGIN',ATTACH_PATH.'/login');
-define('ATTACH_WAYBILL',ATTACH_PATH.'/waybill');
-define('ATTACH_ARTICLE',ATTACH_PATH.'/article');
-define('ATTACH_BRAND',ATTACH_PATH.'/brand');
-define('ATTACH_ADV',ATTACH_PATH.'/adv');
-define('ATTACH_ACTIVITY',ATTACH_PATH.'/activity');
-define('ATTACH_WATERMARK',ATTACH_PATH.'/watermark');
-define('ATTACH_POINTPROD',ATTACH_PATH.'/pointprod');
-define('ATTACH_GROUPBUY',ATTACH_PATH.'/groupbuy');
-define('ATTACH_LIVE_GROUPBUY',ATTACH_PATH.'/livegroupbuy');
-define('ATTACH_SLIDE',ATTACH_PATH.'/store/slide');
-define('ATTACH_VOUCHER',ATTACH_PATH.'/voucher');
-define('ATTACH_STORE_JOININ',ATTACH_PATH.'/store_joinin');
-define('ATTACH_REC_POSITION',ATTACH_PATH.'/rec_position');
-define('ATTACH_MOBILE','mobile');
-define('ATTACH_CIRCLE','circle');
-define('ATTACH_CMS','cms');
-define('ATTACH_LIVE','live');
-define('ATTACH_UPFILE','upfile');
-define('ATTACH_TASK','task');
-define('ATTACH_REFILL_EVIDENCE','refill_evidence');
-define('ATTACH_MALBUM', ATTACH_PATH.'/member');
-define('ATTACH_MQRCODE',ATTACH_PATH.'/qrcode');
-define('ATTACH_MINI_QRCODE',ATTACH_PATH.'/mqrcode');
-define('ATTACH_MICROSHOP','microshop');
-define('TPL_SHOP_NAME','default');
+define('InShopNC', true);
+define('BASE_CORE_PATH', BASE_ROOT_PATH . '/core');
+define('BASE_DATA_PATH', BASE_ROOT_PATH . '/data');
+define('BASE_MODEL_PATH', BASE_DATA_PATH . '/model');
+define('BASE_UPLOAD_PATH', BASE_DATA_PATH . '/upload');
+define('BASE_RESOURCE_PATH', BASE_DATA_PATH . '/resource');
+define('BASE_MOBILE_PATH', BASE_ROOT_PATH . '/mobile');
+define('BASE_CRONTAB_PATH', BASE_ROOT_PATH . '/crontab');
+define('BASE_UTIL_PATH', BASE_ROOT_PATH . '/util');
+define('BASE_HELPER_PATH', BASE_ROOT_PATH . '/helper');
+define('BASE_AVATAR_PATH', BASE_UPLOAD_PATH . '/shop/avatar');
+define('DS', '/');
+
+define('StartTime', microtime(true));
+define('TIMESTAMP', time());
+
+define('DIR_SHOP', 'shop');
+define('DIR_CMS', 'cms');
+define('DIR_CIRCLE', 'circle');
+define('DIR_MICROSHOP', 'microshop');
+define('DIR_ADMIN', 'admin');
+define('DIR_API', 'api');
+define('DIR_MOBILE', 'mobile');
+define('DIR_WAP', 'wap');
+define('DIR_RESOURCE', 'data/resource');
+define('DIR_UPLOAD', 'data/upload');
+
+define('ATTACH_PATH', 'shop');
+define('ATTACH_COMMON', ATTACH_PATH . '/common');
+define('ATTACH_AVATAR', ATTACH_PATH . '/avatar');
+define('ATTACH_EDITOR', ATTACH_PATH . '/editor');
+define('ATTACH_MEMBERTAG', ATTACH_PATH . '/membertag');
+define('ATTACH_STORE', ATTACH_PATH . '/store');
+define('ATTACH_GOODS', ATTACH_PATH . '/store/goods');
+define('ATTACH_STORE_DECORATION', ATTACH_PATH . '/store/decoration');
+define('ATTACH_LOGIN', ATTACH_PATH . '/login');
+define('ATTACH_WAYBILL', ATTACH_PATH . '/waybill');
+define('ATTACH_ARTICLE', ATTACH_PATH . '/article');
+define('ATTACH_BRAND', ATTACH_PATH . '/brand');
+define('ATTACH_ADV', ATTACH_PATH . '/adv');
+define('ATTACH_ACTIVITY', ATTACH_PATH . '/activity');
+define('ATTACH_WATERMARK', ATTACH_PATH . '/watermark');
+define('ATTACH_POINTPROD', ATTACH_PATH . '/pointprod');
+define('ATTACH_GROUPBUY', ATTACH_PATH . '/groupbuy');
+define('ATTACH_LIVE_GROUPBUY', ATTACH_PATH . '/livegroupbuy');
+define('ATTACH_SLIDE', ATTACH_PATH . '/store/slide');
+define('ATTACH_VOUCHER', ATTACH_PATH . '/voucher');
+define('ATTACH_STORE_JOININ', ATTACH_PATH . '/store_joinin');
+define('ATTACH_REC_POSITION', ATTACH_PATH . '/rec_position');
+define('ATTACH_MOBILE', 'mobile');
+define('ATTACH_CIRCLE', 'circle');
+define('ATTACH_CMS', 'cms');
+define('ATTACH_LIVE', 'live');
+define('ATTACH_UPFILE', 'upfile');
+define('ATTACH_TASK', 'task');
+define('ATTACH_REFILL_EVIDENCE', 'refill_evidence');
+define('ATTACH_MALBUM', ATTACH_PATH . '/member');
+define('ATTACH_MQRCODE', ATTACH_PATH . '/qrcode');
+define('ATTACH_MINI_QRCODE', ATTACH_PATH . '/mqrcode');
+define('ATTACH_MICROSHOP', 'microshop');
+define('TPL_SHOP_NAME', 'default');
 define('TPL_CIRCLE_NAME', 'default');
 define('TPL_MICROSHOP_NAME', 'default');
 define('TPL_CMS_NAME', 'default');
@@ -99,9 +99,9 @@ define('DEFAULT_SPEC_COLOR_ID', 1);
 /**
  * 商品图片
  */
-define('GOODS_IMAGES_WIDTH',  '60,240,360,1280');
+define('GOODS_IMAGES_WIDTH', '60,240,360,1280');
 define('GOODS_IMAGES_HEIGHT', '60,240,360,12800');
-define('GOODS_IMAGES_EXT',    '_60,_240,_360,_1280');
+define('GOODS_IMAGES_EXT', '_60,_240,_360,_1280');
 
 /**
  *  订单状态

+ 9 - 0
helper/bank/IBank.php

@@ -0,0 +1,9 @@
+<?php
+
+namespace bank;
+
+interface IBank
+{
+    public function match($line) : bool;
+    public function convert($line) : array;
+}

+ 110 - 0
helper/bank/bcm.php

@@ -0,0 +1,110 @@
+<?php
+
+namespace bank;
+
+//交通银行
+class bcm implements IBank
+{
+    private $mKnown;
+    private $mName;
+    private $mNo;
+    private $mBank;
+
+    public function __construct()
+    {
+        $this->clear();
+    }
+
+    public function clear() {
+        $this->mKnown = false;
+        $this->mName = '';
+        $this->mNo = '';
+        $this->mBank = '';
+    }
+
+    public function match($line) : bool
+    {
+        if($this->mKnown == false)
+        {
+            if($line[0] == '查询账号:' && $line[2] == '户  名:') {
+                $this->mNo = number_format($line[1],0,'.','');
+                $this->mName = $line[3];
+                $this->mKnown = true;
+            }
+        }
+
+        $diff = array_diff(self::$format,$line);
+        return empty($diff);
+    }
+
+    static $format = [
+        0 => '交易时间',
+        1 => '摘要',
+        2 => '凭证种类',
+        3 => '凭证号码',
+        4 => '企业业务编号',
+        5 => '发生额',
+        6 => '币种',
+        7 => '余额',
+        8 => '对方账号',
+        9 => '对方户名',
+        10 => '对方行名',
+        11 => '借贷标志',
+        12 => '卡号',
+        13 => '核心流水号'
+    ];
+
+    public function convert($line) : array
+    {
+        $trade_time = strtotime($line[0]);
+
+        if($trade_time == false) {
+            return [];
+        }
+
+        $subject = $line[1];
+        $proof_type = $line[2];
+        $proof_no = $line[3];
+
+        if($line[11] === '贷') {
+            $in = mb_str_replace(',','',$line[5]);
+            $out = '0';
+        } else {
+            $out = mb_str_replace(',','',$line[5]);
+            $in = 0;
+        }
+        $money_type = $line[6];
+        $left = mb_str_replace(',','',$line[7]);
+
+        $other_no = $line[8];
+        $other_name = $line[9];
+        $other_bank = $line[10];
+
+        $post_date = '';
+        $trade_no = $line[13];
+        $remark = '';
+
+        $result = [
+            'trade_time' => $trade_time,
+            'out_amount' => $out,
+            'in_amount' => $in,
+            'left_amount' => $left,
+            'money_type' => $money_type,
+            'other_name' => $other_name,
+            'other_no' => $other_no,
+            'other_bank' => $other_bank,
+            'post_date' => $post_date,
+            'rsubject' => $subject,
+            'remark' => $remark,
+            'trade_no' => $trade_no,
+            'proof_type' => $proof_type,
+            'proof_no' => $proof_no,
+            'self_name' => $this->mName,
+            'self_no' => $this->mNo,
+            'self_bank' => $this->mBank,
+            'service_charge' => 0.0
+        ];
+
+        return $result;
+    }
+}

+ 114 - 0
helper/bank/ccb.php

@@ -0,0 +1,114 @@
+<?php
+
+
+namespace bank;
+
+//建设银行
+class ccb implements IBank
+{
+    private $mKnown;
+    private $mName;
+    private $mNo;
+    private $mBank;
+
+    static $format = [
+        0 => '交易时间',
+        1 => '借方发生额/元(支取)',
+        2 => '贷方发生额/元(收入)',
+        3 => '余额',
+        4 => '币种',
+        5 => '对方户名',
+        6 => '对方账号',
+        7 => '对方开户机构',
+        8 => '记账日期',
+        9 => '摘要',
+        10 => '备注',
+        11 => '账户明细编号-交易流水号',
+        12 => '企业流水号',
+        13 => '凭证种类',
+        14 => '凭证号',
+        15 => '交易介质编号'
+    ];
+
+    public function __construct()
+    {
+        $this->clear();
+    }
+
+    public function clear() {
+        $this->mKnown = 0;
+        $this->mName = '';
+        $this->mNo = '';
+        $this->mBank = '';
+    }
+
+    public function match($line) : bool
+    {
+        if($this->mKnown != 2)
+        {
+            if($line[0] == '账  号' && $line[2] == '账户名称') {
+                $this->mNo = number_format($line[1],0,'.','');
+                $this->mName = $line[3];
+                $this->mKnown += 1;
+            }
+            elseif ($line[0] == '开户行名称')
+            {
+                $this->mBank = $line[1];
+                if($line[1] == '中国建设银行股份有限公司北京傲城支行') {
+                    $this->mNo = '11050160990000000237';
+
+                }
+
+                $this->mKnown += 1;
+            }
+        }
+
+        $diff = array_diff(self::$format,$line);
+        return empty($diff);
+    }
+
+    public function convert($line) : array
+    {
+        $trade_time = strtotime($line[0]);
+        if($trade_time == false) {
+            return [];
+        }
+        
+        $out = mb_str_replace(',','',$line[1]);
+        $in = mb_str_replace(',','',$line[2]);
+        $left = mb_str_replace(',','',$line[3]);
+        $money_type = $line[4];
+        $other_name = $line[5];
+        $other_no = $line[6];
+        $other_bank = $line[7];
+        $post_date = $line[8];
+        $subject = $line[9];
+        $remark = $line[10];
+        $trade_no = $line[11];
+        $proof_type = $line[13];
+        $proof_no = $line[14];
+
+        $result = [
+            'trade_time' => $trade_time,
+            'out_amount' => $out,
+            'in_amount' => $in,
+            'left_amount' => $left,
+            'money_type' => $money_type,
+            'other_name' => $other_name,
+            'other_no' => $other_no,
+            'other_bank' => $other_bank,
+            'post_date' => $post_date,
+            'rsubject' => $subject,
+            'remark' => $remark,
+            'trade_no' => $trade_no,
+            'proof_type' => $proof_type,
+            'proof_no' => $proof_no,
+            'self_name' => $this->mName,
+            'self_no' => $this->mNo,
+            'self_bank' => $this->mBank,
+            'service_charge' => 0.0
+        ];
+
+        return $result;
+    }
+}

+ 117 - 0
helper/bank/ccbb.php

@@ -0,0 +1,117 @@
+<?php
+
+
+namespace bank;
+
+//建设银行-大批量数据导出
+class ccbb implements IBank
+{
+    static $format = [
+        0 => '账号',
+        1 => '账户名称',
+        2 => '交易时间',
+        3 => '借方发生额(支取)',
+        4 => '贷方发生额(收入)',
+        5 => '余额',
+        6 => '币种',
+        7 => '对方户名',
+        8 => '对方账号',
+        9 => '对方开户机构',
+        10 => '记账日期',
+        11 => '摘要',
+        12 => '备注',
+        13 => '账户明细编号-交易流水号',
+        14 => '企业流水号',
+        15 => '凭证种类',
+        16 => '凭证号',
+        17 => '个性化信息名称1',
+        18 => '个性化信息名称2',
+        19 => '个性化信息名称3',
+        20 => '个性化信息名称4',
+        21 => '个性化信息名称5',
+        22 => '个性化信息名称6',
+        23 => '个性化信息名称7',
+        24 => '个性化信息名称8',
+        25 => '个性化信息名称9',
+        26 => '个性化信息名称10',
+        27 => '个性化信息1',
+        28 => '个性化信息2',
+        29 => '个性化信息3',
+        30 => '个性化信息4',
+        31 => '个性化信息5',
+        32 => '个性化信息6',
+        33 => '个性化信息7',
+        34 => '个性化信息8',
+        35 => '个性化信息9',
+        36 => '个性化信息10',
+        37 => '交易介质编号'
+    ];
+
+    public function __construct()
+    {
+        $this->clear();
+    }
+
+    public function clear() {
+
+    }
+
+    public function match($line) : bool
+    {
+        $diff = array_diff(self::$format,$line);
+        return empty($diff);
+    }
+
+    public function convert($line) : array
+    {
+        $self_no = trim($line[0]);
+
+        if($self_no == '11050160990000000237' || $self_no == '11001079900053013913') {
+            $self_bank = '中国建设银行股份有限公司北京傲城支行';
+        }
+
+        $self_name = trim($line[1]);
+        $trade_time = strtotime($line[2]);
+        if($trade_time == false) {
+            return [];
+        }
+        $out = mb_str_replace(',','',$line[3]);
+        $in = mb_str_replace(',','',$line[4]);
+        $left = mb_str_replace(',','',$line[5]);
+        $money_type = $line[6];
+
+        $other_name = $line[7];
+        $other_no = $line[8];
+        $other_bank = $line[9];
+
+        $post_date = $line[10];
+        $subject = $line[11];
+        $remark = $line[12];
+        $trade_no = $line[13];
+        $proof_type = $line[15];
+        $proof_no = $line[16];
+
+        $result = [
+            'trade_time' => $trade_time,
+            'out_amount' => $out,
+            'in_amount' => $in,
+            'left_amount' => $left,
+            'money_type' => $money_type,
+            'other_name' => $other_name,
+            'other_no' => $other_no,
+            'other_bank' => $other_bank,
+            'post_date' => $post_date,
+            'rsubject' => $subject,
+            'remark' => $remark,
+            'trade_no' => $trade_no,
+            'proof_type' => $proof_type,
+            'proof_no' => $proof_no,
+            'self_name' => $self_name,
+            'self_no' => $self_no,
+            'self_bank' => $self_bank,
+            'service_charge' => 0.0
+        ];
+
+        return $result;
+    }
+}

+ 138 - 0
helper/bank/cmbc.php

@@ -0,0 +1,138 @@
+<?php
+
+
+namespace bank;
+
+//招商银行
+class cmbc implements IBank
+{
+    private $mKnown;
+    private $mName;
+    private $mNo;
+    private $mBank;
+
+    public function __construct()
+    {
+        $this->clear();
+    }
+
+    public function clear()
+    {
+        $this->mKnown = 0;
+        $this->mName = '';
+        $this->mNo = '';
+        $this->mBank = '';
+    }
+
+    public function match($line): bool
+    {
+        if ($this->mKnown != 2)
+        {
+            if ($line[0] == '标题' && $line[3] == '账号名称') {
+                $this->mName = $line[4];
+                $this->mKnown += 1;
+            }
+            elseif ($line[6] == '银行账号')
+            {
+                $this->mNo = $line[7];
+                if($this->mNo == '110946610810701') {
+                    $this->mBank = '招商银行北苑路支行';
+                }
+                elseif ($this->mNo == '110945155010101') {
+                    $this->mBank = '招商银行北苑路支行';
+                }
+
+                $this->mKnown += 1;
+            }
+        }
+
+        $diff = array_diff(self::$format, $line);
+        return empty($diff);
+    }
+
+    static $format = [
+        0 => '账号',
+        1 => '账号名称',
+        2 => '币种',
+        3 => '交易日',
+        4 => '交易时间',
+        5 => '起息日',
+        6 => '交易类型',
+        7 => '借方金额',
+        8 => '贷方金额',
+        9 => '余额',
+        10 => '摘要',
+        11 => '流水号',
+        12 => '流程实例号',
+        13 => '业务名称',
+        14 => '用途',
+        15 => '业务参考号',
+        16 => '业务摘要',
+        17 => '其它摘要',
+        18 => '收(付)方分行名',
+        19 => '收(付)方名称',
+        20 => '收(付)方账号',
+        21 => '收(付)方开户行行号',
+        22 => '收(付)方开户行名',
+        23 => '收(付)方开户行地址',
+        24 => '母(子)公司账号分行名',
+        25 => '母(子)公司账号',
+        26 => '母(子)公司名称',
+        27 => '信息标志',
+        28 => '有否附件信息',
+        29 => '冲账标志',
+        30 => '扩展摘要',
+        31 => '交易分析码',
+        32 => '票据号',
+        33 => '商务支付订单号',
+        34 => '内部编号',
+        35 => '公司一卡通号',
+    ];
+
+    public function convert($line): array
+    {
+        $money_type = $line[2];
+        $trade_time = strtotime($line[3] . ' ' . $line[4]);
+        if($trade_time == false) {
+            return [];
+        }
+
+        $out = mb_str_replace(',', '', $line[7]);
+        $in = mb_str_replace(',', '', $line[8]);
+        $left = mb_str_replace(',', '', $line[9]);
+        $subject = $line[10];
+        $trade_no = $line[11];
+
+        $other_name = $line[19];
+        $other_no = $line[20];
+        $other_bank = $line[22];
+
+        $remark = '';
+        $proof_no = '';
+        $post_date = '';
+        $proof_type = '';
+
+        $result = [
+            'trade_time' => $trade_time,
+            'out_amount' => $out,
+            'in_amount' => $in,
+            'left_amount' => $left,
+            'money_type' => $money_type,
+            'other_name' => $other_name,
+            'other_no' => $other_no,
+            'other_bank' => $other_bank,
+            'post_date' => $post_date,
+            'rsubject' => $subject,
+            'remark' => $remark,
+            'trade_no' => $trade_no,
+            'proof_type' => $proof_type,
+            'proof_no' => $proof_no,
+            'self_name' => $this->mName,
+            'self_no' => $this->mNo,
+            'self_bank' => $this->mBank,
+            'service_charge' => 0.0
+        ];
+
+        return $result;
+    }
+}

+ 137 - 0
helper/bank/cmbcex.php

@@ -0,0 +1,137 @@
+<?php
+
+
+namespace bank;
+
+//招商银行
+class cmbcex implements IBank
+{
+    private $mKnown;
+    private $mName;
+    private $mNo;
+    private $mBank;
+
+    public function __construct()
+    {
+        $this->clear();
+    }
+
+    public function clear()
+    {
+        $this->mKnown = 0;
+        $this->mName = '';
+        $this->mNo = '';
+        $this->mBank = '';
+    }
+
+    public function match($line): bool
+    {
+        if ($this->mKnown != 2)
+        {
+            if ($line[0] == '标题' && $line[3] == '账号名称') {
+                $this->mName = $line[4];
+                $this->mKnown += 1;
+            }
+            elseif ($line[6] == '银行账号')
+            {
+                $this->mNo = $line[7];
+                if($this->mNo == '110946610810701') {
+                    $this->mBank = '招商银行北苑路支行';
+                }
+                elseif ($this->mNo == '110945155010101') {
+                    $this->mBank = '招商银行北苑路支行';
+                }
+
+                $this->mKnown += 1;
+            }
+        }
+
+        $diff = array_diff(self::$format, $line);
+        return empty($diff);
+    }
+
+    static $format = [
+        0 => '账号',
+        1 => '账号名称',
+        2 => '币种',
+        3 => '交易日',
+        4 => '交易时间',
+        5 => '起息日',
+        6 => '交易类型',
+        7 => '借方金额',
+        8 => '贷方金额',
+        9 => '余额',
+        10 => '用途',
+        11 => '流水号',
+        12 => '流程实例号',
+        13 => '业务名称',
+        14 => '业务参考号',
+        15 => '业务摘要',
+        16 => '其它摘要',
+        17 => '收(付)方分行名',
+        18 => '收(付)方名称',
+        19 => '收(付)方账号',
+        20 => '收(付)方开户行行号',
+        21 => '收(付)方开户行名',
+        22 => '收(付)方开户行地址',
+        23 => '母(子)公司账号分行名',
+        24 => '母(子)公司账号',
+        25 => '母(子)公司名称',
+        26 => '信息标志',
+        27 => '有否附件信息',
+        28 => '冲账标志',
+        29 => '扩展摘要',
+        30 => '交易分析码',
+        31 => '票据号',
+        32 => '商务支付订单号',
+        33 => '内部编号',
+        34 => '公司一卡通号'
+    ];
+
+    public function convert($line): array
+    {
+        $money_type = $line[2];
+        $trade_time = strtotime($line[3] . ' ' . $line[4]);
+        if($trade_time == false) {
+            return [];
+        }
+
+        $out = mb_str_replace(',', '', $line[7]);
+        $in = mb_str_replace(',', '', $line[8]);
+        $left = mb_str_replace(',', '', $line[9]);
+        $subject = $line[10];
+        $trade_no = $line[11];
+
+        $other_name = $line[18];
+        $other_no = $line[29];
+        $other_bank = $line[21];
+
+        $remark = '';
+        $proof_no = '';
+        $post_date = '';
+        $proof_type = '';
+
+        $result = [
+            'trade_time' => $trade_time,
+            'out_amount' => $out,
+            'in_amount' => $in,
+            'left_amount' => $left,
+            'money_type' => $money_type,
+            'other_name' => $other_name,
+            'other_no' => $other_no,
+            'other_bank' => $other_bank,
+            'post_date' => $post_date,
+            'rsubject' => $subject,
+            'remark' => $remark,
+            'trade_no' => $trade_no,
+            'proof_type' => $proof_type,
+            'proof_no' => $proof_no,
+            'self_name' => $this->mName,
+            'self_no' => $this->mNo,
+            'self_bank' => $this->mBank,
+            'service_charge' => 0.0
+        ];
+
+        return $result;
+    }
+}

+ 96 - 0
helper/bank/converter.php

@@ -0,0 +1,96 @@
+<?php
+
+namespace bank;
+
+require_once(__DIR__ . '/IBank.php');
+require_once(__DIR__ . '/bcm.php');
+require_once(__DIR__ . '/ccb.php');
+require_once(__DIR__ . '/ccbb.php');
+require_once(__DIR__ . '/spdb.php');
+require_once(__DIR__ . '/cmbc.php');
+require_once(__DIR__ . '/cmbcex.php');
+require_once(__DIR__ . '/hfb.php');
+
+function mb_str_replace($search, $replace, $subject)
+{
+    if (is_array($subject)) {
+        $ret = [];
+        foreach ($subject as $key => $val) {
+            $ret[$key] = mb_str_replace($search, $replace, $val);
+        }
+        return $ret;
+    }
+
+    foreach ((array)$search as $key => $s) {
+        if ($s == '') {
+            continue;
+        }
+        $r = !is_array($replace) ? $replace : (array_key_exists($key, $replace) ? $replace[$key] : '');
+        $pos = mb_strpos($subject, $s, 0, 'UTF-8');
+        while ($pos !== false) {
+            $subject = mb_substr($subject, 0, $pos, 'UTF-8') . $r . mb_substr($subject, $pos + mb_strlen($s, 'UTF-8'), 65535, 'UTF-8');
+            $pos = mb_strpos($subject, $s, $pos + mb_strlen($r, 'UTF-8'), 'UTF-8');
+        }
+    }
+    return $subject;
+}
+
+class converter
+{
+    private $mState;
+    private $mConveters;
+    private $mCurConveter;
+
+    public function __construct()
+    {
+        $this->mState = 0;
+        $this->mConveters = [new ccb(), new ccbb(), new bcm(), new spdb(), new cmbc(), new cmbcex(), new hfb()];
+        $this->clear();
+    }
+
+    private function clear()
+    {
+        foreach ($this->mConveters as $item) {
+            $item->clear();
+        }
+        $this->mCurConveter = null;
+    }
+
+    public function start()
+    {
+        $this->mState = 0;
+        $this->clear();
+
+    }
+
+    public function end()
+    {
+        $this->mState = 0;
+        $this->clear();
+    }
+
+    public function convert($line)
+    {
+        if ($this->mState === 0) {
+            if ($this->match($line)) {
+                $this->mState = 1;
+            }
+            return [];
+        } else {
+            $ret = $this->mCurConveter->convert($line);
+            return $ret;
+        }
+    }
+
+    private function match($line)
+    {
+        foreach ($this->mConveters as $conveter) {
+            if ($conveter->match($line)) {
+                $this->mCurConveter = $conveter;
+                return true;
+            }
+        }
+
+        return false;
+    }
+}

+ 141 - 0
helper/bank/execl_loader.php

@@ -0,0 +1,141 @@
+<?php
+
+namespace bank;
+
+require_once(BASE_ROOT_PATH . '/vendor/autoload.php');
+
+use PhpOffice;
+//use PhpOffice\PhpSpreadsheet\Cell\DataType;
+//use PhpOffice\PhpSpreadsheet\Cell\AdvancedValueBinder;
+use Log;
+
+//class CustomValueBinder extends AdvancedValueBinder
+//{
+//    public static function dataTypeForValue($value): string
+//    { //只重写dataTypeForValue方法,去掉一些不必要的判断
+//        if (is_null($value)) {
+//            return DataType::TYPE_NULL;
+//        } elseif ($value instanceof PhpOffice\PhpSpreadsheet\RichText\RichText) {
+//            return DataType::TYPE_INLINE;
+//        } elseif (is_string($value) && $value[0] === '=' && strlen($value) > 1) {
+//            return DataType::TYPE_FORMULA;
+//        } elseif (is_bool($value)) {
+//            return DataType::TYPE_BOOL;
+//        } elseif (is_float($value) || is_int($value)) {
+//            return DataType::TYPE_NUMERIC;
+//        }
+//        return DataType::TYPE_STRING;
+//    }
+//}
+
+function file_generator($path)
+{
+    if (!file_exists($path)) {
+        return;
+    }
+
+    $fd = opendir($path);
+    if ($fd)
+    {
+        while (($item = @readdir($fd)) !== false)
+        {
+            $sub = $path . DIRECTORY_SEPARATOR . $item;
+            if (is_dir($sub) && $item != '.' && $item != '..')
+            {
+                $files = file_generator($sub);
+                foreach ($files as $file) {
+                    yield $file;
+                }
+            }
+            elseif (is_file($sub)) {
+                yield $sub;
+            }
+        }
+    }
+    closedir($fd);
+}
+
+
+class execl_loader
+{
+    public function load_dirs($dirs)
+    {
+        foreach ($dirs as $dir) {
+            $this->load_dir($dir);
+        }
+    }
+
+    public function load_dir($dir)
+    {
+        $files = file_generator($dir);
+        foreach ($files as $file) {
+            Log::record("$file",Log::DEBUG);
+            $this->load_file($file);
+        }
+    }
+
+    public function load_file($file)
+    {
+        $line_reader = function ($file)
+        {
+            $ext = pathinfo($file,PATHINFO_EXTENSION);
+            if(!in_array($ext,['xls','xlsx'])) {
+                return;
+            }
+
+            $reader = PhpOffice\PhpSpreadsheet\IOFactory::createReaderForFile($file);
+            $reader->setReadDataOnly(true);
+            $spreadsheet = PhpOffice\PhpSpreadsheet\IOFactory::load($file);
+
+            yield 'start' => 1;
+
+            foreach ($spreadsheet->getWorksheetIterator() as $worksheet)
+            {
+                foreach ($worksheet->getRowIterator() as $row)
+                {
+                    $cellIterator = $row->getCellIterator();
+                    $cellIterator->setIterateOnlyExistingCells(false); // Loop all cells, even if it is not set
+
+                    $item = [];
+                    foreach ($cellIterator as $cell)
+                    {
+                        if ($cell !== null) {
+                            $item[] = trim($cell->getFormattedValue());
+                        }
+                    }
+
+                    yield 'line' => $item;
+                }
+            }
+
+            yield 'start' => 0;
+        };
+
+        $mod_record = Model();
+        $inserter = function ($line) use ($mod_record){
+            $mod_record->table('bank_record')->insert($line);
+        };
+
+        $lines = $line_reader($file);
+        $convert = new converter();
+        foreach ($lines as $key => $val)
+        {
+            if($key === 'start') {
+                $convert->start();
+            }
+            elseif($key === 'line')
+            {
+                $line = $convert->convert($val);
+                if(!empty($line)) {
+                    $inserter($line);
+                }
+                else {
+                    Log::record(json_encode($val),Log::DEBUG);
+                }
+            }
+            else {
+                $convert->end();
+            }
+        }
+    }
+}

+ 97 - 0
helper/bank/hfb.php

@@ -0,0 +1,97 @@
+<?php
+
+
+namespace bank;
+
+//汇元宝
+class hfb implements IBank
+{
+    private $mName;
+    private $mNo;
+    private $mBank;
+
+    public function __construct()
+    {
+        $this->clear();
+    }
+
+    public function clear()
+    {
+        $this->mName = '汇元银通(北京)在线支付技术有限公司';
+        $this->mNo = '210401354';
+        $this->mBank = '汇元银通-备付金账户';
+    }
+
+    public function match($line): bool
+    {
+        $diff = array_diff(self::$format, $line);
+        return empty($diff);
+    }
+
+    static $format = [
+        0 => '明细记录ID',
+        1 => '批次号',
+        2 => '商户内码',
+        3 => '持卡人',
+        4 => '收款卡号',
+        5 => '银行名称',
+        6 => '开户行名称',
+        7 => '商户流水号',
+        8 => '付款金额',
+        9 => '手续费',
+        10 => '付款状态',
+        11 => '审核状态',
+        12 => '付款创建时间',
+        13 => '备注说明',
+        14 => '处理说明'];
+
+    public function convert($line): array
+    {
+        $trade_no = $line[0];
+
+        $other_name = $line[3];
+        $other_no = $line[4];
+        $other_bank = $line[6];
+
+        $out = mb_str_replace(['¥',','], '', $line[8]);
+        $money_type = '人民币';
+        $in  = 0.00;
+
+        $service_charge = mb_str_replace(['¥',','], '', $line[9]);
+        if(trim($line[10]) !== '成功') {
+            return [];
+        }
+
+        $trade_time = strtotime($line[12]);
+        $remark = "$line[13]-$line[14]";
+
+        $left = '';
+        $subject = '';
+        $post_date = '';
+        $proof_type = '';
+        $proof_no = '';
+
+        $result = [
+            'trade_time' => $trade_time,
+            'out_amount' => $out,
+            'in_amount' => $in,
+            'left_amount' => $left,
+            'money_type' => $money_type,
+            'other_name' => $other_name,
+            'other_no' => $other_no,
+            'other_bank' => $other_bank,
+            'post_date' => $post_date,
+            'rsubject' => $subject,
+            'remark' => $remark,
+            'trade_no' => $trade_no,
+            'proof_type' => $proof_type,
+            'proof_no' => $proof_no,
+            'self_name' => $this->mName,
+            'self_no' => $this->mNo,
+            'self_bank' => $this->mBank,
+            'service_charge' => $service_charge
+        ];
+
+        return $result;
+    }
+}

+ 111 - 0
helper/bank/spdb.php

@@ -0,0 +1,111 @@
+<?php
+
+
+namespace bank;
+
+//浦发银行
+class spdb implements IBank
+{
+    private $mKnown;
+    private $mName;
+    private $mNo;
+    private $mBank;
+
+    public function __construct()
+    {
+        $this->clear();
+    }
+
+    public function clear()
+    {
+        $this->mKnown = 0;
+        $this->mName = '';
+        $this->mNo = '';
+        $this->mBank = '';
+    }
+
+    public function match($line): bool
+    {
+        if ($this->mKnown != 2)
+        {
+            if ($line[0] == '账号') {
+                $this->mNo = number_format($line[1], 0, '.', '');
+                if($this->mNo == '91160078801900002501') {
+                    $this->mBank = '上海浦东发展银行北京亚运村支行';
+                }
+                elseif($this->mNo == '91160078801200002500') {
+                    $this->mBank = '上海浦东发展银行北京亚运村支行';
+                }
+                $this->mKnown += 1;
+            }
+            elseif ($line[0] == '账户名称') {
+                $this->mName = $line[1];
+                $this->mKnown += 1;
+            }
+        }
+
+        $diff = array_diff(self::$format, $line);
+        return empty($diff);
+    }
+
+    static $format = [
+        0 => '交易日期',
+        1 => '交易时间',
+        2 => '申请日期',
+        3 => '凭证号',
+        4 => '借方金额',
+        5 => '贷方金额',
+        6 => '余额',
+        7 => '对方账号',
+        8 => '对方户名',
+        9 => '对方行名',
+        10 => '交易流水号',
+        11 => '摘要',
+        12 => '备注'];
+
+    public function convert($line): array
+    {
+        $trade_time = strtotime($line[0] . ' ' . sprintf("%06d",intval($line[1])));
+        if($trade_time == false) {
+            return [];
+        }
+
+        $proof_no = $line[3];
+        $out = mb_str_replace(',', '', $line[4]);
+        $in = mb_str_replace(',', '', $line[5]);
+        $left = mb_str_replace(',', '', $line[6]);
+        $other_no = $line[7];
+        $other_name = $line[8];
+        $other_bank = $line[9];
+        $trade_no = $line[10];
+        $subject = $line[11];
+        $remark = $line[12];
+
+        $money_type = '';
+        $post_date = '';
+        $proof_type = '';
+
+        $result = [
+            'trade_time' => $trade_time,
+            'out_amount' => $out,
+            'in_amount' => $in,
+            'left_amount' => $left,
+            'money_type' => $money_type,
+            'other_name' => $other_name,
+            'other_no' => $other_no,
+            'other_bank' => $other_bank,
+            'post_date' => $post_date,
+            'rsubject' => $subject,
+            'remark' => $remark,
+            'trade_no' => $trade_no,
+            'proof_type' => $proof_type,
+            'proof_no' => $proof_no,
+            'self_name' => $this->mName,
+            'self_no' => $this->mNo,
+            'self_bank' => $this->mBank,
+            'service_charge' => 0.0
+        ];
+
+        return $result;
+    }
+}

+ 11 - 9
helper/mtopcard/card_query.php

@@ -304,11 +304,18 @@ class card_query
     //[$validate,$card_type,$region_no,$isTransfer,$status,$black]
     public function validate($card_no)
     {
-        $time_checker = function ($update_time)
+        $time_checker = function ($info)
         {
-            //90 天以内数据有效
+            $update_time = $info['update_time'];
             $delta = time() - intval($update_time);
-            return $delta < 360 * 86400 && $delta >= 0;
+
+            $status = intval($info['card_state']);
+            if(in_array($status,[0,5]) && $delta > 86400 * 15) {
+                return false;
+            }
+            else {
+                return $delta < 360 * 86400 && $delta >= 0;
+            }
         };
 
         $pinfo_getter = function ($card_no) use ($time_checker)
@@ -319,7 +326,7 @@ class card_query
             if(empty($info)) {
                 return [false,[]];
             }
-            elseif($time_checker($info['update_time'])) {
+            elseif($time_checker($info)) {
                 $mod_card->where(['card_no' => $card_no])->update(['using_times' => $info['using_times'] + 1]);
 
                 $card_type = intval($info['card_type']);
@@ -361,11 +368,6 @@ class card_query
         [$succ,$result] = $pinfo_getter($card_no);
         if($succ) return $result;
 
-//        [$succ,$card_type,$region_no,$isTransfer,$status] = $this->tianyan_query($card_no);
-//        if($succ === false) {
-//            return [true, $org_type, -1, false, 1, $black];
-//        }
-
         [$succ, $card_type, $region_no, $isTransfer, $status] = $this->tencent_query($card_no);
         if ($succ === false)
         {

+ 6 - 0
helper/refill/ProviderManager.php

@@ -10,6 +10,7 @@ require_once(BASE_HELPER_PATH . '/refill/IRefillPhone.php');
 require_once(BASE_HELPER_PATH . '/refill/IRefillCallBack.php');
 require_once(BASE_HELPER_PATH . '/refill/CalcMerchantPrice.php');
 require_once(BASE_HELPER_PATH . '/refill/util.php');
+require_once(BASE_HELPER_PATH . '/refill/chprice_helper.php');
 
 use Log;
 use mtopcard;
@@ -134,8 +135,13 @@ class ProviderManager
             $channels = $this->read_channel();
 
             global $config;
+
+            $chprice_helper = new chprice_helper();
+            $chprice_helper->load_from_db();
+
             $this->map_cfg($config['phone_providers'],'RefillPhone',$channels);
             $this->map_cfg($config['oil_providers'],'RefillOil',$channels);
+
             $this->map_cfg($config['third_providers'],'RefillPhone',$channels);
             $this->mOpenedProviderNames = array_unique($this->mOpenedProviderNames);
 

+ 1 - 1
helper/refill/XYZRefillFactory.php

@@ -30,7 +30,7 @@ require_once(BASE_HELPER_PATH . '/refill/policy/mratio_control.php');
 require_once(BASE_HELPER_PATH . '/refill/policy/overload_assigner.php');
 require_once(BASE_HELPER_PATH . '/refill/policy/interceptor.php');
 require_once(BASE_HELPER_PATH . '/refill/functional.php');
-
+require_once(BASE_HELPER_PATH . '/refill/chprice_helper.php');
 
 use Log;
 use StatesHelper;

+ 50 - 0
helper/refill/api/xyz/guitong/RefillCallBack.php

@@ -0,0 +1,50 @@
+<?php
+namespace refill\guitong;
+
+require_once(BASE_HELPER_RAPI_PATH . '/guitong/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')->getOrderInfo(['order_sn' => $order_sn]);
+        if (empty($order_info)) {
+            return [false, false, false,false];
+        }
+        $order_id = $order_info['order_id'];
+
+        if ($status === 2) {
+            $data['official_sn'] = strtolower($params['szRtnMsg']) == 'null' ? '' : $params['szRtnMsg'];
+            Model('refill_order')->edit($order_id, $data);
+            return [$order_id, true, false,true];
+        }
+        elseif ($status === 3) {
+            return [$order_id, false, true,true];
+        }
+        else {
+            return [$order_id, false, false,false];
+        }
+    }
+}

+ 141 - 0
helper/refill/api/xyz/guitong/RefillPhone.php

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

+ 9 - 0
helper/refill/api/xyz/guitong/api.txt

@@ -0,0 +1,9 @@
+正式环境:
+话费下单地址:http://47.98.242.182:10186/plat/api/old/submitorder
+查询地址:http://47.98.242.182:10186/plat/api/old/queryorder
+查询余额地址:http://47.98.242.182:10186/plat/api/old/queryBalance
+
+ID:200062
+秘钥:f9244728b14f42d59084856c7961fc01
+
+对接文档地址:https://docs.qq.com/doc/DWkV1VkxQVk13eEtQ

+ 27 - 0
helper/refill/api/xyz/guitong/config.php

@@ -0,0 +1,27 @@
+<?php
+
+
+namespace refill\guitong;
+
+use mtopcard;
+class config
+{
+    const ORDER_URL = 'http://47.98.242.182:10186/plat/api/old/submitorder';
+    const QUERY_URL= 'http://47.98.242.182:10186/plat/api/old/queryorder';
+    const BALANCE_URL = 'http://47.98.242.182:10186/plat/api/old/queryBalance';
+
+    const USER_ID= '200062';
+    const KEY = 'f9244728b14f42d59084856c7961fc01';
+    const NOTIFY_URL = BASE_SITE_URL . "/mobile/callback/refill_guitong.php";
+
+    const operator = [
+        mtopcard\ChinaMobileCard  => 1,
+        mtopcard\ChinaUnicomCard  => 2,
+        mtopcard\ChinaTelecomCard => 3
+    ];
+    const ExtHeaders = ['Content-Type:application/x-www-form-urlencoded;charset=utf-8'];
+
+    const ERR_NOS = [
+        1000,1001,1003,1004,2001,2002,2003,2020,2021,1006,2030,3003
+    ];
+}

BIN
helper/refill/api/xyz/guochuang/20200407江西联通调价函.png


BIN
helper/refill/api/xyz/guochuang/20220331辽宁青海移动调价函.jpg


BIN
helper/refill/api/xyz/guochuang/20220404国创河南移动调价.png


BIN
helper/refill/api/xyz/guochuang/20220407天津移动调价函.png


BIN
helper/refill/api/xyz/guochuang/20220407河南移动调价函.png


BIN
helper/refill/api/xyz/guochuang/20220408青海移动调价函.png


BIN
helper/refill/api/xyz/guochuang/20220409辽宁移动调价函.png


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

@@ -63,11 +63,11 @@ class config
     //key格式 卡类型-面值-regin_no
     const Price = [
         //移动
-        "4-10-2" => 9.99, "4-20-2" => 19.98, "4-30-2" => 29.895, "4-50-2" => 49.825, "4-100-2" => 99.65, "4-200-2" => 199.3, "4-300-2" => 298.95, "4-500-2" => 498.25,//天津 2
-        "4-10-6" => 9.755, "4-20-6" => 19.51, "4-30-6" => 29.265, "4-50-6" => 48.775, "4-100-6" => 97.55, "4-200-6" => 195.1, "4-300-6" => 292.65, "4-500-6" => 487.75,//辽宁 6
+        "4-10-2" => 10.15, "4-20-2" => 19.92, "4-30-2" => 29.88, "4-50-2" => 49.8, "4-100-2" => 99.6, "4-200-2" => 199.2, "4-300-2" => 298.8, "4-500-2" => 498,//天津 2
+        "4-10-6" => 9.75, "4-20-6" => 19.5, "4-30-6" => 29.25, "4-50-6" => 48.75, "4-100-6" => 97.5, "4-200-6" => 195, "4-300-6" => 292.5, "4-500-6" => 487.5,//辽宁 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" => 10, "4-20-8" => 20, "4-30-8" => 30, "4-50-8" => 50, "4-100-8" => 100, "4-200-8" => 200, "4-300-8" => 300, "4-500-8" => 500 ,//黑龙江 8
-        "4-10-29" => 9.755, "4-20-29" => 19.51, "4-30-29" => 29.265, "4-50-29" => 48.775, "4-100-29" => 97.55, "4-200-29" => 195.1, "4-300-29" => 292.65, "4-500-29" => 487.75,//青海 29
+        "4-10-29" => 9.78, "4-20-29" => 19.56, "4-30-29" => 29.34, "4-50-29" => 48.9, "4-100-29" => 97.8, "4-200-29" => 195.6, "4-300-29" => 293.4, "4-500-29" => 489,//青海 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-13" => 10.22, "4-20-13" => 19.94, "4-30-13" => 29.91, "4-50-13" => 49.85, "4-100-13" => 99.7, "4-200-13" => 199.4, "4-300-13" => 300.9, "4-500-13" => 501.5,//福建 13
         "4-10-5" => 9.99, "4-20-5" => 19.98, "4-30-5" => 29.97, "4-50-5" => 49.95, "4-100-5" => 99.9, "4-200-5" => 200.4, "4-300-5" => 300.6, "4-500-5" => 501,//内蒙古 5
@@ -80,13 +80,14 @@ class config
         "4-10-10" => 9.945, "4-20-10" => 19.89, "4-30-10" => 29.835, "4-50-10" => 49.725, "4-100-10" => 99.45, "4-200-10" => 198.9, "4-300-10" => 298.35, "4-500-10" => 497.25,//江苏 10
         "4-10-11" => 9.945, "4-20-11" => 19.89, "4-30-11" => 29.835, "4-50-11" => 49.725, "4-100-11" => 99.45, "4-200-11" => 198.9, "4-300-11" => 298.35, "4-500-11" => 497.25,//浙江 11
         "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.26, "4-20-16" => 20.28, "4-30-16" => 30.3, "4-50-16" => 50.35, "4-100-16" => 100.4, "4-200-16" => 200.8, "4-300-16" => 301.2, "4-500-16" => 502,//河南 16
+        "4-10-16" => 10.15, "4-20-16" => 20.3, "4-30-16" => 30.21, "4-50-16" => 50.15, "4-100-16" => 100.3, "4-200-16" => 200.6, "4-300-16" => 300.9, "4-500-16" => 501.5,//河南 16
         "4-50-4" => 49.75, "4-100-4" => 99.5, "4-200-4" => 199,//山西 4
+        "4-10-24" => 10.21, "4-20-24" => 20.22, "4-30-24" => 30.24, "4-50-24" => 50.25, "4-100-24" => 100.3, "4-200-24" => 200.4, "4-300-24" => 300.6, "4-500-24" => 501,//贵州 24
         //联通
         "5-10-19" => 10.04, "5-20-19" => 20.08, "5-30-19" => 29.97, "5-50-19" => 49.95, "5-100-19" => 99.9, "5-200-19" => 199.8, "5-300-19" => 299.7, "5-500-19" => 499.5,//广东 19
         "5-10-1" => 9.99, "5-20-1" => 19.98, "5-30-1" => 29.97, "5-50-1" => 49.95, "5-100-1" => 99.9, "5-200-1" => 199.8, "5-300-1" => 299.7, "5-500-1" => 499.5,//北京 1
         "5-10-22" => 10.04, "5-20-22" => 20.08, "5-30-22" => 30.12, "5-50-22" => 50.2, "5-100-22" => 100.4, "5-200-22" => 200.8, "5-300-22" => 301.2, "5-500-22" => 502,//重庆 22
-        "5-10-14" => 10.04, "5-20-14" => 20.08, "5-30-14" => 30.12, "5-50-14" => 50.2, "5-100-14" => 100.3, "5-200-14" => 200.6, "5-300-14" => 300.9, "5-500-14" => 501.5,//江西 14
+        "5-10-14" => 10.03, "5-20-14" => 20.06, "5-30-14" => 30.06, "5-50-14" => 50.1, "5-100-14" => 100.2, "5-200-14" => 200.4, "5-300-14" => 300.6, "5-500-14" => 501,//江西 14
         "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
         //电信
         "6-10-27" => 9.94, "6-20-27" => 19.88, "6-30-27" => 29.82, "6-50-27" => 49.7, "6-100-27" => 99.4, "6-200-27" => 198.8, "6-300-27" => 298.5, "6-500-27" => 497.5,//陕西 27

+ 6 - 4
helper/refill/api/xyz/huoshenguo/config.php

@@ -23,10 +23,12 @@ class config
             500 => 100039,
         ],
         mtopcard\ChinaUnicomCard => [
-            30  => 100105,
-            50  => 100106,
-            100 => 100107,
-            200 => 100108,
+            30  => 100094,
+            50  => 100095,
+            100 => 100096,
+            200 => 100097,
+            300 => 100046,
+            500 => 100047,
         ],
         mtopcard\ChinaTelecomCard => [
             30  => 100012,

+ 9 - 1
helper/refill/api/xyz/huoshenguo/开户信息.txt

@@ -44,4 +44,12 @@ appSecret:JKMrdDVUHUwJZIDV
 100105 电渠联通(快充)30
 100106 电渠联通(快充)50
 100107 电渠联通(快充)100
-100108 电渠联通(快充)200
+100108 电渠联通(快充)200
+
+2022.3.31更换联通编码
+100094	快充联通30
+100095	快充联通50
+100096	快充联通100
+100097	快充联通200
+100046	快充联通300
+100047	快充联通500

+ 67 - 0
helper/refill/api/xyz/huoshenguoman/RefillCallBack.php

@@ -0,0 +1,67 @@
+<?php
+namespace refill\huoshenguoman;
+
+require_once(BASE_HELPER_RAPI_PATH . '/huoshenguoman/config.php');
+
+use refill;
+class RefillCallBack implements refill\IRefillCallBack
+{
+    public function verify($params): bool
+    {
+        $input = $params;
+        unset($input['sign']);
+        $sign = $this->sign($input);
+        if ($params['sign'] == $sign) {
+            return true;
+        } else {
+            return false;
+        }
+    }
+
+    private function sign($params)
+    {
+        $params['appSecret'] = config::APP_SECRET;
+        ksort($params);
+        $content = '';
+        foreach ($params as $key => $value) {
+            if($this->check_empty($value) === false) {
+                $content .= "{$key}={$value}&";
+            }
+        }
+        $content = rtrim($content, '&');
+        return md5($content);
+    }
+
+    private function check_empty($value)
+    {
+        if (!isset($value))
+            return true;
+        if ($value === null)
+            return true;
+        if (trim($value) === "")
+            return true;
+
+        return false;
+    }
+
+    public function notify($params)
+    {
+        $status = intval($params['orderStatus']);
+        $order_sn = $params['outOrderId'];
+        $order_info = Model('vr_order')->getOrderInfo(['order_sn' => $order_sn]);
+        if (empty($order_info)) {
+            return [false, false, false,false];
+        }
+
+        $order_id = $order_info['order_id'];
+        if ($status === 2) {
+            $data['official_sn'] = strtolower($params['ext1']) == 'null' ? '' : $params['ext1'];
+            Model('refill_order')->edit($order_id, $data);
+            return [$order_id, true, false, true];
+        } elseif ($status === 3) {
+            return [$order_id, false, true, true];
+        } else {
+            return [$order_id, false, false, false];
+        }
+    }
+}

+ 155 - 0
helper/refill/api/xyz/huoshenguoman/RefillPhone.php

@@ -0,0 +1,155 @@
+<?php
+
+namespace refill\huoshenguoman;
+
+require_once(BASE_HELPER_RAPI_PATH . '/huoshenguoman/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['appId'] = config::APP_ID;
+        $params['outOrderId'] = $order_sn;
+        $params['uuid'] = $phone;
+        $params['itemId'] = config::PRODUCT[$card_type][$amount];
+        $params['itemFace'] = $amount;
+        $params['callbackUrl'] = config::NOTIFY_URL;
+        $params['timestamp'] = date("YmdHis").$this->get_millisecond();
+        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);
+        if(empty($params['itemId'])) {
+            return [false, '商品编号错误', false];
+        }
+        $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 = json_decode($resp, true);
+            if (empty($resp)) {
+                return [false, '网络错误', true];
+            } elseif ($resp['code'] === '00') {
+                return [true, $resp['orderId'], false];
+            } elseif (in_array($resp['code'], config::ERRCODES, true)) {
+                return [false, $resp['msg'], false];
+            } elseif (in_array($resp['code'], ['-22', '-23', '-99'], true)) {
+                $net_errno = "HTTP-{$resp['code']}";
+                return [false, $resp['msg'], true];
+            } else {
+                $net_errno = "HTTP-998";
+                return [false, $resp['msg'], true];
+            }
+        }
+    }
+
+    public function query($refill_info)
+    {
+        $params['appId'] = config::APP_ID;
+        $params['outOrderId'] = $refill_info['order_sn'];
+        $params['timestamp'] = date("YmdHis").$this->get_millisecond();
+        $params['sign'] = $this->sign($params);
+
+        $resp = http_request(config::QUERY_URL, $params, 'POST', false, config::ExtHeaders);
+
+        if (empty($resp)) {
+            return [false, '网络错误'];
+        }
+        else
+        {
+            Log::record($resp, Log::DEBUG);
+            $resp = json_decode($resp, true);
+            if (empty($resp)) {
+                return [false, '网络错误'];
+            }
+            elseif ($resp['code'] === '00')
+            {
+                $status = $resp['orderStatus'];
+                if ($status === '2') {
+                    $updata['official_sn'] = $resp['ext1'];
+                    Model('refill_order')->edit($refill_info['order_id'], $updata);
+                    $order_state = ORDER_STATE_SUCCESS;
+                } elseif ($status === '3') {
+                    $order_state = ORDER_STATE_CANCEL;
+                } elseif ($status === '1') {
+                    $order_state = ORDER_STATE_SEND;
+                } elseif ($status === '4' && (time() - $refill_info['commit_time'] >= 600)) {
+                    $order_state = ORDER_STATE_NOEXIST;
+                } else {
+                    return [false, $resp['msg']];
+                }
+                return [true, $order_state];
+            }
+            else
+            {
+                return [false, $resp['msg']];
+            }
+        }
+    }
+
+    public function balance()
+    {
+        $params['appId'] = config::APP_ID;
+        $params['timestamp'] = date("YmdHis").$this->get_millisecond();
+        $params['sign'] = $this->sign($params);
+
+        $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['code'] === '00') {
+                return [true, $resp['balance']];
+            } else {
+                return [false, $resp['msg']];
+            }
+        }
+    }
+
+    /**
+     * 获取毫秒级别的时间戳
+     */
+    private function get_millisecond()
+    {
+        list($usec, $sec) = explode(" ", microtime());
+        return round($usec*1000);
+    }
+
+    private function sign($params)
+    {
+        $params['appSecret'] = config::APP_SECRET;
+        ksort($params);
+        $content = '';
+        foreach ($params as $key => $value) {
+            if($this->check_empty($value) === false) {
+                $content .= "{$key}={$value}&";
+            }
+        }
+        $content = rtrim($content, '&');
+        return md5($content);
+    }
+}

+ 31 - 0
helper/refill/api/xyz/huoshenguoman/config.php

@@ -0,0 +1,31 @@
+<?php
+
+
+namespace refill\huoshenguoman;
+
+use mtopcard;
+class config
+{
+    const ORDER_URL = 'http://120.26.89.236:8911/api/hf/order/submit';
+    const QUERY_URL = 'http://120.26.89.236:8911/api/order/query';
+    const BALANCE_URL = 'http://120.26.89.236:8911/api/account/balance';
+
+    const APP_ID = 'tME7rcK07P';
+    const APP_SECRET = 'vfrkNedzDCXXdIdT';
+    const NOTIFY_URL = BASE_SITE_URL . "/mobile/callback/refill_huoshenguoman.php";
+    const PRODUCT = [
+        mtopcard\ChinaMobileCard => [
+
+        ],
+        mtopcard\ChinaUnicomCard => [
+            100 => 100032,
+            200 => 100033,
+        ],
+        mtopcard\ChinaTelecomCard => [
+            100 => 100024,
+            200 => 100025,
+        ],
+    ];
+    const ExtHeaders = ['Content-Type:application/x-www-form-urlencoded;charset=utf-8'];
+    const ERRCODES = ['-10', '-12', '-13', '-14', '-15', '-16', '-18', '-21'];
+}

+ 21 - 0
helper/refill/api/xyz/huoshenguoman/开户信息.txt

@@ -0,0 +1,21 @@
+后台地址:http://120.26.89.236:8888
+帐号:YZMC
+密码:704923
+二级密码:CFzO5766
+appId:tME7rcK07P
+appSecret:vfrkNedzDCXXdIdT
+后台-商品列表,可查看已配置商品信息
+后台-安全中心,可配置IP白名单
+接口文档:https://www.showdoc.com.cn/1686453783298366/7925312871840290
+话费直充接口:http://120.26.89.236:8911/api/hf/order/submit
+通用直充接口:http://120.26.89.236:8911/api/order/submit
+卡密提取接口:http://120.26.89.236:8911/api/card/get
+查单接口接口:http://120.26.89.236:8911/api/order/query
+余额接口接口:http://120.26.89.236:8911/api/account/balance
+
+
+100032  慢充联通100
+100033  慢充联通200
+
+100024  慢充电信100
+100025  慢充电信200

+ 1 - 1
helper/refill/api/xyz/jianjiao/API信息.txt

@@ -1,4 +1,4 @@
-平台地址:https://hfcs.dmjvip.com/agent/
+平台地址:https://jj.dmjvip.com/agent/
 商户账号:15811535608
 商户密码:15811535608
 AppKey:

BIN
helper/refill/api/xyz/kuaikuaifs/20220330广东移动调价函.png


BIN
helper/refill/api/xyz/kuaikuaifs/20220331青海移动调价函.png


+ 2 - 2
helper/refill/api/xyz/kuaikuaifs/config.php

@@ -48,9 +48,9 @@ class config
     //key格式 卡类型-面值-regin_no
     const Price = [
         //移动
-        "4-5-29" => 4.87, "4-10-29" => 9.74, "4-20-29" => 19.48, "4-30-29" => 29.22, "4-50-29" => 48.7, "4-100-29" => 97.4, "4-200-29" => 194.8, "4-300-29" => 292.2, "4-500-29" => 487,//青海 29
+        "4-5-29" => 4.88, "4-10-29" => 9.76, "4-20-29" => 19.52, "4-30-29" => 29.28, "4-50-29" => 48.8, "4-100-29" => 97.6, "4-200-29" => 195.2, "4-300-29" => 292.8, "4-500-29" => 488,//青海 29
         "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-19" => 9.92, "4-20-19" => 19.84, "4-30-19" => 29.76, "4-50-19" => 49.6, "4-100-19" => 99.2, "4-200-19" => 198.4, "4-300-19" => 297.6, "4-500-19" => 496,//广东 19
+        "4-10-19" => 9.95, "4-20-19" => 19.9, "4-30-19" => 29.85, "4-50-19" => 49.75, "4-100-19" => 99.5, "4-200-19" => 199, "4-300-19" => 298.5, "4-500-19" => 497.5,//广东 19
     ];
 
     public static function sign($params)

+ 12 - 7
helper/refill/api/xyz/lingzhman48/config.php

@@ -6,23 +6,28 @@ use mtopcard;
 
 class config
 {
-    //895
-    const ORDER_URL = 'http://47.99.65.204/flow-receiver/fee/recharge';
-    const QUERY_URL = 'http://47.99.65.204/flow-receiver/fee/query/single';
-    const BALANCE_URL = 'http://47.99.65.204/flow-receiver/fee/balance/query';
+    const ORDER_URL = 'http://47.108.202.150/flow-receiver/fee/recharge';
+    const QUERY_URL = 'http://47.108.202.150/flow-receiver/fee/query/single';
+    const BALANCE_URL = 'http://47.108.202.150/flow-receiver/fee/balance/query';
     const NOTIFY_URL = BASE_SITE_URL . '/mobile/callback/refill_lingzhman48.php'; //需联系上游配置
     const ACCOUNT = 'yz1988';
     const KEY = '30ba2a10cdb9464fac671c3e4c0cfb97';
 
     const ProductIDS = [
         mtopcard\ChinaMobileCard  => [
-            50 => 'CMCCALLn50r', 100 => 'CMCCALLn100r', 200 => 'CMCCALLn200r'
+            10 => 'CMCCALLr10r', 20 => 'CMCCALLr20r', 30 => 'CMCCALLr30r',
+            50 => 'CMCCALLr50r', 100 => 'CMCCALLr100r', 200 => 'CMCCALLr200r',
+            300 => 'CMCCALLr300r', 500 => 'CMCCALLr500r'
         ],
         mtopcard\ChinaUnicomCard  => [
-            50 => 'CUCCALLn50r', 100 => 'CUCCALLn100r', 200 => 'CUCCALLn200r'
+            10 => 'CUCCALLr10r', 20 => 'CUCCALLr20r', 30 => 'CUCCALLr30r',
+            50 => 'CUCCALLr50r', 100 => 'CUCCALLr100r', 200 => 'CUCCALLr200r',
+            300 => 'CUCCALLr300r', 500 => 'CUCCALLr500r'
         ],
         mtopcard\ChinaTelecomCard => [
-            50 => 'CTCCALLn50r', 100 => 'CTCCALLn100r', 200 => 'CTCCALLn200r'
+            10 => 'CTCCALLr10r', 20 => 'CTCCALLr20r', 30 => 'CTCCALLr30r',
+            50 => 'CTCCALLr50r', 100 => 'CTCCALLr100r', 200 => 'CTCCALLr200r',
+            300 => 'CTCCALLr300r', 500 => 'CTCCALLr500r'
         ]
     ];
 

+ 44 - 34
helper/refill/api/xyz/lingzhman48/椰子慢充.txt

@@ -1,34 +1,44 @@
-http://47.99.65.204/flow-consumer/login.html
-梖瘍	yz1988
-躇鎢	yz1988
-躇埥	30ba2a10cdb9464fac671c3e4c0cfb97
-
-
-
-
-狟等華硊
-http://47.99.65.204/flow-receiver/fee/recharge
-蠶講脤戙華硊
-http://47.99.65.204/flow-receiver/fee/query
-等跺脤戙華硊
-http://47.99.65.204/flow-receiver/fee/query/single
-豻塗脤戙華硊
-http://47.99.65.204/flow-receiver/fee/balance/query
-
-
-痄雄鞣喃莉ⅲ晤鎢		醱硉
-CMCCALLn50r				50	
-CMCCALLn100r			100	
-CMCCALLn200r			200
-
-
-薊籵鞣喃莉ⅲ晤鎢		醱硉
-CUCCALLn50r				50	
-CUCCALLn100r			100
-CUCCALLn200r			200
-
-
-萇陓鞣喃莉ⅲ晤鎢		醱硉
-CTCCALLn50r				50
-CTCCALLn100r			100
-CTCCALLn200r			200
+http://47.108.202.150/flow-consumer/login.html
+韐血噡	yz1988
+密码	yz1988
+撖�𤨎	30ba2a10cdb9464fac671c3e4c0cfb97
+
+
+
+下单地址
+http://47.108.202.150/flow-receiver/fee/recharge
+查询地址
+http://47.108.202.150/flow-receiver/fee/query/single
+余额查询地址
+http://47.108.202.150/flow-receiver/fee/balance/query
+
+全国移动产品编码				面值(元)
+CMCCALLr10r						10
+CMCCALLr20r						20
+CMCCALLr30r						30
+CMCCALLr50r						50
+CMCCALLr100r					100
+CMCCALLr200r					200
+CMCCALLr300r					300
+CMCCALLr500r					500
+
+
+全国联通产品编码				面值(元)
+CUCCALLr10r						10
+CUCCALLr20r						20
+CUCCALLr30r						30
+CUCCALLr50r						50
+CUCCALLr100r					100
+CUCCALLr200r					200
+CUCCALLr300r					300
+CUCCALLr500r					500
+
+全国电信产品编码				面值(元)
+CTCCALLr10r						10
+CTCCALLr20r						20
+CTCCALLr30r						30
+CTCCALLr50r						50
+CTCCALLr100r					100
+CTCCALLr200r					200
+CTCCALLr300r					300
+CTCCALLr500r					500

+ 2 - 2
helper/refill/api/yl/baixuannew_high/config.php

@@ -11,8 +11,8 @@ class config
     const QUERY_URL= 'http://118.31.38.142:9086/searchpay.do';
     const BALANCE_URL = 'http://118.31.38.142:9086/searchbalance.do';
 
-    const USER_ID= '10002504';
-    const KEY = 'T8JBHZyHGziF2A3AtM5tDesWtb73MRCX';
+    const USER_ID= '10002723';
+    const KEY = 'bT36FC2FFYFyQYmp5MEd2yFSCDjiAfjG';
     const NOTIFY_URL = BASE_SITE_URL . "/mobile/callback/refill_baixuannew_high.php";
     const operator = [
         mtopcard\ChinaMobileCard  => 'yd',

+ 4 - 4
helper/refill/api/yl/baixuannew_high/对接文档-yezi.txt

@@ -1,8 +1,8 @@
 登录地址:http://118.31.38.142:7080/
-账号:YZ01
-密码:W3yet5aWmR
-ID:10002504
-秘钥:T8JBHZyHGziF2A3AtM5tDesWtb73MRCX
+账号:bjyl1
+密码:bjyl123
+ID:10002723
+秘钥:bT36FC2FFYFyQYmp5MEd2yFSCDjiAfjG
 下单地址:
 http://118.31.38.142:9086/onlinepay.do
 余额查询:

+ 2 - 2
helper/refill/api/yl/baixuannew_normal/config.php

@@ -11,8 +11,8 @@ class config
     const QUERY_URL= 'http://118.31.38.142:9086/searchpay.do';
     const BALANCE_URL = 'http://118.31.38.142:9086/searchbalance.do';
 
-    const USER_ID= '10002544';
-    const KEY = 'TGP8dMWt3YNN8Hb3Ebzf6fK8X7n6FzmK';
+    const USER_ID= '10002724';
+    const KEY = 'RhmJrHtcmjY7FBcf4yGJwCCkEDbyyZTn';
     const NOTIFY_URL = BASE_SITE_URL . "/mobile/callback/refill_baixuannew_normal.php";
     const operator = [
         mtopcard\ChinaMobileCard  => 'yd',

+ 4 - 4
helper/refill/api/yl/baixuannew_normal/对接文档-yezi.txt

@@ -1,8 +1,8 @@
 登录地址:http://118.31.38.142:7080/
-账号:YZ02
-密码:YZ123456
-ID:10002544
-秘钥:TGP8dMWt3YNN8Hb3Ebzf6fK8X7n6FzmK
+账号:bjyl2
+密码:bjyl123
+ID:10002724
+秘钥:RhmJrHtcmjY7FBcf4yGJwCCkEDbyyZTn
 下单地址:
 http://118.31.38.142:9086/onlinepay.do
 余额查询:

+ 8 - 4
helper/refill/api/yl/dashang_normal/config.php

@@ -11,8 +11,8 @@ class config
     const QUERY_URL= 'http://47.114.209.57/unicomAync/queryBizOrder.do';
     const BALANCE_URL = 'http://47.114.209.57/unicomAync/queryBalance.do';
 
-    const USER_ID= '80800357';
-    const KEY = '1d3a51d49c3b0ba2685389b52f26bffb';
+    const USER_ID= '80800410';
+    const KEY = '2f8296345f2b841d0a59e6bf28b3ab4b';
     const NOTIFY_URL = BASE_SITE_URL . "/mobile/callback/refill_dashang_normal.php";
 
     const Products = [
@@ -23,7 +23,9 @@ class config
                 30  => 60030030,
                 50  => 60030050,
                 100 => 60030100,
-                200 => 60030200
+                200 => 60030200,
+                300 => 60030300,
+                500 => 60030500
             ],
         mtopcard\ChinaUnicomCard =>
             [
@@ -43,7 +45,9 @@ class config
                 30  => 60040030,
                 50  => 60040050,
                 100 => 60040100,
-                200 => 60040200
+                200 => 60040200,
+                300 => 60040300,
+                500 => 60040500
             ]
     ];
 }

+ 12 - 6
helper/refill/api/yl/dashang_normal/开户信息.txt

@@ -1,11 +1,11 @@
  开户信息如下:
-北京国研方略信息科学研究院
+北京椰林网络科技有限公司
 查单平台:http://bm.jiaoyi101.com
-登录名:gyflbilldj
-初始密码:sup123456
+登录用户名:bjylbill
+登录密码:sup123456
 对接信息
-userId:80800357
-key: 1d3a51d49c3b0ba2685389b52f26bffb
+userId:80800410
+key: 2f8296345f2b841d0a59e6bf28b3ab4b
 下单:http://47.114.209.57/unicomAync/buy.do
 查询:http://47.114.209.57/unicomAync/queryBizOrder.do
 余额:http://47.114.209.57/unicomAync/queryBalance.do
@@ -18,6 +18,8 @@ key: 1d3a51d49c3b0ba2685389b52f26bffb
 60040050 全国电信50
 60040100 全国电信100
 60040200 全国电信200
+60040300 全国电信300
+60040500 全国电信500
 
 60050010 全国联通10
 60050020 全国联通20
@@ -25,10 +27,14 @@ key: 1d3a51d49c3b0ba2685389b52f26bffb
 60050050 全国联通50
 60050100 全国联通100
 60050200 全国联通200
+60050300 全国联通300
+60050500 全国联通500
 
 60030010 全国移动10
 60030020 全国移动20
 60030030 全国移动30
 60030050 全国移动50
 60030100 全国移动100
-60030200 全国移动200
+60030200 全国移动200
+60030300 全国移动300
+60030500 全国移动500

+ 4 - 3
helper/refill/api/yl/dongye/api.txt

@@ -1,7 +1,8 @@
-用户编号:10003105
-账户:bjgy
+用户编号:10004065
+账户:bjyl
 密码:sup123456
-秘钥:nxmpEYzCQCQMxtAtrihBRSitxHbk63km
+秘钥:ymdWkh7c3QrkbXdJpmyd6QhcJDBkNmbd
+API对接文档∶http://www.firstsup.net/showdoc
 下单地址 :http://8.134.53.93:9086/onlinepay.do
 查单地址 :http://8.134.53.93:9086/searchpay.do
 查询余额地址 :http://8.134.53.93:9086/searchbalance.do

+ 2 - 2
helper/refill/api/yl/dongye/config.php

@@ -10,8 +10,8 @@ class config
     const QUERY_URL= 'http://8.134.53.93:9086/searchpay.do';
     const BALANCE_URL = 'http://8.134.53.93:9086/searchbalance.do';
 
-    const USER_ID= '10003105';
-    const KEY = 'nxmpEYzCQCQMxtAtrihBRSitxHbk63km';
+    const USER_ID= '10004065';
+    const KEY = 'ymdWkh7c3QrkbXdJpmyd6QhcJDBkNmbd';
     const NOTIFY_URL = BASE_SITE_URL . "/mobile/callback/refill_dongye.php";
     const operator = [
         mtopcard\ChinaMobileCard  => 'yd',

+ 4 - 3
helper/refill/api/yl/dongyefs/api.txt

@@ -1,7 +1,8 @@
-用户编号:10003125
-账户:bjgyfs
+用户编号:10004066
+账户:bjylfs
 密码:sup123456
-秘钥:82dkkhEaR6GhchQkhS5SiffF2w8yX4wQ
+秘钥:2JZRBQWJRpQBGkQGha8cy8P6jHtfeSj7
+API对接文档∶http://www.firstsup.net/showdoc
 下单地址 :http://8.134.53.93:9086/onlinepay.do
 查单地址 :http://8.134.53.93:9086/searchpay.do
 查询余额地址 :http://8.134.53.93:9086/searchbalance.do

+ 2 - 2
helper/refill/api/yl/dongyefs/config.php

@@ -8,8 +8,8 @@ class config
     const QUERY_URL= 'http://8.134.53.93:9086/searchpay.do';
     const BALANCE_URL = 'http://8.134.53.93:9086/searchbalance.do';
 
-    const USER_ID= '10003125';
-    const KEY = '82dkkhEaR6GhchQkhS5SiffF2w8yX4wQ';
+    const USER_ID= '10004066';
+    const KEY = '2JZRBQWJRpQBGkQGha8cy8P6jHtfeSj7';
     const NOTIFY_URL = BASE_SITE_URL . "/mobile/callback/refill_dongyefs.php";
     const operator = [
         mtopcard\ChinaMobileCard  => 'yd',

+ 2 - 2
helper/refill/api/yl/feimingyunew/config.php

@@ -11,8 +11,8 @@ class config
     const QUERY_URL= 'http://121.36.242.90:9086/searchpay.do';
     const BALANCE_URL = 'http://121.36.242.90:9086/searchbalance.do';
 
-    const USER_ID= '10002506';
-    const KEY = 'TeWNFZkXKsDa7TQd6BhieizYGizPWAEZ';
+    const USER_ID= '10002623';
+    const KEY = 'NBh4Py7EpHS23yNQ6xQyB3taKhXaZinH';
     const NOTIFY_URL = BASE_SITE_URL . "/mobile/callback/refill_feimingyunew.php";
     const operator = [
         mtopcard\ChinaMobileCard  => 'yd',

+ 4 - 4
helper/refill/api/yl/feimingyunew/对接文档-yezi.txt

@@ -1,8 +1,8 @@
 http://121.36.242.90:7080/
-账号:15811535608
-密码:yz123456
-id:10002506
-秘钥:TeWNFZkXKsDa7TQd6BhieizYGizPWAEZ
+账号:椰林
+密码:yelin131419
+id:10002623
+秘钥:NBh4Py7EpHS23yNQ6xQyB3taKhXaZinH
 
 api接口文档地址:
 https://www.showdoc.com.cn/AQL666666/

BIN
helper/refill/api/yl/guochuang/20210904调价函.jpg


BIN
helper/refill/api/yl/guochuang/20210908广东移动调价函.png


+ 0 - 0
helper/refill/api/yl/guochuang/20210914广东移动调价函.jpg


Some files were not shown because too many files changed in this diff