瀏覽代碼

Merge branch 'raccount' into rchannel

xiaoyu 2 年之前
父節點
當前提交
6cbf530b3a
共有 100 個文件被更改,包括 4948 次插入430 次删除
  1. 0 4
      admin/config/config.ini.php
  2. 59 0
      admin/control/merchant_fulu.php
  3. 1 1
      admin/control/order_search.php
  4. 105 0
      admin/control/order_search_fulu.php
  5. 86 0
      admin/control/orderstats_fulu.php
  6. 62 0
      admin/control/refill_analysis_fulu.php
  7. 1 1
      admin/control/refill_config.php
  8. 3 1
      admin/control/refill_order.php
  9. 160 0
      admin/control/refill_tax_stats.php
  10. 7 0
      admin/include/limit.php
  11. 15 0
      admin/include/menu.php
  12. 4 1
      admin/templates/default/analysis.cov.mch_order_send.php
  13. 6 3
      admin/templates/default/analysis.cov.provider.php
  14. 6 5
      admin/templates/default/analysis.cov.provider_succs.php
  15. 4 1
      admin/templates/default/analysis.cov.system.php
  16. 14 11
      admin/templates/default/analysis.network.php
  17. 11 9
      admin/templates/default/analysis.provider.php
  18. 15 13
      admin/templates/default/analysis.provider_speed.php
  19. 12 9
      admin/templates/default/analysis.system.php
  20. 2 2
      admin/templates/default/layout/index_layout.php
  21. 10 5
      admin/templates/default/merchant.ctl.php
  22. 181 0
      admin/templates/default/merchant.fulu.index.php
  23. 2 2
      admin/templates/default/merchant.index.php
  24. 7 6
      admin/templates/default/merchant.price.php
  25. 194 0
      admin/templates/default/merchant.ratios.fulu.php
  26. 114 101
      admin/templates/default/merchant.ratios.php
  27. 393 0
      admin/templates/default/order.stats.merchant.fulu.php
  28. 1 0
      admin/templates/default/provider.amount.php
  29. 8 6
      admin/templates/default/refill.order.batch.php
  30. 2 0
      admin/templates/default/refill.order.index.php
  31. 6 4
      admin/templates/default/refill.order.monitor.notify.php
  32. 6 4
      admin/templates/default/refill.order.neterr.index.php
  33. 3 1
      admin/templates/default/refill.order.notify.err.index.php
  34. 474 0
      admin/templates/default/refill.order.search.fulu.php
  35. 3 1
      admin/templates/default/refill.order.search.php
  36. 6 4
      admin/templates/default/refill.order.send.index.php
  37. 214 0
      admin/templates/default/refill_tax.merchant.php
  38. 214 0
      admin/templates/default/refill_tax.provider.php
  39. 349 0
      admin/templates/default/refill_tax.stats.merchant.php
  40. 238 0
      admin/templates/default/refill_tax.stats.provider.php
  41. 3 1
      admin/templates/default/transfer.order.recharge.php
  42. 6 0
      data/config/win/base.ini.php
  43. 6 1
      data/config/xyz/base.ini.php
  44. 596 156
      data/config/xyz/refill.ini.php
  45. 4 1
      data/config/yl/base.ini.php
  46. 97 64
      data/config/yl/refill.ini.php
  47. 1 1
      docker/compose/xyzt/tworker/docker-compose.yml
  48. 1 0
      helper/rbridge/RBridgeFactory.php
  49. 4 0
      helper/rbridge/fulu/Bridge.php
  50. 163 0
      helper/rbridge/fulu_qdw/Bridge.php
  51. 23 0
      helper/rbridge/fulu_qdw/config.php
  52. 20 0
      helper/rbridge/fulu_qdw/product.php
  53. 30 0
      helper/rbridge/fulu_qdw/readme.txt
  54. 4 0
      helper/rbridge/fulu_ylyw/Bridge.php
  55. 7 0
      helper/rbridge/fulu_ylyw/product.php
  56. 5 0
      helper/rbridge/fulu_ylyw/readme.txt
  57. 4 0
      helper/rbridge/fulu_youjun/Bridge.php
  58. 7 2
      helper/refill/ProviderManager.php
  59. 18 0
      helper/refill/api/xyz/bier_fs/config.php
  60. 22 0
      helper/refill/api/xyz/bier_fs/椰子.txt
  61. 3 1
      helper/refill/api/xyz/cangxin_high/config.php
  62. 4 0
      helper/refill/api/xyz/cangxin_high/开户信息.txt
  63. 二進制
      helper/refill/api/xyz/dazhanggui_fs/20230105贵州移动调价函.png
  64. 二進制
      helper/refill/api/xyz/dazhanggui_fs/20230113福建移动调价函.jpg
  65. 二進制
      helper/refill/api/xyz/dazhanggui_fs/20230205云南移动调价函.jpg
  66. 16 0
      helper/refill/api/xyz/dazhanggui_fs/api.txt
  67. 19 3
      helper/refill/api/xyz/dazhanggui_fs/config.php
  68. 二進制
      helper/refill/api/xyz/dazhanggui_fs_gd/20230203广东移动调价函.jpg
  69. 1 1
      helper/refill/api/xyz/dazhanggui_fs_gd/config.php
  70. 二進制
      helper/refill/api/xyz/dezhi_fs/20221230江苏浙江移动调价函.jpg
  71. 二進制
      helper/refill/api/xyz/dezhi_fs/20230101江苏二次调价函.jpg
  72. 二進制
      helper/refill/api/xyz/dezhi_fs/20230101江苏移动调价函.jpg
  73. 二進制
      helper/refill/api/xyz/dezhi_fs/20230104贵州移动调价函.jpg
  74. 二進制
      helper/refill/api/xyz/dezhi_fs/20230112江苏移动调价函.jpg
  75. 二進制
      helper/refill/api/xyz/dezhi_fs/20230208广西移动调价函.jpg
  76. 二進制
      helper/refill/api/xyz/dezhi_fs/20230212江苏移动调价函.jpg
  77. 二進制
      helper/refill/api/xyz/dezhi_fs/20230212贵州移动调价函.jpg
  78. 二進制
      helper/refill/api/xyz/dezhi_fs/20230213广西移动调价函.jpg
  79. 二進制
      helper/refill/api/xyz/dezhi_fs/20230217广西移动调价函.png
  80. 5 2
      helper/refill/api/xyz/dezhi_fs/config.php
  81. 2 2
      helper/refill/api/xyz/douxun/RefillCallBack.php
  82. 45 0
      helper/refill/api/xyz/douxun_copy/RefillCallBack.php
  83. 188 0
      helper/refill/api/xyz/douxun_copy/RefillPhone.php
  84. 6 0
      helper/refill/api/xyz/douxun_copy/api.txt
  85. 54 0
      helper/refill/api/xyz/douxun_copy/config.php
  86. 二進制
      helper/refill/api/xyz/douxun_copy/新豆讯话费网关平台接口文档V2.1.doc
  87. 二進制
      helper/refill/api/xyz/douxun_copy/话费产品编码.xls
  88. 45 0
      helper/refill/api/xyz/douxun_sec/RefillCallBack.php
  89. 188 0
      helper/refill/api/xyz/douxun_sec/RefillPhone.php
  90. 6 0
      helper/refill/api/xyz/douxun_sec/api.txt
  91. 54 0
      helper/refill/api/xyz/douxun_sec/config.php
  92. 二進制
      helper/refill/api/xyz/douxun_sec/新豆讯话费网关平台接口文档V2.1.doc
  93. 二進制
      helper/refill/api/xyz/douxun_sec/话费产品编码.xls
  94. 45 0
      helper/refill/api/xyz/douxun_sec_copy/RefillCallBack.php
  95. 188 0
      helper/refill/api/xyz/douxun_sec_copy/RefillPhone.php
  96. 6 0
      helper/refill/api/xyz/douxun_sec_copy/api.txt
  97. 54 0
      helper/refill/api/xyz/douxun_sec_copy/config.php
  98. 二進制
      helper/refill/api/xyz/douxun_sec_copy/新豆讯话费网关平台接口文档V2.1.doc
  99. 二進制
      helper/refill/api/xyz/douxun_sec_copy/话费产品编码.xls
  100. 0 0
      helper/refill/api/xyz/feimingyu_fs/20230217贵州移动调价函.jpg

+ 0 - 4
admin/config/config.ini.php

@@ -43,10 +43,6 @@ $config['server'] = [
     '121.89.201.55' => 'worker服务器',
     '121.89.223.81' => 'worker服务器',
     '39.101.140.116' => 'worker服务器',
-    '' => '',
-    '39.99.250.165' => '数据库服务器',
-    '39.103.201.41' => '数据库服务器',
-    '39.103.141.163' => '后台服务器',
 ];
 
 $config['oil_quality_text'] = [

+ 59 - 0
admin/control/merchant_fulu.php

@@ -0,0 +1,59 @@
+<?php
+
+class merchant_fuluControl extends SystemControl
+{
+    public function __construct()
+    {
+        parent::__construct();
+        Language::read('merchant');
+    }
+
+    public function merchantOp()
+    {
+        global $config;
+        $merchant_list = [];
+        $stats = ['available_total' => 0, 'debt_total' => 0];
+        $condition['mchid'] = ['in', $config['fulu_mchid']];
+        $model_merchant = Model('merchant');
+        if(!empty($condition))
+        {
+            if (trim($_GET['merchant_name']) != '') {
+                $condition['company_name'] = ['like', '%' . $_GET['merchant_name'] . '%'];
+            }
+            $debt_total = 0;
+            $available_total = 0;
+            $merchant_list = $model_merchant->getMerchantList($condition, 200, 'available_predeposit desc,merchant_state asc,mchid desc', true);
+            $refill_company = $this->refill_companys(['co_type' => refill_companyModel::co_type_merchant]);
+
+            $merchant_debts = rcache("merchant-debts-detail", 'refill-');
+            foreach ($merchant_list as $key => $merchant) {
+                $mchid = $merchant['mchid'];
+                $available_predeposit = $merchant['available_predeposit'] - $merchant['credit_bonus'];
+                $merchant_list[$key]['available_predeposit'] = number_format($available_predeposit,4,'.',',');
+                $merchant_list[$key]['co_name'] = $refill_company[$merchant['co_id']]['co_name'] ?? '/';
+
+                if(!in_array($mchid, $config['test_mchid']) && $merchant['merchant_state'] == 1) {
+                    if($available_predeposit >= 0) {
+                        $available_total += $available_predeposit;
+                    }else{
+                        $debt_total += $available_predeposit;
+                    }
+                }
+
+                if (array_key_exists($mchid, $merchant_debts)) {
+                    $debt_detail = unserialize($merchant_debts[$mchid]);
+                    $merchant_list[$key]['debt'] = $debt_detail;
+                } else {
+                    $merchant_list[$key]['debt'] = ['debt' => 0, 'send_amounts' => 0, 'lack_amounts' => 0];
+                }
+            }
+            $stats = ['available_total' => $available_total, 'debt_total' => $debt_total];
+        }
+
+        Tpl::output('merchant_state_text', self::STATE_TEXT);
+        Tpl::output('merchant_list', $merchant_list);
+        Tpl::output('stats', $stats);
+        Tpl::output('page', $model_merchant->showpage('2'));
+        Tpl::showpage('merchant.fulu.index');
+    }
+}

+ 1 - 1
admin/control/order_search.php

@@ -94,4 +94,4 @@ class order_searchControl extends SystemControl
         Tpl::output('show_page', $model_refill_order->showpage());
         Tpl::showpage('refill.order.search');
     }
-}
+}

+ 105 - 0
admin/control/order_search_fulu.php

@@ -0,0 +1,105 @@
+<?php
+
+
+class order_search_fuluControl extends SystemControl
+{
+    public function __construct()
+    {
+        parent::__construct();
+    }
+
+    public function indexOp()
+    {
+        global $config;
+        $model_refill_order = Model('refill_order');
+        $order_list = [];
+        $_GET['query_start_time'] = $_GET['query_start_time'] ?? date("Y-m-d 00:00:00");
+
+        if (in_array($_GET['order_state'], ['0', '10', '20', '30', '40']))
+        {
+            $condition['vr_order.order_state'] = $_GET['order_state'];
+        }
+
+        //批量查询,二者都有,以卡号为主
+        if(!empty($_GET['card_nos'])) {
+            $card_nos = trim($_GET['card_nos'], ',');
+            $condition['refill_order.card_no'] = ['in', $card_nos];
+        } elseif (!empty($_GET['mch_orders'])) {
+            $mch_orders = rtrim($_GET['mch_orders'], ',');
+            $condition['refill_order.mch_order'] = ['in', $mch_orders];
+        }
+        if(!empty($_GET['order_sns'])) {
+            $order_sns = trim($_GET['order_sns'], ',');
+            $condition['refill_order.order_sn'] = ['in', $order_sns];
+        }
+        if (!empty($_GET['card_type'])) {
+            if (in_array($_GET['card_type'], ['1', '2', '4', '5', '6', '7'])) {
+                $condition['refill_order.card_type'] = intval($_GET['card_type']);
+            }
+        }
+        if (!empty($_GET['refill_amount'])) {
+            $condition['refill_order.refill_amount'] = $_GET['refill_amount'];
+        }
+
+        if(!empty($condition)) {
+            $condition['refill_order.inner_status'] = 0;
+            $cur_time = time();
+
+            $start_unixtime = intval(strtotime($_GET['query_start_time']));
+            $end_unixtime = intval(strtotime($_GET['query_end_time']));
+            if(!empty($_GET['time'])) {
+                $end_unixtime = $cur_time + $_GET['time'];
+            }
+            $condition['refill_order.mchid'] = ['in', $config['fulu_mchid']];
+
+            if ($start_unixtime > 0 && $end_unixtime > $start_unixtime) {
+                $condition['refill_order.order_time'] = [['egt', $start_unixtime], ['lt', $end_unixtime], 'and'];
+            } elseif ($start_unixtime > 0) {
+                $condition['refill_order.order_time'] = ['egt', $start_unixtime];
+            } elseif ($end_unixtime > 0) {
+                $condition['refill_order.order_time'] = ['lt', $end_unixtime];
+            } else {
+                $start = strtotime(date('Y-m-d', time()));
+                $condition['refill_order.order_time'] = ['egt', $start];
+            }
+            $order_list = $model_refill_order->getMerchantOrderList($condition, 200, 0,'refill_order.*,vr_order.order_state', 'refill_order.channel_name DESC ');
+
+            $merchant_list = Model('')->table('merchant')->limit(1000)->select();
+            foreach ($merchant_list as  $value) {
+                $merchants[$value['mchid']] = $value;
+            }
+            foreach ($order_list as $order_id => $order_info) {
+                $order_list[$order_id]['card_type_text'] = $this->scard_type($order_info['card_type']);
+                $order_list[$order_id]['mch_name'] = $merchants[$order_info['mchid']]['company_name'];
+                if ($order_info['notify_time'] > 0) {
+                    $diff_time = $order_info['notify_time'] - $order_info['order_time'];
+                } else {
+                    $diff_time = $cur_time - $order_info['order_time'];
+                }
+                $order_list[$order_id]['diff_time_text'] = $this->elapse_time($diff_time);
+                $order_list[$order_id]['diff_time'] = $diff_time;
+                $order_list[$order_id]['quality_text'] = $this->quality_format($order_info['quality'],$order_info['card_type']);
+            }
+        }
+        $merchant_list = $this->merchants(['mchid' => ['in', $config['fulu_mchid']]]);
+        Tpl::output('merchant_list', $merchant_list);
+        Tpl::output('order_list', $order_list);
+        Tpl::output('show_page', $model_refill_order->showpage());
+        Tpl::showpage('refill.order.search.fulu');
+    }
+
+    public function merchant_dataOp()
+    {
+        global $config;
+        $merchant_list = $this->merchants(['mchid' => ['in', $config['fulu_mchid']]]);
+        $result = [];
+        foreach ($merchant_list as $value) {
+            $data['name'] = $value['company_name'] ?? $value['name'];
+            $data['value'] = $value['mchid'];
+            $data['alpha'] = $value['alpha'];
+            $data['color'] = false;
+            $result[] = $data;
+        }
+        echo json_encode($result);
+    }
+}

+ 86 - 0
admin/control/orderstats_fulu.php

@@ -0,0 +1,86 @@
+<?php
+
+
+class orderstats_fuluControl extends SystemControl
+{
+    public function __construct()
+    {
+        parent::__construct();
+    }
+
+    public function indexOp()
+    {
+        $type = 'merchant';
+        $_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 = $this->ct_cond($_GET, 'time_stamp');
+        if (!empty($_GET['order_time_type'])) {
+            $condition['order_time_type'] = $_GET['order_time_type'];
+        }
+
+        $stats_list = $model_refill_order->getOrderStatsList($condition, 50, '*', 'time_stamp desc, cname asc');
+        if($type == 'merchant') {
+            foreach ($stats_list as $key => $stats) {
+                $time = date("Y-m-d",$stats['time_stamp']+86400);
+                $mch_cache = rcache("merchant_balance_{$time}", 'refill-');
+                $caches = empty($mch_cache['data']) ? [] : unserialize($mch_cache['data']);
+                if(empty($caches)) continue;
+                $stats_list[$key]['available'] = ncPriceFormat($caches[$stats['cid']]) ?? '';
+            }
+        }
+
+        $total_stats = $this->stats($condition);
+        $order_time_type_text = ['notify_time' => '回调时间', 'order_time' => '下单时间'];
+        Tpl::output('total_stats', $total_stats);
+        Tpl::output('stats_list', $stats_list);
+        Tpl::output('order_time_type_text', $order_time_type_text);
+        Tpl::output('show_page', $model_refill_order->showpage());
+        Tpl::showpage('order.stats.merchant.fulu');
+    }
+
+    private function ct_cond($input, $time_stamp)
+    {
+        global $config;
+        $condition['type'] = 'merchant';
+        if (!empty($input['cid'])) {
+            $condition['cid'] = ['in', $input['cid']];
+        } else {
+            $condition['cid'] = ['in', $config['fulu_mchid']];
+        }
+
+        $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;
+    }
+
+    private function stats($condition)
+    {
+        $order_time_type = ['notify_time','order_time'];
+        foreach ($order_time_type as $type){
+            $condition['order_time_type'] = $type;
+            $stats = Model('')->table('refill_stats')
+                ->field('sum(success_count) as success_count,sum(success_refill_amounts) as success_refill_amounts,sum(success_mch_amounts) as success_mch_amounts,
+                sum(success_channel_amounts) as success_channel_amounts,sum(profit_amounts) as profit_amounts,sum(send_count) as send_count')
+                ->where($condition)
+                ->find();
+            $total_stats[$type] = [
+                'success_count_total' => $stats['success_count'],
+                'success_refill_amounts_total' => ncPriceFormat($stats['success_refill_amounts']),
+                'success_mch_amounts_toatl' => ncPriceFormat($stats['success_mch_amounts']),
+                'success_channel_amounts_total' => ncPriceFormat($stats['success_channel_amounts']),
+                'profit_amounts_total' => ncPriceFormat($stats['profit_amounts']),
+                'send_count_total' => $stats['send_count'],
+            ];
+        }
+        return $total_stats;
+    }
+}

+ 62 - 0
admin/control/refill_analysis_fulu.php

@@ -0,0 +1,62 @@
+<?php
+
+class refill_analysis_fuluControl extends SystemControl
+{
+    public function __construct()
+    {
+        parent::__construct();
+    }
+
+    public function merchant_ratiosOp()
+    {
+        global $config;
+        //0:成功单,1:失败单,2:成功率
+        $ins = Cache::getInstance('cacheredis');
+        $json = $ins->get_org('merchant_card_type_ratios');
+        $data = json_decode($json);
+        $data = $this->object_array($data);
+        $result = [];
+        $stats = [];
+        $card_types = ['YD', 'LT', 'DX'];
+        if (!empty($data)) {
+            $merchant_list = $this->merchants(['mchid' => ['in', $config['fulu_mchid']]]);
+
+            foreach ($merchant_list as $value) {
+                $mchid = $value['mchid'];
+                if (array_key_exists($mchid, $data) && is_array($data[$mchid])) {
+                    $result[$mchid]['ratio'] = $data[$mchid];
+                    $result[$mchid]['company_name'] = $value['company_name'];
+                    $result[$mchid]['time_out'] = $this->elapse_time($value['time_out']);
+
+                    foreach ($card_types as $type) {
+                        if ($data[$mchid][$type][3600][0] + $data[$mchid][$type][3600][1] > 0) {
+                            $stats[$type]['success'] += $data[$mchid][$type][3600][0];
+                            $stats[$type]['ratio'] += $data[$mchid][$type][3600][2];
+                            $stats[$type]['count'] += 1;
+                        }
+                    }
+                }
+            }
+            Tpl::output('stats', $stats);
+            Tpl::output('count', count($result));
+        }
+        Tpl::output('list', $result);
+        Tpl::showpage('merchant.ratios.fulu');
+    }
+
+    private function object_array($array)
+    {
+        if(is_object($array))
+        {
+            $array = (array)$array;
+        }
+        if(is_array($array))
+        {
+            foreach($array as $key=>$value)
+            {
+                $array[$key] = $this->object_array($value);
+            }
+        }
+        return $array;
+    }
+}

+ 1 - 1
admin/control/refill_config.php

@@ -162,4 +162,4 @@ class refill_configControl extends SystemControl
             Tpl::showpage('card.add');
         }
     }
-}
+}

+ 3 - 1
admin/control/refill_order.php

@@ -398,7 +398,8 @@ class refill_orderControl extends SystemControl
         $condition['refill_order.order_time'] = ['egt', $order_time];
         $condition['refill_order.mchid'] = $mchid;
 
-        $field = 'refill_order.order_sn,refill_order.commit_time,refill_order.notify_time,refill_order.channel_name,vr_order.order_state,refill_order.err_msg,vr_order.close_reason';
+        $field = 'refill_order.order_sn,refill_order.commit_time,refill_order.notify_time,refill_order.channel_name,vr_order.order_state,
+        refill_order.err_msg,vr_order.close_reason,refill_order.quality,refill_order.card_type';
         $order_list = $model_refill_order->getMerchantOrderList($condition, 1000,0, $field);
 
         foreach ($order_list as $order_id => $order_info)
@@ -406,6 +407,7 @@ class refill_orderControl extends SystemControl
             $order_list[$order_id]['order_state_text'] = orderState($order_info);
             $order_list[$order_id]['notify_time_text'] = '/';
             $order_list[$order_id]['commit_time_text'] = date("Y-m-d H:i:s", $order_info['commit_time']);
+            $order_list[$order_id]['quality_text'] = $this->quality_format($order_info['quality'], $order_info['card_type']);
             if ($order_info['notify_time'] > 0)
             {
                 if($order_info['commit_time'] == 0) {

+ 160 - 0
admin/control/refill_tax_stats.php

@@ -0,0 +1,160 @@
+<?php
+
+class refill_tax_statsControl extends SystemControl
+{
+    public function __construct()
+    {
+        parent::__construct();
+    }
+
+    public function indexOp()
+    {
+        $tax_type = $_GET['tax_type'] ?? 'provider';
+        $page = "refill_tax.stats.{$tax_type}";
+        $model_refill_order = Model('refill_order');
+        $_GET['query_start_time'] = $_GET['query_start_time'] ?? date("Y-m-d 00:00:00", strtotime("-1 day"));
+        $cond = $this->ct_cond($_GET, 'time_stamp');
+        if (!empty($_GET['order_time_type'])) {
+            $cond['order_time_type'] = $_GET['order_time_type'];
+        }
+        $stats_list = $model_refill_order->getOrderStatsList($cond, 50, '*', 'time_stamp desc, cname asc');
+
+        $total_stats = $this->stats($cond);
+        $order_time_type_text = ['notify_time' => '回调时间', 'order_time' => '下单时间'];
+        Tpl::output('total_stats', $total_stats);
+        Tpl::output('stats_list', $stats_list);
+        Tpl::output('order_time_type_text', $order_time_type_text);
+        Tpl::output('show_page', $model_refill_order->showpage());
+        Tpl::showpage($page);
+    }
+
+    private function ct_cond($input, $time_stamp)
+    {
+        $cond['type'] = $input['tax_type'] ?? 'provider';
+        $cache_cids = $this->cache_cids($input['tax_type']);
+        if (!empty($input['cid'])) {
+            $cond['cid'] = ['in', $input['cid']];
+        } else {
+            $cond['cid'] = ['in', $cache_cids];
+        }
+
+        $start_unixtime = intval(strtotime($input['query_start_time']));
+        $end_unixtime = intval(strtotime($input['query_end_time']));
+
+        if ($start_unixtime > 0 && $end_unixtime > $start_unixtime) {
+            $cond[$time_stamp] = [['egt', $start_unixtime], ['lt', $end_unixtime], 'and'];
+        } elseif ($start_unixtime > 0) {
+            $cond[$time_stamp] = ['egt', $start_unixtime];
+        } elseif ($end_unixtime > 0) {
+            $cond[$time_stamp] = ['lt', $end_unixtime];
+        }
+
+        return $cond;
+    }
+
+    private function stats($condition)
+    {
+        $order_time_type = ['notify_time','order_time'];
+        foreach ($order_time_type as $type){
+            $condition['order_time_type'] = $type;
+            $stats = Model('')->table('refill_stats')
+                ->field('sum(success_count) as success_count,sum(success_refill_amounts) as success_refill_amounts,sum(success_mch_amounts) as success_mch_amounts,
+                sum(success_channel_amounts) as success_channel_amounts,sum(profit_amounts) as profit_amounts,sum(send_count) as send_count')
+                ->where($condition)
+                ->find();
+            $total_stats[$type] = [
+                'success_count_total' => $stats['success_count'],
+                'success_refill_amounts_total' => ncPriceFormat($stats['success_refill_amounts']),
+                'success_mch_amounts_toatl' => ncPriceFormat($stats['success_mch_amounts']),
+                'success_channel_amounts_total' => ncPriceFormat($stats['success_channel_amounts']),
+                'profit_amounts_total' => ncPriceFormat($stats['profit_amounts']),
+                'send_count_total' => $stats['send_count'],
+            ];
+        }
+        return $total_stats;
+    }
+
+    public function refill_tax_subjectOp()
+    {
+        $tax_type = $_GET['tax_type'] ?? 'provider';
+        $page = "refill_tax.{$tax_type}";
+        $cids = $_GET['cids'] ?? '';
+        [$cache_cids, $cids] = $this->subject_cids($tax_type, $cids);
+        if ($tax_type == 'merchant') {
+            $mod = Model('merchant');
+            $list = $mod->getMerchantList(['mchid' => ['in', $cids]], 200, 'available_predeposit desc,merchant_state asc,mchid desc', true);
+        }
+        elseif ($tax_type == 'provider')
+        {
+            $mod = Model('refill_provider');
+            $list = $mod->table('refill_provider,store')->field('refill_provider.*,store.store_name,store.member_id')->join('inner')->on('store.store_id=refill_provider.store_id')
+                ->where(['store.store_id' => ['in', $cids]])->order('opened asc, name asc')->page(200)->select();
+        }
+        else{
+            return;
+        }
+        if(!empty($cids)) {
+            $_GET['cids'] = implode(',', $cids);
+        }
+        Tpl::output('list', $list);
+        Tpl::output('cache_cids', $cache_cids);
+        Tpl::output('show_page', $mod->showpage());
+        Tpl::showpage($page);
+    }
+
+    public function subject_setOp()
+    {
+        $tax_type = $_GET['tax_type'] ?? 'provider';
+        $cids = $_GET['cids'];
+        wkcache("refill-tax-{$tax_type}", $cids);
+        showMessage('操作成功');
+    }
+
+    private function subject_cids($tax_type, $cids)
+    {
+        $cache_cids = $this->cache_cids($tax_type);
+        if(empty($cids)) return [$cache_cids, $cache_cids];
+        $cids = explode(',', $cids);
+        return [$cache_cids, array_unique(array_merge($cache_cids, $cids))];
+    }
+
+    private function cache_cids($tax_type)
+    {
+        $cache_cids = rkcache("refill-tax-{$tax_type}");
+        if(empty($cache_cids)){
+            $cache_cids = [];
+        }else{
+            $cache_cids = explode(',', $cache_cids);
+        }
+        return $cache_cids;
+    }
+
+    public function merchant_dataOp()
+    {
+        $cache_cids = $this->cache_cids('merchant');
+        $merchant_list = $this->merchants(['mchid' => ['in', $cache_cids]]);
+        $result = [];
+        foreach ($merchant_list as $value) {
+            $data['name'] = $value['company_name'] ?? $value['name'];
+            $data['value'] = $value['mchid'];
+            $data['alpha'] = $value['alpha'];
+            $data['color'] = false;
+            $result[] = $data;
+        }
+        echo json_encode($result);
+    }
+
+    public function provider_dataOp()
+    {
+        $cache_cids = $this->cache_cids('provider');
+        $provider_list = $this->providers();
+        $result = [];
+        foreach ($provider_list as $value) {
+            if(!in_array($value['store_id'], $cache_cids)) continue;
+            $data['name'] = $value['store_name'] ?? $value['name'];
+            $data['value'] = $value['store_id'];
+            $result[] = $data;
+        }
+        echo json_encode($result);
+    }
+}

+ 7 - 0
admin/include/limit.php

@@ -40,6 +40,7 @@ $_limit =  array(
         array('name'=> '通道组管理', 'op'=> null, 'act'=>'provider_group'),
         array('name'=> '订单监控', 'op'=>null, 'act'=>'ordersendlist'),
         array('name'=> '对账管理', 'op'=>null, 'act'=>'orderstats'),
+        array('name'=> '带票对账统计', 'op'=>null, 'act'=>'refill_tax_stats'),
         array('name'=> '公司信息管理', 'op'=>null, 'act'=>'refill_company'),
         array('name'=> '充值拦截设置', 'op'=>null, 'act'=>'refill_config'),
         array('name'=> '卡密管理', 'op'=>null, 'act'=>'card_key'),
@@ -60,6 +61,12 @@ $_limit =  array(
     array('name' => '办卡业务', 'child' => array(
         array('name' => '信息列表', 'op' => null, 'act' => 'retail'),
     )),
+    array('name' => '充值订单业务', 'child' => array(
+        array('name'=> '机构管理', 'op'=>null, 'act'=>'merchant_fulu'),
+        array('name'=> '订单查询', 'op'=>null, 'act'=>'order_search_fulu'),
+        array('name'=> '对账管理', 'op'=>null, 'act'=>'orderstats_fulu'),
+        array('name'=> '成功率监控', 'op'=>null, 'act'=>'refill_analysis_fulu'),
+    )),
 	array('name'=>$lang['nc_store'], 'child'=>array(
 		array('name'=>$lang['nc_store_manage'], 'op'=>null, 'act'=>'store'),
 		array('name'=>$lang['nc_store_grade'], 'op'=>null, 'act'=>'store_grade'),

+ 15 - 0
admin/include/menu.php

@@ -32,6 +32,10 @@ $arr = array(
 				'text' 	=> '办卡业务'
 			],
 			[
+				'args' 	=> 'merchant_fulu',
+				'text' 	=> '充值订单业务'
+			],
+			[
 				'args' 	=> 'store',
 				'text' 	=> $lang['nc_store']
 			],
@@ -117,6 +121,7 @@ $arr = array(
 					array('args'=>'index,provider_group,merchant',			'text'=>'通道组管理'),
 					array('args'=>'index,ordersendlist,merchant',			'text'=>'订单监控'),
 					array('args'=>'index,orderstats,merchant',				'text'=>'对账管理'),
+					array('args'=>'index,refill_tax_stats,merchant',	    'text'=>'带票对账统计'),
 					array('args'=>'index,refill_company,merchant',				'text'=>'公司信息管理'),
 					array('args'=>'intercept,refill_config,merchant',		'text'=>'充值拦截设置'),
 					array('args'=>'stats,card_key,merchant',				'text'=>'卡密管理'),
@@ -144,6 +149,16 @@ $arr = array(
 				)
 			],
 			[
+				'nav' => 'merchant_fulu',
+				'text' => '充值订单业务',
+				'list' => array(
+					array('args'=>'merchant,merchant_fulu,merchant_fulu',		'text'=>'机构管理'),
+					array('args'=>'index,order_search_fulu,merchant_fulu',		'text'=>'订单查询'),
+					array('args'=>'index,orderstats_fulu,merchant_fulu',		'text'=>'对账管理'),
+					array('args'=>'merchant_ratios,refill_analysis_fulu,merchant_fulu',		'text'=>'成功率监控'),
+				)
+			],
+			[
 				'nav' => 'store',
 				'text' => $lang['nc_store'],
 				'list' => array(

+ 4 - 1
admin/templates/default/analysis.cov.mch_order_send.php

@@ -339,5 +339,8 @@
         });
 
         $('#ncsubmit').trigger('click');
+
+        const fixedHeight = $('.fixed-bar').height();
+        $('.fixed-empty').css('cssText', 'height:' + (parseFloat(fixedHeight) + 8) + 'px !important');
     })
-</script>
+</script>

+ 6 - 3
admin/templates/default/analysis.cov.provider.php

@@ -351,8 +351,7 @@
             if (show_all > 0) {
                 src += '&show_all=' + true;
             }
-            $.get(src, function(data)
-            {
+            $.get(src, function(data) {
                 if (data.state == 'success') {
                     $('#echart').html(`<img src='data:image/png;base64,${data.img}'/>`)
                     ratios = data.ratios;
@@ -371,5 +370,9 @@
 
         $('.querySelect').trigger('change');
         $('#ncsubmit').trigger('click');
+
+
+        const fixedHeight = $('.fixed-bar').height();
+        $('.fixed-empty').css('cssText', 'height:' + (parseFloat(fixedHeight) + 8) + 'px !important');
     })
-</script>
+</script>

+ 6 - 5
admin/templates/default/analysis.cov.provider_succs.php

@@ -186,8 +186,7 @@
 <script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/refill/moment-with-locales.js"></script>
 <link rel="stylesheet" type="text/css" href="<?php echo RESOURCE_SITE_URL; ?>/js/jquery-ui/themes/ui-lightness/jquery.ui.css" />
 <script type="text/javascript">
-    $(function()
-    {
+    $(function() {
         let ratios = [];
         let qualitys = [];
 
@@ -351,8 +350,7 @@
             if (show_all > 0) {
                 src += '&show_all=' + true;
             }
-            $.get(src, function(data)
-            {
+            $.get(src, function(data) {
                 if (data.state == 'success') {
                     $('#echart').html(`<img src='data:image/png;base64,${data.img}'/>`)
                     ratios = data.ratios;
@@ -371,5 +369,8 @@
 
         $('.querySelect').trigger('change');
         $('#ncsubmit').trigger('click');
+
+        const fixedHeight = $('.fixed-bar').height();
+        $('.fixed-empty').css('cssText', 'height:' + (parseFloat(fixedHeight) + 8) + 'px !important');
     })
-</script>
+</script>

+ 4 - 1
admin/templates/default/analysis.cov.system.php

@@ -356,5 +356,8 @@
         });
 
         $('#ncsubmit').trigger('click');
+
+        const fixedHeight = $('.fixed-bar').height();
+        $('.fixed-empty').css('cssText', 'height:' + (parseFloat(fixedHeight) + 8) + 'px !important');
     })
-</script>
+</script>

+ 14 - 11
admin/templates/default/analysis.network.php

@@ -99,14 +99,14 @@
         <div class="echartsContent">
             <table id="checkChannel">
                 <thead>
-                <tr>
-                    <td>
-                        <label>
-                            <input type="checkbox" id="checkAllChannel">
-                            编号(通道列表)
-                        </label>
-                    </td>
-                </tr>
+                    <tr>
+                        <td>
+                            <label>
+                                <input type="checkbox" id="checkAllChannel">
+                                编号(通道列表)
+                            </label>
+                        </td>
+                    </tr>
                 </thead>
                 <tbody id="checkChannelContent">
 
@@ -265,8 +265,7 @@
             if (filter_wave > 0) {
                 src += '&filter_wave=' + filter_wave;
             }
-            $.get(src, function(data)
-            {
+            $.get(src, function(data) {
                 if (data.state == 'success') {
                     $('#echart').html(`<img src='data:image/png;base64,${data.img}'/>`)
                     ratios = data.ratios;
@@ -285,5 +284,9 @@
 
         $('.querySelect').trigger('change');
         $('#ncsubmit').trigger('click');
+
+
+        const fixedHeight = $('.fixed-bar').height();
+        $('.fixed-empty').css('cssText', 'height:' + (parseFloat(fixedHeight) + 8) + 'px !important');
     })
-</script>
+</script>

+ 11 - 9
admin/templates/default/analysis.provider.php

@@ -234,22 +234,19 @@
             let msec = $("select[name=msec]").val()
             msec = parseInt(msec);
             let startTime = $('#startTime').val();
-            if(startTime === '') {
+            if (startTime === '') {
                 startTime = date.getTime() - 1800000
                 startTime = moment(startTime).format("YYYY-M-DD HH:mm:ss")
             }
             let endTime = $('#endTime').val();
-            if(endTime === '') {
+            if (endTime === '') {
                 endTime = moment(date.getTime()).format("YYYY-M-DD HH:mm:ss")
             }
 
-            if(type === 'before')
-            {
+            if (type === 'before') {
                 startTime = Date.parse(startTime) - msec
                 endTime = Date.parse(endTime) - msec
-            }
-            else
-            {
+            } else {
                 startTime = Date.parse(startTime) + msec
                 endTime = Date.parse(endTime) + msec
             }
@@ -492,7 +489,7 @@
                     layer.msg('日期有误,结束日期需大于开始日期');
                     return
                 }
-                if(end_time - start_time > 86400*5) {
+                if (end_time - start_time > 86400 * 5) {
                     layer.msg('日期区间大于五天,请重新选择');
                     return
                 }
@@ -556,5 +553,10 @@
 
         $('.querySelect').trigger('change');
 
+
+
+        const fixedHeight = $('.fixed-bar').height();
+        $('.fixed-empty').css('cssText', 'height:' + (parseFloat(fixedHeight) + 8) + 'px !important');
+
     })
-</script>
+</script>

+ 15 - 13
admin/templates/default/analysis.provider_speed.php

@@ -52,7 +52,7 @@
             <h3>成功率监控列表</h3>
             <ul class="tab-base">
                 <li><a href="?index.php&act=refill_analysis&op=index&type=provider"><span>通道按时段成功率监控</span></a></li>
-                <li><a href="JavaScript:void(0);" class="current" ><span>通道单量与成功率监控</span></a></li>
+                <li><a href="JavaScript:void(0);" class="current"><span>通道单量与成功率监控</span></a></li>
                 <li><a href="?index.php&act=refill_analysis&op=new_version&type=provider_succs"><span>通道按时段成功单量监控</span></a></li>
                 <li><a href="?index.php&act=refill_analysis&op=new_version&type=provider"><span>通道累计成功率监控</span></a></li>
                 <li><a href="?index.php&act=refill_analysis&op=index&type=network"><span>通道网络监控</span></a></li>
@@ -145,14 +145,14 @@
         <div class="echartsContent">
             <table id="checkChannel">
                 <thead>
-                <tr>
-                    <td>
-                        <label>
-                            <input type="checkbox" id="checkAllChannel">
-                            编号(通道列表)
-                        </label>
-                    </td>
-                </tr>
+                    <tr>
+                        <td>
+                            <label>
+                                <input type="checkbox" id="checkAllChannel">
+                                编号(通道列表)
+                            </label>
+                        </td>
+                    </tr>
                 </thead>
                 <tbody id="checkChannelContent">
 
@@ -183,7 +183,7 @@
 
         var provider = <?php echo json_encode($output['providers']) ?>
 
-            let ratios = [];
+        let ratios = [];
 
         let qualitys = [];
 
@@ -343,8 +343,7 @@
             if (filter_wave > 0) {
                 src += '&filter_wave=' + filter_wave;
             }
-            $.get(src, function(data)
-            {
+            $.get(src, function(data) {
                 if (data.state == 'success') {
                     $('#echart').html(`<img src='data:image/png;base64,${data.img}'/>`)
                     ratios = data.ratios;
@@ -363,5 +362,8 @@
 
         $('.querySelect').trigger('change');
         $('#ncsubmit').trigger('click');
+
+        const fixedHeight = $('.fixed-bar').height();
+        $('.fixed-empty').css('cssText', 'height:' + (parseFloat(fixedHeight) + 8) + 'px !important');
     })
-</script>
+</script>

+ 12 - 9
admin/templates/default/analysis.system.php

@@ -128,14 +128,14 @@
     <div class="echartsContent">
         <table id="checkChannel">
             <thead>
-            <tr>
-                <td>
-                    <label>
-                        <input type="checkbox" id="checkAllChannel">
-                        编号(机构列表)
-                    </label>
-                </td>
-            </tr>
+                <tr>
+                    <td>
+                        <label>
+                            <input type="checkbox" id="checkAllChannel">
+                            编号(机构列表)
+                        </label>
+                    </td>
+                </tr>
             </thead>
             <tbody id="checkChannelContent">
 
@@ -356,5 +356,8 @@
         });
 
         $('#ncsubmit').trigger('click');
+
+        const fixedHeight = $('.fixed-bar').height();
+        $('.fixed-empty').css('cssText', 'height:' + (parseFloat(fixedHeight) + 8) + 'px !important');
     })
-</script>
+</script>

+ 2 - 2
admin/templates/default/layout/index_layout.php

@@ -293,7 +293,7 @@
 								<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="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>
@@ -333,4 +333,4 @@
 	}
 </script>
 
-</html>
+</html>

+ 10 - 5
admin/templates/default/merchant.ctl.php

@@ -409,27 +409,32 @@
                             <input name="quality" <?php if ($output['merchant']['quality'] == refill\Quality::SlowNormal) {
                                                         echo 'checked';
                                                     } ?> value="<?php echo refill\Quality::SlowNormal; ?>" type="radio">
-                        </label>慢充一次+普充
+                        </label>慢充一次+普充(<span style="color: red;"><?php echo refill\Quality::SlowNormal; ?></span>)
                         <label>
                             <input name="quality" <?php if ($output['merchant']['quality'] == refill\Quality::ThirdNormal) {
                                                         echo 'checked';
                                                     } ?> value="<?php echo refill\Quality::ThirdNormal; ?>" type="radio">
-                        </label>三方一次+普充
+                        </label>三方一次+普充(<span style="color: red;"><?php echo refill\Quality::ThirdNormal; ?></span>)
                         <label>
                             <input name="quality" <?php if ($output['merchant']['quality'] == refill\Quality::DefSuccess) {
                                                         echo 'checked';
                                                     } ?> value="<?php echo refill\Quality::DefSuccess; ?>" type="radio">
-                        </label>普充+卡密+快充
+                        </label>普充+卡密+快充(<span style="color: red;"><?php echo refill\Quality::DefSuccess; ?></span>)
                         <label>
                             <input name="quality" <?php if ($output['merchant']['quality'] == refill\Quality::NormalQuick) {
                                                         echo 'checked';
                                                     } ?> value="<?php echo refill\Quality::NormalQuick; ?>" type="radio">
-                        </label>普充+快充
+                        </label>普充+快充(<span style="color: red;"><?php echo refill\Quality::NormalQuick; ?></span>)
                         <label>
                             <input name="quality" <?php if ($output['merchant']['quality'] == refill\Quality::SlowSixNormal) {
                                                         echo 'checked';
                                                     } ?> value="<?php echo refill\Quality::SlowSixNormal; ?>" type="radio">
-                        </label>慢充6+普充
+                        </label>慢充6+普充(<span style="color: red;"><?php echo refill\Quality::SlowSixNormal; ?></span>)
+                        <label>
+                            <input name="quality" <?php if ($output['merchant']['quality'] == refill\Quality::NormalCardkey) {
+                                echo 'checked';
+                            } ?> value="<?php echo refill\Quality::NormalCardkey; ?>" type="radio">
+                        </label>普充+卡密(<span style="color: red;"><?php echo refill\Quality::NormalCardkey; ?></span>)
                     </td>
                 </tr>
             </tbody>

+ 181 - 0
admin/templates/default/merchant.fulu.index.php

@@ -0,0 +1,181 @@
+<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;
+    }
+
+    a {
+        color: #0D93BF !important;
+    }
+</style>
+<?php
+
+use refill\LZRefillFactory;
+
+defined('InShopNC') or exit('Access Invalid!'); ?>
+
+<div class="page">
+    <div class="fixed-bar">
+        <div class="item-title">
+            <h3>机构管理</h3>
+            <ul class="tab-base">
+                <li><a href="JavaScript:void(0);" class="current"><span><?php echo $lang['nc_manage'] ?></span></a></li>
+            </ul>
+        </div>
+    </div>
+    <div class="fixed-empty"></div>
+    <form method="get" name="formSearch" id="formSearch">
+        <input type="hidden" value="merchant_fulu" name="act">
+        <input type="hidden" value="merchant" name="op">
+        <table class="tb-type1 noborder search">
+            <tbody>
+                <tr>
+                    <th><label for="merchant_name"><?php echo $lang['merchant_name']; ?></label></th>
+                    <td><input type="text" value="<?php echo $_GET['merchant_name']; ?>" name="merchant_name" id="merchant_name" class="txt"></td>
+                    <td><a href="javascript:void(0);" id="ncsubmit" class="btn-search " title="<?php echo $lang['nc_query']; ?>">&nbsp;</a>
+                        <?php if ($_GET['merchant_name'] != '') { ?>
+                            <a href="index.php?act=merchant_fulu&op=merchant" class="btns " title="<?php echo $lang['nc_cancel_search']; ?>"><span><?php echo $lang['nc_cancel_search']; ?></span></a>
+                        <?php } ?>
+
+                    </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>
+                    <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>
+    <form method="post" id="merchant_name_form">
+        <input type="hidden" name="form_submit" value="ok" />
+
+        <div>
+            <table class="table tb-type2 myTable" width="100%" id="app-gas-content">
+                <thead>
+                    <tr class="thead">
+                        <th class="align-center"><?php echo $lang['merchant_name']; ?>编号</th>
+                        <th class="align-left" style="text-align: left">机构账号</th>
+                        <th class="align-center">会员ID</th>
+                        <th class="align-left">机构公司名称</th>
+                        <th class="align-right">所剩余额</th>
+                        <th class="align-right">充值中金额</th>
+                        <th class="align-right">授信额度</th>
+
+                        <th class="align-right">欠款金额</th>
+                        <th class="align-right">充值中可能成功金额</th>
+
+                        <th class="align-right">预警余额</th>
+                        <th class="align-center">机构状态</th>
+                        <th class="align-left">上次登录ip</th>
+                        <th class="align-left">上次登录日期</th>
+
+                        <th class="align-left">绑定公司名称</th>
+                    </tr>
+                </thead>
+                <div class="table-body">
+                    <tbody id="app-gas-body">
+                        <?php if (!empty($output['merchant_list']) && is_array($output['merchant_list'])) { ?>
+                            <?php foreach ($output['merchant_list'] as $k => $v) { ?>
+                                <tr class="trFlex">
+                                    <td class="align-center"><?php echo $v['mchid']; ?></td>
+                                    <td class="align-left"><?php echo $v['name']; ?></td>
+                                    <td class="align-center"><?php echo $v['admin_id']; ?></td>
+                                    <td class="align-left"><?php echo $v['company_name']; ?></td>
+
+                                    <td id="just" class="align-right">
+                                        <?php if ($v['available_predeposit'] > 0) { ?>
+                                            <span style="color: #0bb20c">
+                                            <?php } ?>
+                                            <?php if ($v['available_predeposit'] < 0) { ?>
+                                                <span style="color: #f30707">
+                                                <?php } ?>
+                                                <?php echo $v['available_predeposit']; ?>
+                                                </span>
+                                    </td>
+                                    <td class="align-right"><?php echo $v['debt']['send_amounts']; ?></td>
+                                    <td class="align-right"><?php echo $v['credit_bonus']; ?></td>
+
+                                    <td class="align-right"><?php echo -1 * number_format($v['debt']['debt'],2,'.',''); ?></td>
+                                    <td class="align-right"><?php echo $v['debt']['lack_amounts']; ?></td>
+
+                                    <td class="align-right"><?php echo $v['alarm_amount']; ?></td>
+                                    <td class="align-center">
+                                        <?php if ($v['merchant_state'] == 1) { ?>
+                                            <span style="color: #0bb20c">
+                                            <?php } ?>
+                                            <?php if ($v['merchant_state'] == 2) { ?>
+                                                <span style="color: #f30707">
+                                                <?php } ?>
+                                                <?php echo $output['merchant_state_text'][$v['merchant_state'] - 1]; ?>
+                                                </span>
+                                    </td>
+                                    <td class="align-left"><?php echo $v['last_login_ip'] ?? $lang['no_limit']; ?></td>
+                                    <td class="nowarp align-left"><?php echo $v['last_login_time'] ? date('Y-m-d H:i', $v['last_login_time']) : $lang['no_limit']; ?></td>
+                                    <td class="align-left"><?php echo $v['co_name']; ?></td>
+                                </tr>
+                            <?php } ?>
+                        <?php } else { ?>
+                            <tr class="no_data">
+                                <td colspan="15"><?php echo $lang['nc_no_record']; ?></td>
+                            </tr>
+                        <?php } ?>
+                    </tbody>
+                </div>
+                <tfoot>
+                    <tr class="tfoot">
+                        <td></td>
+                        <td colspan="16">
+                            <div class="pagination"><?php echo $output['page']; ?></div>
+                        </td>
+                    </tr>
+                </tfoot>
+            </table>
+        </div>
+    </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>
+    $(function() {
+        $('#ncsubmit').click(function() {
+            $('input[name="op"]').val('merchant');
+            $('#formSearch').submit();
+        });
+        // 表格hover时背景
+        $('.trFlex').each(function() {
+            $(this).hover(function() {
+                $(this)[0].style.backgroundColor = '#cbe9f3'
+            }, function() {
+                $(this)[0].style.backgroundColor = '#fff'
+            })
+        })
+        //去空格
+        $('#just span').each(function(index, item) {
+            let text = $.trim($(item).text())
+            $(item).text(text)
+        })
+    });
+</script>

+ 2 - 2
admin/templates/default/merchant.index.php

@@ -189,7 +189,7 @@ defined('InShopNC') or exit('Access Invalid!'); ?>
                             <?php } ?>
                         <?php } else { ?>
                             <tr class="no_data">
-                                <td colspan="15"><?php echo $lang['nc_no_record']; ?></td>
+                                <td colspan="18"><?php echo $lang['nc_no_record']; ?></td>
                             </tr>
                         <?php } ?>
                     </tbody>
@@ -197,7 +197,7 @@ defined('InShopNC') or exit('Access Invalid!'); ?>
                 <tfoot>
                     <tr class="tfoot">
                         <td></td>
-                        <td colspan="16">
+                        <td colspan="18">
                             <div class="pagination"><?php echo $output['page']; ?></div>
                         </td>
                     </tr>

+ 7 - 6
admin/templates/default/merchant.price.php

@@ -105,6 +105,7 @@
 
                 <li><a href="index.php?act=merchant&op=price&quality=<?php echo refill\Quality::DefSuccess; ?>&mchid=<?php echo $_GET['mchid'] ?>" class="classA" data-quality="<?php echo refill\Quality::DefSuccess; ?>"><span>普通+卡密+快充</span></a></li>
                 <li><a href="index.php?act=merchant&op=price&quality=<?php echo refill\Quality::NormalQuick; ?>&mchid=<?php echo $_GET['mchid'] ?>" class="classA" data-quality="<?php echo refill\Quality::NormalQuick; ?>"><span>普通+快充</span></a></li>
+                <li><a href="index.php?act=merchant&op=price&quality=<?php echo refill\Quality::NormalCardkey; ?>&mchid=<?php echo $_GET['mchid'] ?>" class="classA" data-quality="<?php echo refill\Quality::NormalCardkey; ?>"><span>普通+卡密</span></a></li>
 
                 <li><a href="index.php?act=merchant&op=third_merchant_price&mchid=<?php echo $_GET['mchid'] ?>"><span>三方业务通道费率设置</span></a></li>
             </ul>
@@ -200,7 +201,7 @@
                                             <input type="text" name="extra_price[]" class="txt extra_price" value="<?php echo $v['extra_price']; ?>">
                                         </td>
                                         <td class="w150 align-center tdVals">
-                                            <input type="text" name="max_inprice[]" class="txt max_inprice" value="<?php echo $v['max_inprice']; ?>">
+                                            <input type="text" name="max_inprice[]" class="txt max_inprice" value="<?php echo $v['max_inprice']; ?>">
                                         </td>
                                     </tr>
                                 <?php } ?>
@@ -280,7 +281,7 @@
                                         </td>
 
                                         <td class="w150 align-center tdVals">
-                                            <input type="text" name="max_inprice[]" class="txt max_inprice" value="<?php echo $v['max_inprice']; ?>">
+                                            <input type="text" name="max_inprice[]" class="txt max_inprice" value="<?php echo $v['max_inprice']; ?>">
                                         </td>
                                     </tr>
                                 <?php } ?>
@@ -362,7 +363,7 @@
                                         </td>
 
                                         <td class="w150 align-center tdVals">
-                                            <input type="text" name="max_inprice[]" class="txt max_inprice" value="<?php echo $v['max_inprice']; ?>">
+                                            <input type="text" name="max_inprice[]" class="txt max_inprice" value="<?php echo $v['max_inprice']; ?>">
                                         </td>
                                     </tr>
                                 <?php } ?>
@@ -442,7 +443,7 @@
                                         </td>
 
                                         <td class="w150 align-center tdVals">
-                                            <input type="text" name="max_inprice[]" class="txt max_inprice" value="<?php echo $v['max_inprice']; ?>">
+                                            <input type="text" name="max_inprice[]" class="txt max_inprice" value="<?php echo $v['max_inprice']; ?>">
                                         </td>
                                     </tr>
                                 <?php } ?>
@@ -524,7 +525,7 @@
                                         </td>
 
                                         <td class="w150 align-center tdVals">
-                                            <input type="text" name="max_inprice[]" class="txt max_inprice" value="<?php echo $v['max_inprice']; ?>">
+                                            <input type="text" name="max_inprice[]" class="txt max_inprice" value="<?php echo $v['max_inprice']; ?>">
                                         </td>
                                     </tr>
                                 <?php } ?>
@@ -704,4 +705,4 @@
 
 
     });
-</script>
+</script>

+ 194 - 0
admin/templates/default/merchant.ratios.fulu.php

@@ -0,0 +1,194 @@
+<?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;
+    }
+
+    #tablee tbody {
+        display: block;
+        height: 1000px;
+        overflow-y: scroll;
+    }
+
+    #tablee thead,
+    .tbodyd tr {
+        display: table;
+        width: 100%;
+        table-layout: fixed;
+    }
+
+    .w1pre {
+        width: 6% !important;
+    }
+
+    .w1p {
+        width: 3.5% !important;
+
+    }
+
+    #tablee thead {
+        width: calc(100% - 1em)
+    }
+
+    .scrollTable .fixed-bar {
+        top: 115px !important;
+    }
+
+    .tbodyd tr:last-child {
+        margin-bottom: 950px;
+    }
+</style>
+<div class="page">
+    <div class="fixed-bar">
+        <div class="item-title">
+            <h3>成功率监控列表</h3>
+            <ul class="tab-base">
+                <li><a href="JavaScript:void(0);" class="current"><span>成功率统计</span></a></li>
+            </ul>
+        </div>
+    </div>
+    <div class="fixed-empty"></div>
+    <form method="get" name="formSearch" id="formSearch" class="layui-form">
+        <div style="float: right; margin: 0px 69px 0 0">
+            <p>三分钟:移 | 联 | 电(平均成功率/成功单量)</p>
+            <?php if (!empty($output['list']) && is_array($output['list'])) { ?>
+                <p class="align-center" style=" margin: 7px 0">
+                    <?php foreach ($output['stats'] as $stats) { ?>
+                        <?php echo (ncPriceFormat($stats['ratio'] / $stats['count']) * 100) ?? 0; ?>%(<?php echo ncPriceFormat(($stats['success'] / $stats['count'])) ?? 0; ?>)¥
+                    <?php } ?>
+                </p>
+            <?php } else { ?>
+                <p class="align-center" style=" margin: 7px 0">
+                    0%(0)¥ 0%(0)¥ 0%(0)
+                </p>
+            <?php } ?>
+        </div>
+        <table class="tb-type1 noborder search">
+            <tbody>
+                <tr>
+                </tr>
+            </tbody>
+        </table>
+    </form>
+    <form method="post" id="merchant_name_form" class="scrollTable">
+        <input type="hidden" name="form_submit" value="ok" />
+        <div id='scrollTable' class="fixed-bar" style="background: transparent">
+            <table class="table tb-type2" id="tablee">
+                <thead>
+                    <tr class="thead">
+                        <th class="align-center w1p">超时时间(秒)</th>
+                        <th class="align-center w1p">机构编码</th>
+                        <th class="align-center w1p">机构名称</th>
+                        <th class="align-center w10pre">15分钟: 总(成功,失败,总订单数) <br> 移 | 联 | 电 (成功单量)</th>
+                        <th class="align-center w10pre">30分钟</th>
+                        <th class="align-center w10pre">1小时</th>
+                        <th class="align-center w10pre">2小时</th>
+                        <th class="align-center w10pre">当天</th>
+                </thead>
+                <tbody class="tbodyd">
+                    <?php if (!empty($output['list']) && is_array($output['list'])) { ?>
+                        <?php foreach ($output['list'] as $k => $v) { ?>
+                            <tr class="trFlex">
+                                <td class="align-center w1pre"><?php echo $v['time_out']; ?></td>
+                                <td class="align-center w1pre"><?php echo $k; ?></td>
+                                <td class="align-center w1pre"><?php echo $v['company_name']; ?></td>
+                                <td class="align-center">
+                                    <?php if ($v['ratio']['ALL'][900][1] > 0) { ?>
+                                        <?php echo ($v['ratio']['ALL'][900][2] * 100) ?? 0; ?>%(<span style="color: #2d7255; display: inline-block; padding-bottom: 4px;"><?php echo ($v['ratio']['ALL'][900][0]) ?? 0; ?></span>,<span style="color: red;"><?php echo ($v['ratio']['ALL'][900][1] - $v['ratio']['ALL'][900][0]) ?? 0; ?></span> ,<?php echo $v['ratio']['ALL'][900][1]; ?>) <br>
+                                        <?php echo ($v['ratio']['YD'][900][2] * 100) ?? 0; ?>%(<?php echo ($v['ratio']['YD'][900][0]) ?? 0; ?>)¥<?php echo ($v['ratio']['LT'][900][2] * 100) ?? 0; ?>%(<?php echo ($v['ratio']['LT'][900][0]) ?? 0; ?>)¥<?php echo ($v['ratio']['DX'][900][2] * 100) ?? 0; ?>%(<?php echo ($v['ratio']['DX'][900][0]) ?? 0; ?>)
+                                    <?php } else { ?>
+                                        ——
+                                    <?php } ?>
+                                </td>
+                                <td class="align-center">
+                                    <?php if ($v['ratio']['ALL'][1800][1] > 0) { ?>
+                                        <?php echo ($v['ratio']['ALL'][1800][2] * 100) ?? 0; ?>%(<span style="color: #2d7255;display: inline-block; padding-bottom: 4px;"><?php echo ($v['ratio']['ALL'][1800][0]) ?? 0; ?></span>,<span style="color: red;"><?php echo ($v['ratio']['ALL'][1800][1] - $v['ratio']['ALL'][1800][0]) ?? 0; ?></span> ,<?php echo $v['ratio']['ALL'][1800][1]; ?>) <br>
+                                        <?php echo ($v['ratio']['YD'][1800][2] * 100) ?? 0; ?>%(<?php echo ($v['ratio']['YD'][1800][0]) ?? 0; ?>)¥<?php echo ($v['ratio']['LT'][1800][2] * 100) ?? 0; ?>%(<?php echo ($v['ratio']['LT'][1800][0]) ?? 0; ?>)¥<?php echo ($v['ratio']['DX'][1800][2] * 100) ?? 0; ?>%(<?php echo ($v['ratio']['DX'][1800][0]) ?? 0; ?>)
+                                    <?php } else { ?>
+                                        ——
+                                    <?php } ?>
+                                </td>
+                                <td class="align-center">
+                                    <?php if ($v['ratio']['ALL'][3600][1] > 0) { ?>
+                                        <?php echo ($v['ratio']['ALL'][3600][2] * 100) ?? 0; ?>%(<span style="color: #2d7255;display: inline-block; padding-bottom: 4px;"><?php echo ($v['ratio']['ALL'][3600][0]) ?? 0; ?></span>,<span style="color: red;"><?php echo ($v['ratio']['ALL'][3600][1] - $v['ratio']['ALL'][3600][0]) ?? 0; ?></span>,<?php echo $v['ratio']['ALL'][3600][1]; ?>) <br>
+                                        <?php echo ($v['ratio']['YD'][3600][2] * 100) ?? 0; ?>%(<?php echo ($v['ratio']['YD'][3600][0]) ?? 0; ?>)¥<?php echo ($v['ratio']['LT'][3600][2] * 100) ?? 0; ?>%(<?php echo ($v['ratio']['LT'][3600][0]) ?? 0; ?>)¥<?php echo ($v['ratio']['DX'][3600][2] * 100) ?? 0; ?>%(<?php echo ($v['ratio']['DX'][3600][0]) ?? 0; ?>)
+                                    <?php } else { ?>
+                                        ——
+                                    <?php } ?>
+                                </td>
+                                <td class="align-center">
+                                    <?php if ($v['ratio']['ALL'][7200][1] > 0) { ?>
+                                        <?php echo ($v['ratio']['ALL'][7200][2] * 100) ?? 0; ?>%(<span style="color: #2d7255;display: inline-block; padding-bottom: 4px;"><?php echo ($v['ratio']['ALL'][7200][0]) ?? 0; ?></span>,<span style="color: red;"><?php echo ($v['ratio']['ALL'][7200][1] - $v['ratio']['ALL'][7200][0]) ?? 0; ?></span>,<?php echo $v['ratio']['ALL'][7200][1]; ?>) <br>
+                                        <?php echo ($v['ratio']['YD'][7200][2] * 100) ?? 0; ?>%(<?php echo ($v['ratio']['YD'][7200][0]) ?? 0; ?>)¥<?php echo ($v['ratio']['LT'][7200][2] * 100) ?? 0; ?>%(<?php echo ($v['ratio']['LT'][7200][0]) ?? 0; ?>)¥<?php echo ($v['ratio']['DX'][7200][2] * 100) ?? 0; ?>%(<?php echo ($v['ratio']['DX'][7200][0]) ?? 0; ?>)
+                                    <?php } else { ?>
+                                        ——
+                                    <?php } ?>
+                                </td>
+                                <td class="align-center">
+                                    <?php if ($v['ratio']['ALL'][86400][1] > 0) { ?>
+                                        <?php echo ($v['ratio']['ALL'][86400][2] * 100) ?? 0; ?>%(<span style="color: #2d7255;display: inline-block; padding-bottom: 4px;"><?php echo ($v['ratio']['ALL'][86400][0]) ?? 0; ?></span>,<span style="color: red;"><?php echo ($v['ratio']['ALL'][86400][1] - $v['ratio']['ALL'][86400][0]) ?? 0; ?></span>,<?php echo $v['ratio']['ALL'][86400][1]; ?>) <br>
+                                        <?php echo ($v['ratio']['YD'][86400][2] * 100) ?? 0; ?>%(<?php echo ($v['ratio']['YD'][86400][0]) ?? 0; ?>)¥<?php echo ($v['ratio']['LT'][86400][2] * 100) ?? 0; ?>%(<?php echo ($v['ratio']['LT'][86400][0]) ?? 0; ?>)¥<?php echo ($v['ratio']['DX'][86400][2] * 100) ?? 0; ?>%(<?php echo ($v['ratio']['DX'][86400][0]) ?? 0; ?>)
+                                    <?php } else { ?>
+                                        ——
+                                    <?php } ?>
+                                </td>
+                            </tr>
+                        <?php } ?>
+                    <?php } else { ?>
+                        <tr class="no_data">
+                            <td colspan="8"><?php echo $lang['nc_no_record']; ?></td>
+                        </tr>
+                    <?php } ?>
+            </table>
+        </div>
+        <!-- <span style="color: red;font-size: 16px;">移 | 联 | 电</span> -->
+    </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; ?>/layui/layui.js"></script>
+<link rel="stylesheet" type="text/css" href="<?php echo ADMIN_TEMPLATES_URL; ?>/layui/css/layui.css" />
+<script>
+    $(function() {
+        // 日期选择器
+        laydate.render({
+            elem: '#startTime',
+            type: 'datetime'
+        });
+        laydate.render({
+            elem: '#endTime',
+            type: 'datetime'
+        });
+        $('#ncsubmit').click(function() {
+            $('#formSearch').submit();
+        });
+        // 表格hover时背景
+        $('.trFlex').each(function() {
+            $("tbody>tr:odd").css("background-color", "#FEF2E8");
+            $("tbody>tr:even").css("background-color", "#f5f6ff");
+            $(this).hover(function() {
+                $(this)[0].style.backgroundColor = '#cbe9f3'
+            }, function() {
+                $("tbody>tr:odd").css("background-color", "#FEF2E8");
+                $("tbody>tr:even").css("background-color", "#f5f6ff");
+            })
+        })
+
+        const fixedHeight = $('.fixed-bar').height();
+        $('.fixed-empty').css('cssText', 'height:' + (parseFloat(fixedHeight) + 8) + 'px !important');
+    });
+</script>

+ 114 - 101
admin/templates/default/merchant.ratios.php

@@ -1,44 +1,54 @@
 <?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;
+        margin-top: 18px !important;
+        margin-bottom: 10px !important;
+        font-weight: 700 !important;
     }
+
     .tab-base li span {
-        font-size:12px !important;
+        font-size: 12px !important;
     }
+
     .layui-form-select .layui-input {
-        height:26px;
+        height: 26px;
     }
-    input::placeholder{
-        color:#333;
+
+    input::placeholder {
+        color: #333;
     }
+
     #tablee tbody {
-        display:block;
+        display: block;
         height: 1000px;
-        overflow-y:scroll;
+        overflow-y: scroll;
     }
+
     #tablee thead,
     .tbodyd tr {
-        display:table;
-        width:100%;
-        table-layout:fixed;
+        display: table;
+        width: 100%;
+        table-layout: fixed;
     }
+
     .w1pre {
-        width: 6%!important;
+        width: 6% !important;
     }
+
     .w1p {
-        width: 3.5%!important;
+        width: 3.5% !important;
 
     }
+
     #tablee thead {
-        width: calc( 100% - 1em )
+        width: calc(100% - 1em)
     }
+
     .scrollTable .fixed-bar {
-        top: 115px!important;
+        top: 115px !important;
     }
-    .tbodyd tr:last-child   {
+
+    .tbodyd tr:last-child {
         margin-bottom: 950px;
     }
 </style>
@@ -55,7 +65,7 @@
 
                 <li><a href="?index.php&act=refill_analysis&op=index&type=system"><span>机构成功率监控</span></a></li>
                 <li><a href="?index.php&act=refill_analysis&op=new_version&type=system"><span>机构累计成功率监控</span></a></li>
-                <li><a href="JavaScript:void(0);" class="current" ><span>机构成功率统计</span></a></li>
+                <li><a href="JavaScript:void(0);" class="current"><span>机构成功率统计</span></a></li>
                 <li><a href="?index.php&act=refill_analysis&op=new_version&type=mch_order_send"><span>机构单量监控</span></a></li>
             </ul>
         </div>
@@ -67,93 +77,93 @@
         <div style="float: right; margin: 0px 69px 0 0">
             <p>三分钟:移 | 联 | 电(平均成功率/成功单量)</p>
             <?php if (!empty($output['list']) && is_array($output['list'])) { ?>
-                <p class="align-center"style=" margin: 7px 0">
-                    <?php foreach ($output['stats'] as $stats){ ?>
-                        <?php echo (ncPriceFormat($stats['ratio'] / $stats['count']) * 100) ?? 0;?>%(<?php echo ncPriceFormat(($stats['success'] / $stats['count'])) ?? 0;?>)¥
-                    <?php }?>
+                <p class="align-center" style=" margin: 7px 0">
+                    <?php foreach ($output['stats'] as $stats) { ?>
+                        <?php echo (ncPriceFormat($stats['ratio'] / $stats['count']) * 100) ?? 0; ?>%(<?php echo ncPriceFormat(($stats['success'] / $stats['count'])) ?? 0; ?>)¥
+                    <?php } ?>
                 </p>
-            <?php }else{?>
-                <p class="align-center"style=" margin: 7px 0">
+            <?php } else { ?>
+                <p class="align-center" style=" margin: 7px 0">
                     0%(0)¥ 0%(0)¥ 0%(0)
                 </p>
-            <?php }?>
+            <?php } ?>
         </div>
         <table class="tb-type1 noborder search">
             <tbody>
-            <tr>
-            </tr>
+                <tr>
+                </tr>
             </tbody>
         </table>
     </form>
     <form method="post" id="merchant_name_form" class="scrollTable">
-        <input type="hidden" name="form_submit" value="ok"/>
-        <div id='scrollTable' class="fixed-bar"  style="background: transparent">
+        <input type="hidden" name="form_submit" value="ok" />
+        <div id='scrollTable' class="fixed-bar" style="background: transparent">
             <table class="table tb-type2" id="tablee">
                 <thead>
-                <tr class="thead">
-                    <th class="align-center w1p">超时时间(秒)</th>
-                    <th class="align-center w1p">机构编码</th>
-                    <th class="align-center w1p">机构名称</th>
-                    <th class="align-center w10pre">15分钟: 总(成功,失败,总订单数) <br> 移 | 联 | 电 (成功单量)</th>
-                    <th class="align-center w10pre">30分钟</th>
-                    <th class="align-center w10pre">1小时</th>
-                    <th class="align-center w10pre">2小时</th>
-                    <th class="align-center w10pre">当天</th>
+                    <tr class="thead">
+                        <th class="align-center w1p">超时时间(秒)</th>
+                        <th class="align-center w1p">机构编码</th>
+                        <th class="align-center w1p">机构名称</th>
+                        <th class="align-center w10pre">15分钟: 总(成功,失败,总订单数) <br> 移 | 联 | 电 (成功单量)</th>
+                        <th class="align-center w10pre">30分钟</th>
+                        <th class="align-center w10pre">1小时</th>
+                        <th class="align-center w10pre">2小时</th>
+                        <th class="align-center w10pre">当天</th>
                 </thead>
                 <tbody class="tbodyd">
-                <?php if (!empty($output['list']) && is_array($output['list'])) { ?>
-                    <?php foreach ($output['list'] as $k => $v) { ?>
-                        <tr class="trFlex">
-                            <td class="align-center w1pre"><?php echo $v['time_out'];?></td>
-                            <td class="align-center w1pre"><?php echo $k;?></td>
-                            <td class="align-center w1pre"><?php echo $v['company_name'];?></td>
-                            <td class="align-center">
-                                <?php if( $v['ratio']['ALL'][900][1] > 0){?>
-                                    <?php echo ($v['ratio']['ALL'][900][2] * 100) ?? 0;?>%(<span style="color: #2d7255; display: inline-block; padding-bottom: 4px;"><?php echo ($v['ratio']['ALL'][900][0]) ?? 0;?></span>,<span style="color: red;"><?php echo ($v['ratio']['ALL'][900][1] - $v['ratio']['ALL'][900][0]) ?? 0;?></span> ,<?php echo $v['ratio']['ALL'][900][1];?>) <br>
-                                    <?php echo ($v['ratio']['YD'][900][2] * 100) ?? 0;?>%(<?php echo ($v['ratio']['YD'][900][0]) ?? 0;?>)¥<?php echo ($v['ratio']['LT'][900][2] * 100) ?? 0;?>%(<?php echo ($v['ratio']['LT'][900][0]) ?? 0;?>)¥<?php echo ($v['ratio']['DX'][900][2] * 100) ?? 0;?>%(<?php echo ($v['ratio']['DX'][900][0]) ?? 0;?>)
-                                <?php }else{?>
-                                    ——
-                                <?php }?>
-                            </td>
-                            <td class="align-center">
-                                <?php if( $v['ratio']['ALL'][1800][1] > 0){?>
-                                    <?php echo ($v['ratio']['ALL'][1800][2] * 100) ?? 0;?>%(<span style="color: #2d7255;display: inline-block; padding-bottom: 4px;"><?php echo ($v['ratio']['ALL'][1800][0]) ?? 0;?></span>,<span style="color: red;"><?php echo ($v['ratio']['ALL'][1800][1] - $v['ratio']['ALL'][1800][0]) ?? 0;?></span> ,<?php echo $v['ratio']['ALL'][1800][1];?>) <br>
-                                    <?php echo ($v['ratio']['YD'][1800][2] * 100) ?? 0;?>%(<?php echo ($v['ratio']['YD'][1800][0]) ?? 0;?>)¥<?php echo ($v['ratio']['LT'][1800][2] * 100) ?? 0;?>%(<?php echo ($v['ratio']['LT'][1800][0]) ?? 0;?>)¥<?php echo ($v['ratio']['DX'][1800][2] * 100) ?? 0;?>%(<?php echo ($v['ratio']['DX'][1800][0]) ?? 0;?>)
-                                <?php }else{?>
-                                    ——
-                                <?php }?>
-                            </td>
-                            <td class="align-center">
-                                <?php if( $v['ratio']['ALL'][3600][1] > 0){?>
-                                    <?php echo ($v['ratio']['ALL'][3600][2] * 100) ?? 0;?>%(<span style="color: #2d7255;display: inline-block; padding-bottom: 4px;"><?php echo ($v['ratio']['ALL'][3600][0]) ?? 0;?></span>,<span style="color: red;"><?php echo ($v['ratio']['ALL'][3600][1] - $v['ratio']['ALL'][3600][0]) ?? 0;?></span>,<?php echo $v['ratio']['ALL'][3600][1];?>) <br>
-                                    <?php echo ($v['ratio']['YD'][3600][2] * 100) ?? 0;?>%(<?php echo ($v['ratio']['YD'][3600][0]) ?? 0;?>)¥<?php echo ($v['ratio']['LT'][3600][2] * 100) ?? 0;?>%(<?php echo ($v['ratio']['LT'][3600][0]) ?? 0;?>)¥<?php echo ($v['ratio']['DX'][3600][2] * 100) ?? 0;?>%(<?php echo ($v['ratio']['DX'][3600][0]) ?? 0;?>)
-                                <?php }else{?>
-                                    ——
-                                <?php }?>
-                            </td>
-                            <td class="align-center">
-                                <?php if( $v['ratio']['ALL'][7200][1] > 0){?>
-                                    <?php echo ($v['ratio']['ALL'][7200][2] * 100) ?? 0;?>%(<span style="color: #2d7255;display: inline-block; padding-bottom: 4px;"><?php echo ($v['ratio']['ALL'][7200][0]) ?? 0;?></span>,<span style="color: red;"><?php echo ($v['ratio']['ALL'][7200][1] - $v['ratio']['ALL'][7200][0]) ?? 0;?></span>,<?php echo $v['ratio']['ALL'][7200][1];?>) <br>
-                                    <?php echo ($v['ratio']['YD'][7200][2] * 100) ?? 0;?>%(<?php echo ($v['ratio']['YD'][7200][0]) ?? 0;?>)¥<?php echo ($v['ratio']['LT'][7200][2] * 100) ?? 0;?>%(<?php echo ($v['ratio']['LT'][7200][0]) ?? 0;?>)¥<?php echo ($v['ratio']['DX'][7200][2] * 100) ?? 0;?>%(<?php echo ($v['ratio']['DX'][7200][0]) ?? 0;?>)
-                                <?php }else{?>
-                                    ——
-                                <?php }?>
-                            </td>
-                            <td class="align-center">
-                                <?php if( $v['ratio']['ALL'][86400][1] > 0){?>
-                                    <?php echo ($v['ratio']['ALL'][86400][2] * 100) ?? 0;?>%(<span style="color: #2d7255;display: inline-block; padding-bottom: 4px;"><?php echo ($v['ratio']['ALL'][86400][0]) ?? 0;?></span>,<span style="color: red;"><?php echo ($v['ratio']['ALL'][86400][1] - $v['ratio']['ALL'][86400][0]) ?? 0;?></span>,<?php echo $v['ratio']['ALL'][86400][1];?>) <br>
-                                    <?php echo ($v['ratio']['YD'][86400][2] * 100) ?? 0;?>%(<?php echo ($v['ratio']['YD'][86400][0]) ?? 0;?>)¥<?php echo ($v['ratio']['LT'][86400][2] * 100) ?? 0;?>%(<?php echo ($v['ratio']['LT'][86400][0]) ?? 0;?>)¥<?php echo ($v['ratio']['DX'][86400][2] * 100) ?? 0;?>%(<?php echo ($v['ratio']['DX'][86400][0]) ?? 0;?>)
-                                <?php }else{?>
-                                    ——
-                                <?php }?>
-                            </td>
+                    <?php if (!empty($output['list']) && is_array($output['list'])) { ?>
+                        <?php foreach ($output['list'] as $k => $v) { ?>
+                            <tr class="trFlex">
+                                <td class="align-center w1pre"><?php echo $v['time_out']; ?></td>
+                                <td class="align-center w1pre"><?php echo $k; ?></td>
+                                <td class="align-center w1pre"><?php echo $v['company_name']; ?></td>
+                                <td class="align-center">
+                                    <?php if ($v['ratio']['ALL'][900][1] > 0) { ?>
+                                        <?php echo ($v['ratio']['ALL'][900][2] * 100) ?? 0; ?>%(<span style="color: #2d7255; display: inline-block; padding-bottom: 4px;"><?php echo ($v['ratio']['ALL'][900][0]) ?? 0; ?></span>,<span style="color: red;"><?php echo ($v['ratio']['ALL'][900][1] - $v['ratio']['ALL'][900][0]) ?? 0; ?></span> ,<?php echo $v['ratio']['ALL'][900][1]; ?>) <br>
+                                        <?php echo ($v['ratio']['YD'][900][2] * 100) ?? 0; ?>%(<?php echo ($v['ratio']['YD'][900][0]) ?? 0; ?>)¥<?php echo ($v['ratio']['LT'][900][2] * 100) ?? 0; ?>%(<?php echo ($v['ratio']['LT'][900][0]) ?? 0; ?>)¥<?php echo ($v['ratio']['DX'][900][2] * 100) ?? 0; ?>%(<?php echo ($v['ratio']['DX'][900][0]) ?? 0; ?>)
+                                    <?php } else { ?>
+                                        ——
+                                    <?php } ?>
+                                </td>
+                                <td class="align-center">
+                                    <?php if ($v['ratio']['ALL'][1800][1] > 0) { ?>
+                                        <?php echo ($v['ratio']['ALL'][1800][2] * 100) ?? 0; ?>%(<span style="color: #2d7255;display: inline-block; padding-bottom: 4px;"><?php echo ($v['ratio']['ALL'][1800][0]) ?? 0; ?></span>,<span style="color: red;"><?php echo ($v['ratio']['ALL'][1800][1] - $v['ratio']['ALL'][1800][0]) ?? 0; ?></span> ,<?php echo $v['ratio']['ALL'][1800][1]; ?>) <br>
+                                        <?php echo ($v['ratio']['YD'][1800][2] * 100) ?? 0; ?>%(<?php echo ($v['ratio']['YD'][1800][0]) ?? 0; ?>)¥<?php echo ($v['ratio']['LT'][1800][2] * 100) ?? 0; ?>%(<?php echo ($v['ratio']['LT'][1800][0]) ?? 0; ?>)¥<?php echo ($v['ratio']['DX'][1800][2] * 100) ?? 0; ?>%(<?php echo ($v['ratio']['DX'][1800][0]) ?? 0; ?>)
+                                    <?php } else { ?>
+                                        ——
+                                    <?php } ?>
+                                </td>
+                                <td class="align-center">
+                                    <?php if ($v['ratio']['ALL'][3600][1] > 0) { ?>
+                                        <?php echo ($v['ratio']['ALL'][3600][2] * 100) ?? 0; ?>%(<span style="color: #2d7255;display: inline-block; padding-bottom: 4px;"><?php echo ($v['ratio']['ALL'][3600][0]) ?? 0; ?></span>,<span style="color: red;"><?php echo ($v['ratio']['ALL'][3600][1] - $v['ratio']['ALL'][3600][0]) ?? 0; ?></span>,<?php echo $v['ratio']['ALL'][3600][1]; ?>) <br>
+                                        <?php echo ($v['ratio']['YD'][3600][2] * 100) ?? 0; ?>%(<?php echo ($v['ratio']['YD'][3600][0]) ?? 0; ?>)¥<?php echo ($v['ratio']['LT'][3600][2] * 100) ?? 0; ?>%(<?php echo ($v['ratio']['LT'][3600][0]) ?? 0; ?>)¥<?php echo ($v['ratio']['DX'][3600][2] * 100) ?? 0; ?>%(<?php echo ($v['ratio']['DX'][3600][0]) ?? 0; ?>)
+                                    <?php } else { ?>
+                                        ——
+                                    <?php } ?>
+                                </td>
+                                <td class="align-center">
+                                    <?php if ($v['ratio']['ALL'][7200][1] > 0) { ?>
+                                        <?php echo ($v['ratio']['ALL'][7200][2] * 100) ?? 0; ?>%(<span style="color: #2d7255;display: inline-block; padding-bottom: 4px;"><?php echo ($v['ratio']['ALL'][7200][0]) ?? 0; ?></span>,<span style="color: red;"><?php echo ($v['ratio']['ALL'][7200][1] - $v['ratio']['ALL'][7200][0]) ?? 0; ?></span>,<?php echo $v['ratio']['ALL'][7200][1]; ?>) <br>
+                                        <?php echo ($v['ratio']['YD'][7200][2] * 100) ?? 0; ?>%(<?php echo ($v['ratio']['YD'][7200][0]) ?? 0; ?>)¥<?php echo ($v['ratio']['LT'][7200][2] * 100) ?? 0; ?>%(<?php echo ($v['ratio']['LT'][7200][0]) ?? 0; ?>)¥<?php echo ($v['ratio']['DX'][7200][2] * 100) ?? 0; ?>%(<?php echo ($v['ratio']['DX'][7200][0]) ?? 0; ?>)
+                                    <?php } else { ?>
+                                        ——
+                                    <?php } ?>
+                                </td>
+                                <td class="align-center">
+                                    <?php if ($v['ratio']['ALL'][86400][1] > 0) { ?>
+                                        <?php echo ($v['ratio']['ALL'][86400][2] * 100) ?? 0; ?>%(<span style="color: #2d7255;display: inline-block; padding-bottom: 4px;"><?php echo ($v['ratio']['ALL'][86400][0]) ?? 0; ?></span>,<span style="color: red;"><?php echo ($v['ratio']['ALL'][86400][1] - $v['ratio']['ALL'][86400][0]) ?? 0; ?></span>,<?php echo $v['ratio']['ALL'][86400][1]; ?>) <br>
+                                        <?php echo ($v['ratio']['YD'][86400][2] * 100) ?? 0; ?>%(<?php echo ($v['ratio']['YD'][86400][0]) ?? 0; ?>)¥<?php echo ($v['ratio']['LT'][86400][2] * 100) ?? 0; ?>%(<?php echo ($v['ratio']['LT'][86400][0]) ?? 0; ?>)¥<?php echo ($v['ratio']['DX'][86400][2] * 100) ?? 0; ?>%(<?php echo ($v['ratio']['DX'][86400][0]) ?? 0; ?>)
+                                    <?php } else { ?>
+                                        ——
+                                    <?php } ?>
+                                </td>
+                            </tr>
+                        <?php } ?>
+                    <?php } else { ?>
+                        <tr class="no_data">
+                            <td colspan="8"><?php echo $lang['nc_no_record']; ?></td>
                         </tr>
                     <?php } ?>
-                <?php } else { ?>
-                    <tr class="no_data">
-                        <td colspan="8"><?php echo $lang['nc_no_record']; ?></td>
-                    </tr>
-                <?php } ?>
             </table>
         </div>
         <!-- <span style="color: red;font-size: 16px;">移 | 联 | 电</span> -->
@@ -161,10 +171,10 @@
 </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;?>/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 () {
+    $(function() {
         // 日期选择器
         laydate.render({
             elem: '#startTime',
@@ -174,20 +184,23 @@
             elem: '#endTime',
             type: 'datetime'
         });
-        $('#ncsubmit').click(function () {
+        $('#ncsubmit').click(function() {
             $('#formSearch').submit();
         });
         // 表格hover时背景
-        $('.trFlex').each(function () {
-            $("tbody>tr:odd").css("background-color","#FEF2E8");
-            $("tbody>tr:even").css("background-color","#f5f6ff");
-            $(this).hover(function () {
+        $('.trFlex').each(function() {
+            $("tbody>tr:odd").css("background-color", "#FEF2E8");
+            $("tbody>tr:even").css("background-color", "#f5f6ff");
+            $(this).hover(function() {
                 $(this)[0].style.backgroundColor = '#cbe9f3'
-            },function() {
-                $("tbody>tr:odd").css("background-color","#FEF2E8");
-                $("tbody>tr:even").css("background-color","#f5f6ff");
+            }, function() {
+                $("tbody>tr:odd").css("background-color", "#FEF2E8");
+                $("tbody>tr:even").css("background-color", "#f5f6ff");
             })
         })
 
+        const fixedHeight = $('.fixed-bar').height();
+        $('.fixed-empty').css('cssText', 'height:' + (parseFloat(fixedHeight) + 8) + 'px !important');
+
     });
-</script>
+</script>

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

@@ -0,0 +1,393 @@
+<?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="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_fulu" name="act">
+        <input type="hidden" value="index" name="op">
+        <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>
+                </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>统计日期</th>
+                <th>主体名称</th>
+                <th>主体ID</th>
+                <th class="align-right">成功订单数</th>
+                <th class="align-right">成功金额</th>
+                <th class="align-right">下游金额</th>
+                <th class="align-right">充值中数量</th>
+                <th class="align-right">当日结余</th>
+                <th class="align-right">下游成功单量</th>
+                <th class="align-right">下游成功面值</th>
+                <th class="align-right">下游成功扣款金额</th>
+                <th class="align-right">单量误差</th>
+                <th class="align-right">扣款金额误差</th>
+                <th class="align-right">面值误差</th>
+                <th class="align-right">退款</th>
+                <th class="align-left">备注</th>
+                <th class="align-left">匹配状态</th>
+                <th class="align-left">统计日期类型</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['time_text']; ?></td>
+                        <td><?php echo $v['cname']; ?></td>
+                        <td><?php echo $v['cid']; ?></td>
+                        <td class="align-right"><?php echo $v['success_count']; ?></td>
+                        <td class="align-right"><?php echo $v['success_refill_amounts']; ?></td>
+                        <td class="align-right"><?php echo $v['success_mch_amounts']; ?></td>
+                        <td class="align-right">
+                            <?php if($v['send_count'] != 0){?>
+                            <span style="color: #f30707">
+                            <?php }?>
+                            <?php echo $v['send_count']; ?>
+                            </span>
+                        </td>
+                        <td class="align-right"><?php echo $v['available']; ?></td>
+                        <td class="align-right"><?php echo $v['corder_success_count']; ?></td>
+                        <td class="align-right"><?php echo $v['corder_success_refill_amounts']; ?></td>
+                        <td class="align-right"><?php echo $v['corder_success_amounts']; ?></td>
+                        <td class="align-right">
+                            <?php if($v['gap_order_count'] != 0){?>
+                            <span style="color: #f30707">
+                            <?php }?>
+                            <?php echo $v['gap_order_count']; ?>
+                            </span>
+                        </td>
+                        <td class="align-right">
+                            <?php if($v['gap_success_amounts'] != 0){?>
+                            <span style="color: #f30707">
+                            <?php }?>
+                            <?php echo $v['gap_success_amounts']; ?>
+                            </span>
+                        </td>
+                        <td class="align-right">
+                            <?php if($v['gap_success_refill_amounts'] != 0){?>
+                            <span style="color: #f30707">
+                            <?php }?>
+                            <?php echo $v['gap_success_refill_amounts']; ?>
+                            </span>
+                        </td>
+                        <td class="align-right"><?php echo $v['refund']; ?></td>
+                        <td class="align-left"><?php echo $v['remark']; ?></td>
+                        <td class="align-left">
+                            <?php if($v['check_status'] == 1){?>
+                                <span style="color: #0bb20c">匹配</span>
+                            <?php }elseif ($v['check_status'] == 2) {?>
+                                <span style="color: #f30707">不匹配</span>
+                            <?php }else{?>
+                                <span style="color: #fd9d0e">未编辑</span>
+                            <?php }?>
+                        </td>
+                        <td class="align-left"><?php echo $output['order_time_type_text'][$v['order_time_type']]; ?></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 () {
+        $("#ncreload").click(function () {
+            $('input[name="reload"]').val('1');
+            select_set()
+            $('#formSearch').submit();
+        })
+        $('#ncsubmit').click(function () {
+            select_set()
+            $('#formSearch').submit();
+        });
+        function select_set(){
+            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);
+        }
+        // 日期选择器
+        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 time = ''
+                    let head = ''
+                    let admin_name = '<?php echo ADMIN_NAME;?>'
+                    if (admin_name === 'YEZI') {
+                        head = ['北京椰子电子商务有限责任公司']
+                    } else {
+                        head = ['北京椰林网络科技有限责任公司']
+                    }
+                    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=order_search_fulu&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>

+ 1 - 0
admin/templates/default/provider.amount.php

@@ -212,6 +212,7 @@
             oInput.select(); // 选择对象
             document.execCommand("Copy"); // 执行浏览器复制命令
             oInput.parentNode.removeChild(oInput)
+            layer.msg('拷贝成功')
         })
 
     });

+ 8 - 6
admin/templates/default/refill.order.batch.php

@@ -125,8 +125,8 @@
         z-index: 4;
         width: 351px;
         text-align: center;
-        
-     } 
+
+     }
      #hover .fail:hover:after {
         position: absolute;
         left: 520px;
@@ -137,7 +137,7 @@
         z-index: 4;
         width: 351px;
         text-align: center;
-     }    
+     }
        #hover .callback:hover:after {
         position: absolute;
         left: 520px;
@@ -148,7 +148,7 @@
         z-index: 4;
         width: 361px;
         text-align: center;
-     }      
+     }
      #hover .resale:hover:after {
         position: absolute;
         left: 520px;
@@ -159,7 +159,7 @@
         z-index: 4;
         width: 351px;
         text-align: center;
-     } 
+     }
 </style>
 
 <?php defined('InShopNC') or exit('Access Invalid!'); ?>
@@ -450,6 +450,7 @@
                                  <td class="db-center">${item.channel_name}</td>
                                  <td class="db-center">${item.err_msg}</td>
                                  <td class="db-center">${item.close_reason}</td>
+                                 <td class="db-center">${item.quality_text}</td>
                             <tr>`
                     }
                     let content = `<table>
@@ -463,6 +464,7 @@
                                         <th class="db-right">供方名称</th>
                                         <th class="db-right">错误原因(充值)</th>
                                         <th class="db-right">错误原因(订单)</th>
+                                        <th class="db-right">订单质量</th>
                                     </tr>
                                 </thead>
                                 <tbody>${html}</tbody>
@@ -668,4 +670,4 @@
         document.execCommand("Copy"); // 执行浏览器复制命令
         oInput.parentNode.removeChild(oInput)
     }
-</script> 
+</script>

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

@@ -729,6 +729,7 @@
                   <td class="db-center">${item.channel_name}</td>
                   <td class="db-center">${item.err_msg}</td>
                   <td class="db-center">${item.close_reason}</td>
+                  <td class="db-center">${item.quality_text}</td>
               <tr> `
                     }
                     let content = `<table>
@@ -742,6 +743,7 @@
                               <th class="db-right">供方名称</th>
                               <th class="db-right">错误原因(充值)</th>
                               <th class="db-right">错误原因(订单)</th>
+                              <th class="db-right">订单质量</th>
                             </tr>
                     </thead>
                     <tbody>${html}</tbody>

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

@@ -217,7 +217,7 @@
                     <a style="margin-left:15px;" href="javascript:void(0);" id="ncsubmit" class="btn-search "
                        title="<?php echo $lang['nc_query']; ?>">&nbsp;
                     </a>
-                 
+
                 </td>
             </tr>
         </table>
@@ -369,14 +369,14 @@
     </tbody>
         <tfoot>
         <tr class="tfoot">
-         
+
             <td colspan="19" id="dataFuncs">
                 <div class="pagination"> <?php echo $output['show_page']; ?> </div>
             </td>
         </tr>
         </tfoot>
     </table>
-    
+
     <!-- 预警提示 -->
     <audio id="auto" src="<?php echo RESOURCE_SITE_URL; ?>/warning.mp3"></audio>
 </div>
@@ -533,6 +533,7 @@
                         <td class="db-center">${item.channel_name}</td>
                         <td class="db-center">${item.err_msg}</td>
                         <td class="db-center">${item.close_reason}</td>
+                        <td class="db-center">${item.quality_text}</td>
                     <tr>`
                     }
 
@@ -547,6 +548,7 @@
                                         <th class="db-right">供方名称</th>
                                         <th class="db-right">错误原因(充值)</th>
                                         <th class="db-right">错误原因(订单)</th>
+                                        <th class="db-right">订单质量</th>
                                     </tr>
                                 </thead>
                                 <tbody>${html}</tbody>
@@ -704,4 +706,4 @@
         oInput.parentNode.removeChild(oInput)
     }
 
-</script> 
+</script>

+ 6 - 4
admin/templates/default/refill.order.neterr.index.php

@@ -22,15 +22,15 @@
         padding-left: 11px;
         padding-right: 0!important;
     }
-    input::placeholder{ 
-        color:#333; 
+    input::placeholder{
+        color:#333;
     }
     .layui-form-selected dl {
     display: flex!important;
     flex-wrap: wrap!important;
     }
     .layui-form-select dl {
-      
+
         top: 29px !important;
         left: 4px!important;
         min-width: 802%!important;
@@ -351,6 +351,7 @@
                                 <td class="db-center">${item.channel_name}</td>
                                 <td class="db-center">${item.err_msg}</td>
                                 <td class="db-center">${item.close_reason}</td>
+                                <td class="db-center">${item.quality_text}</td>
                              <tr>`
                     }
                     layer.open({
@@ -366,6 +367,7 @@
                                  <th class="db-right">供方名称</th>
                                  <th class="db-right">错误原因(充值)</th>
                                  <th class="db-right">错误原因(订单)</th>
+                                 <th class="db-right">订单质量</th>
                              </tr>
                     </thead>
                              <tbody>
@@ -503,4 +505,4 @@
         document.execCommand("Copy"); // 执行浏览器复制命令
         oInput.parentNode.removeChild(oInput)
     }
-</script> 
+</script>

+ 3 - 1
admin/templates/default/refill.order.notify.err.index.php

@@ -327,6 +327,7 @@
                                 <td class="db-center">${item.channel_name}</td>
                                 <td class="db-center">${item.err_msg}</td>
                                 <td class="db-center">${item.close_reason}</td>
+                                <td class="db-center">${item.quality_text}</td>
                             <tr>
                     `
                 }
@@ -345,6 +346,7 @@
                                  <th class="db-right">供方名称</th>
                                  <th class="db-right">错误原因(充值)</th>
                                  <th class="db-right">错误原因(订单)</th>
+                                 <th class="db-right">订单质量</th>
                              </tr>
                     </thead>
                              <tbody>
@@ -404,4 +406,4 @@
         document.execCommand("Copy"); // 执行浏览器复制命令
         oInput.parentNode.removeChild(oInput)
     }
-</script> 
+</script>

+ 474 - 0
admin/templates/default/refill.order.search.fulu.php

@@ -0,0 +1,474 @@
+<style>
+    th label {
+        display: inline-block;
+        width: 60px;
+        margin-left: 10px;
+    }
+
+    .db-right {
+        padding-right: 134px !important;
+        border-bottom: 1px solid #ccc;
+    }
+
+    .db-center {
+        padding: 9px 0;
+        border-bottom: 1px solid #ccc;
+    }
+
+    .db-top {
+        padding: 0 30px;
+    }
+
+    .page .fixed-bar .item-title h3 {
+        margin-top: 18px !important;
+        margin-bottom: 10px !important;
+        font-weight: 700 !important;
+    }
+
+    .tab-base li span {
+        font-size: 12px !important;
+    }
+
+    .query_ors {
+        width: 125px;
+    }
+
+    th label {
+        display: inline-block;
+        width: 60px;
+    }
+
+    .lineLi {
+        min-width: 150px;
+        font-size: 12px;
+        color: #000;
+    }
+
+    #prompt ul .noLineLi {
+        background: none;
+    }
+
+    #prompt div {
+        display: inline-block;
+        background: none
+    }
+
+    #prompt ul .lineLi {
+        color: #000;
+    }
+
+    #selest_nc {
+        width: 220px
+    }
+
+    tbody {
+        font-size: 12px;
+    }
+
+    .layui-form-select .layui-input {
+        padding: 13px 5px;
+    }
+
+    .layui-form-selected dl {
+        display: flex !important;
+        flex-wrap: wrap !important;
+    }
+
+    .layui-form-select dl {
+
+        top: 29px !important;
+        min-width: 883% !important;
+        max-height: 280px !important;
+        padding: 14px 0 !important;
+        left: -599px !important;
+    }
+
+    .layui-form-select {
+        width: 45%;
+    }
+
+    .layui-select-title {
+        width: 104%;
+    }
+
+    .layui-form-select .layui-input {
+
+        padding-left: 11px;
+    }
+
+    .page .fixed-bar .item-title h3 {
+        margin-top: 18px !important;
+        margin-bottom: 10px !important;
+        font-weight: 700 !important;
+    }
+
+    .tab-base li span {
+        font-size: 12px !important;
+    }
+
+    .layui-form-select .layui-input {
+        height: 26px;
+    }
+
+    input::placeholder {
+        color: #333;
+    }
+
+    .xm-tips {
+        color: #333 !important;
+        font-size: 12px;
+    }
+
+    .layui-form-select dl dd.layui-this {
+        display: none;
+    }
+
+    .layui-form-select dl dd {
+        cursor: pointer;
+        width: 130px;
+    }
+
+    .tb-type1 td select {
+        width: 201px;
+    }
+
+    .tb-type1 td input[type="text"],
+    .tb-type1 td select {
+        margin-right: 4px;
+        margin-left: 0;
+        width: 195px;
+    }
+
+    .layui-form-select .layui-edge {
+        right: -91px !important;
+    }
+</style>
+
+<?php defined('InShopNC') or exit('Access Invalid!'); ?>
+<div class="page">
+    <div class="fixed-bar">
+        <div class="item-title">
+            <h3>订单查询</h3>
+            <ul class="tab-base">
+                <li><a href="JavaScript:void(0);" class="current"><span>订单列表</span></a></li>
+            </ul>
+        </div>
+    </div>
+    <div class="fixed-empty"></div>
+    <form method="get" action="index.php" name="formSearch" id="formSearch">
+        <input type="hidden" name="act" value="order_search_fulu"/>
+        <input type="hidden" name="op" value="index"/>
+        <table class="tb-type1 noborder search">
+            <tr>
+                <th><label for="query_start_time">下单时间</label></th>
+                <td style="width: 327px">
+                    <input class="txt date" type="text" value="<?php echo $_GET['query_start_time']; ?>"
+                           id="startTime" name="query_start_time" autocomplete="off" style="width:120px"/>
+                    <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_state" class="querySelect">
+                        <option value=""><?php echo $lang['nc_please_choose']; ?></option>
+                        <option value="10"
+                                <?php if ($_GET['order_state'] == '10'){ ?>selected<?php } ?>><?php echo $lang['order_state_new']; ?></option>
+                        <option value="20"
+                                <?php if ($_GET['order_state'] == '20'){ ?>selected<?php } ?>><?php echo $lang['order_state_pay']; ?></option>
+                        <option value="30"
+                                <?php if ($_GET['order_state'] == '30'){ ?>selected<?php } ?>><?php echo $lang['order_state_send']; ?></option>
+                        <option value="40"
+                                <?php if ($_GET['order_state'] == '40'){ ?>selected<?php } ?>><?php echo $lang['order_state_success']; ?></option>
+                        <option value="0"
+                                <?php if ($_GET['order_state'] == '0'){ ?>selected<?php } ?>><?php echo $lang['order_state_cancel']; ?></option>
+                    </select>
+                </td>
+
+                <th><label>交易面额</label></th>
+                <td>
+                    <select name="refill_amount" class="querySelect" style="width: 100px;">
+                        <option value=""><?php echo $lang['nc_please_choose']; ?></option>
+                        <option value="10"
+                                <?php if ($_GET['refill_amount'] == '10'){ ?>selected<?php } ?>>10</option>
+                        <option value="20"
+                                <?php if ($_GET['refill_amount'] == '20'){ ?>selected<?php } ?>>20</option>
+                        <option value="30"
+                                <?php if ($_GET['refill_amount'] == '30'){ ?>selected<?php } ?>>30</option>
+                        <option value="50"
+                                <?php if ($_GET['refill_amount'] == '50'){ ?>selected<?php } ?>>50</option>
+                        <option value="100"
+                                <?php if ($_GET['refill_amount'] == '100'){ ?>selected<?php } ?>>100</option>
+                        <option value="200"
+                                <?php if ($_GET['refill_amount'] == '200'){ ?>selected<?php } ?>>200</option>
+                        <option value="300"
+                                <?php if ($_GET['refill_amount'] == '300'){ ?>selected<?php } ?>>300</option>
+                        <option value="500"
+                                <?php if ($_GET['refill_amount'] == '500'){ ?>selected<?php } ?>>500</option>
+                        <option value="1000"
+                                <?php if ($_GET['refill_amount'] == '1000'){ ?>selected<?php } ?>>1000</option>
+                        <option value="2000"
+                                <?php if ($_GET['refill_amount'] == '2000'){ ?>selected<?php } ?>>2000</option>
+                    </select>
+                </td>
+                <th><label class="">客户名称</label></th>
+                <td class="layui-form td_time" style="width: 110px;">
+                    <select name="mchid" class="querySelect" lay-verify="" lay-search>
+                        <option value=""><?php echo $lang['nc_please_choose']; ?></option>
+                        <?php foreach ($output['merchant_list'] as $merchant) { ?>
+                            <option value="<?php echo $merchant['mchid'] ?>"<?php if ($_GET['mchid'] == $merchant['mchid']){ ?>selected<?php } ?>><?php echo $merchant['company_name'] == '' ? $merchant['name'] : $merchant['company_name']; ?></option>
+                        <?php } ?>
+                    </select>
+                </td>
+            </tr>
+            <tr>
+
+                <th><label class="query_ors">订单号(多行查询)</label></th>
+                <td><textarea style="width: 324px;" name="order_sns" id="order_sns" cols="30"
+                              rows="10"><?php echo $_GET['order_sns']; ?></textarea></td>
+                <th><label class="query_ors">充值卡号(多行查询)</label></th>
+                <td><textarea name="card_nos" id="card_nos" cols="30"
+                              rows="10"><?php echo $_GET['card_nos']; ?></textarea></td>
+                <th><label class="query_ors">商家单号(多行查询)</label></th>
+                <td><textarea name="mch_orders" id="mch_orders" cols="30"
+                              rows="10"><?php echo $_GET['mch_orders']; ?></textarea>
+                            </td>
+                <th><label>充值类型</label></th>
+                <td>
+                    <select name="card_type" class="querySelect" style="height: 29px;">
+                        <option value=""><?php echo $lang['nc_please_choose']; ?></option>
+                        <option value="1"
+                                <?php if ($_GET['card_type'] == '1'){ ?>selected<?php } ?>>中石油</option>
+                        <option value="2"
+                                <?php if ($_GET['card_type'] == '2'){ ?>selected<?php } ?>>中石化</option>
+                        <option value="4"
+                                <?php if ($_GET['card_type'] == '4'){ ?>selected<?php } ?>>中国移动</option>
+                        <option value="5"
+                                <?php if ($_GET['card_type'] == '5'){ ?>selected<?php } ?>>中国联通</option>
+                        <option value="6"
+                                <?php if ($_GET['card_type'] == '6'){ ?>selected<?php } ?>>中国电信</option>
+                        <option value="7"
+                                <?php if ($_GET['card_type'] == '7'){ ?>selected<?php } ?>>增值业务</option>
+                    </select>
+                </td>
+                <th><label>耗时</label></th>
+                <td>
+                    <select name="time" class="querySelect" style="width: 100px;">
+                        <option value=""><?php echo $lang['nc_please_choose']; ?></option>
+                        <option value="300"
+                                <?php if ($_GET['time'] == '300'){ ?>selected<?php } ?>>超过5分</option>
+                        <option value="600"
+                                <?php if ($_GET['time'] == '600'){ ?>selected<?php } ?>>超过10分</option>
+                        <option value="1800"
+                                <?php if ($_GET['time'] == '1800'){ ?>selected<?php } ?>>超过30分</option>
+                        <option value="3600"
+                                <?php if ($_GET['time'] == '3600'){ ?>selected<?php } ?>>超过60分</option>=
+                    </select>
+                </td>
+                <td>
+                    <a href="javascript:void(0);" id="ncsubmit" class="btn-search "
+                       title="<?php echo $lang['nc_query']; ?>">&nbsp;
+                    </a>
+                </td>
+            </tr>
+            <tr>
+                <td></td>
+                <td>
+                    <a href="#" class="btns" onclick="hCopyCardNo(event)">
+                        <span><i class="icon-edit"></i>拷贝充值卡号</span>
+                    </a>
+                    <a href="#" class="btns" onclick="hCopyOrder(event)">
+                        <span><i class="icon-edit"></i>拷贝订单号</span>
+                    </a>
+                </td>
+                <td>
+                    <a href="#" class="btns" onclick="hCopyMchOrder(event)">
+                        <span><i class="icon-edit"></i>拷贝商家单号</span>
+                    </a>
+                </td>
+            </tr>
+        </table>
+    </form>
+
+    <table class="table tb-type2 nobdb">
+        <thead>
+        <tr class="thead">
+            <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-right">下单日期</th>
+            <th class="align-right">耗时</th>
+            <th class="align-center">订单状态</th>
+            <th class="align-center">运营商流水号</th>
+            <th class="align-center">通道质量</th>
+            <th class="align-center">失败原因</th>
+            <th class="align-center">商家单号</th>
+            <th class="align-center">扣款金额</th>
+        </tr>
+        </thead>
+        <tbody id="tbody">
+        <?php if (count($output['order_list']) > 0) { ?>
+            <?php
+            foreach ($output['order_list'] as $key => $order) { ?>
+                <tr class="hover trFlex">
+                    <td class="align-center"><?php echo $key + 1; ?></td>
+                    <td class="align-center"><?php echo $order['mchid']; ?></td>
+                    <td class="align-center"><?php echo $order['mch_name']; ?></td>
+                    <td class="align-left"><?php echo $order['order_sn']; ?></td>
+                    <td class="align-left"><?php echo $order['card_no']; ?></td>
+                    <td class="align-center"><?php echo $order['card_type_text']; ?></td>
+                    <td class="align-center"><?php echo $order['refill_amount']; ?></td>
+                    <td class="align-right">
+                        <?php echo date('Y-m-d H:i:s', $order['order_time']); ?>
+                    </td>
+                    <td class="align-right">
+                        <?php if (empty($order['notify_time'])) {
+                            if ($order['diff_time'] >= 1800 && $order['diff_time'] <= 3600) {
+                                ?>
+                                <span style="color: #fd9d0e"><?php echo $order['diff_time_text'] ?></span>
+                            <?php } elseif ($order['diff_time'] > 3600) { ?>
+                                <span style="color: #f30707"><?php echo $order['diff_time_text'] ?></span>
+                            <?php } else {
+                                ?>
+                                <?php echo $order['diff_time_text'] ?>
+                            <?php } ?>
+                        <?php } else { ?>
+                            <?php echo $order['diff_time_text'] ?>
+                        <?php } ?>
+                    </td>
+                    <td class="align-center"><?php echo orderState($order); ?></td>
+                    <td class="align-left"><?php echo $order['official_sn']; ?></td>
+                    <td class="align-left"><?php echo $order['quality_text']; ?></td>
+                    <td class="align-left"><?php echo $order['err_msg']; ?></td>
+                    <td class="align-left"><?php echo $order['mch_order']; ?></td>
+                    <td class="align-center"><?php echo $order['mch_amount']; ?></td>
+                </tr>
+            <?php } ?>
+        <?php } else { ?>
+            <tr class="no_data">
+                <td colspan="18"><?php echo $lang['nc_no_record']; ?></td>
+            </tr>
+        <?php } ?>
+        </tbody>
+        <tfoot>
+        <tr class="tfoot">
+            <td colspan="18" id="dataFuncs">
+                <div class="pagination"> <?php echo $output['show_page']; ?> </div>
+            </td>
+        </tr>
+        </tfoot>
+    </table>
+    <!-- 预警提示 -->
+    <audio id="auto" src="<?php echo RESOURCE_SITE_URL; ?>/warning.mp3"></audio>
+</div>
+<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/laydate/laydate.js"></script>
+<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/js/jquery-ui/jquery.ui.js"></script>
+<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/js/jquery-ui/i18n/zh-CN.js"
+        charset="utf-8"></script>
+<link rel="stylesheet" type="text/css"
+      href="<?php echo RESOURCE_SITE_URL; ?>/js/jquery-ui/themes/ui-lightness/jquery.ui.css"/>
+<script type="text/javascript" src="<?php echo ADMIN_TEMPLATES_URL; ?>/layui/layui.js"></script>
+<link rel="stylesheet" type="text/css" href="<?php echo ADMIN_TEMPLATES_URL; ?>/layui/css/layui.css"/>
+<script type="text/javascript">
+    $(function () {
+        $('#ncsubmit').click(function () {
+            $('#formSearch').submit();
+        });
+        $('#query_start_time').datepicker({dateFormat: 'yy-mm-dd'});
+        $('#query_end_time').datepicker({dateFormat: 'yy-mm-dd'});
+        // 日期选择器
+        laydate.render({
+            elem: '#startTime',
+            type: 'datetime'
+        });
+        laydate.render({
+            elem: '#endTime',
+            type: 'datetime'
+        });
+        //过滤
+        $("#card_nos").blur(function () {
+            let test_mch = $("#card_nos").val();
+            let result = test_mch.replace(/[\  \r\n\,]+/g, ",");
+            $(this).val(result)
+        })
+        $("#mch_orders").blur(function () {
+            let test_mch = $("#mch_orders").val();
+            let result = test_mch.replace(/[\  \r\n\,]+/g, ",");
+            $(this).val(result)
+        })
+        $("#order_sns").blur(function () {
+            let test_mch = $("#order_sns").val();
+            let result = test_mch.replace(/[\  \r\n\,]+/g, ",");
+            $(this).val(result)
+        })
+        // 表格hover时背景
+        $('.trFlex').each(function () {
+            $(this).hover(function () {
+                $(this)[0].style.backgroundColor = '#cbe9f3'
+            }, function () {
+                $(this)[0].style.backgroundColor = '#fff'
+            })
+        })
+        // 供方名称颜色
+        $('.textColor').each(function () {
+            let color = $(this).attr('data-color')
+            if (color == '1') {
+                $(this).css('color', 'green')
+            } else {
+                $(this).css('color', 'red')
+            }
+        })
+    });
+
+    function hCopyCardNo(e) {
+        let str = ''
+        $('#tbody tr').each(function () {
+            let card_no = $(this).find('td').eq(4).text()
+            str += card_no + '\n'
+        })
+        let oInput = document.createElement("textarea");
+        oInput.style.border = "0 none";
+        oInput.style.color = "transparent";
+        oInput.value = str;
+        document.body.appendChild(oInput);
+        oInput.select(); // 选择对象
+        document.execCommand("Copy"); // 执行浏览器复制命令
+        oInput.parentNode.removeChild(oInput)
+    }
+
+    function hCopyOrder(e) {
+        let str = ''
+        $('#tbody tr').each(function () {
+            let order = $(this).find('td').eq(3).text()
+            str += order + '\n'
+        })
+        let oInput = document.createElement("textarea");
+        oInput.style.border = "0 none";
+        oInput.style.color = "transparent";
+        oInput.value = str;
+        document.body.appendChild(oInput);
+        oInput.select(); // 选择对象
+        document.execCommand("Copy"); // 执行浏览器复制命令
+        oInput.parentNode.removeChild(oInput)
+    }
+
+    function hCopyMchOrder(e) {
+        let str = ''
+        $('#tbody tr').each(function () {
+            let res = $(this).find('td').eq(13).text()
+            str += res + '\n'
+        })
+        let oInput = document.createElement("textarea");
+        oInput.style.border = "0 none";
+        oInput.style.color = "transparent";
+        oInput.value = str;
+        document.body.appendChild(oInput);
+        oInput.select(); // 选择对象
+        document.execCommand("Copy"); // 执行浏览器复制命令
+        oInput.parentNode.removeChild(oInput)
+    }
+</script>

+ 3 - 1
admin/templates/default/refill.order.search.php

@@ -429,6 +429,7 @@
                                  <td class="db-center">${item.channel_name}</td>
                                  <td class="db-center">${item.err_msg}</td>
                                  <td class="db-center">${item.close_reason}</td>
+                                 <td class="db-center">${item.quality_text}</td>
                             <tr>`
                     }
                     let content = `<table>
@@ -442,6 +443,7 @@
                                         <th class="db-right">供方名称</th>
                                         <th class="db-right">错误原因(充值)</th>
                                         <th class="db-right">错误原因(订单)</th>
+                                        <th class="db-right">订单质量</th>
                                     </tr>
                                 </thead>
                                 <tbody>${html}</tbody>
@@ -537,4 +539,4 @@
         document.execCommand("Copy"); // 执行浏览器复制命令
         oInput.parentNode.removeChild(oInput)
     }
-</script> 
+</script>

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

@@ -21,8 +21,8 @@
         padding-left: 11px;
         padding-right: 0!important;
     }
-    input::placeholder{ 
-        color:#333; 
+    input::placeholder{
+        color:#333;
     }
     .layui-form-selected dl {
         display: flex!important;
@@ -442,7 +442,7 @@
                 data = JSON.parse(data)
                 if (data.state == 1) {
                 let order_item = data.data
-                let html = ''; 
+                let html = '';
                 for (let i = 0; i < order_item.length; i++) {
                     var item = order_item[i];
                     html += `
@@ -455,6 +455,7 @@
                         <td class="db-center">${item.channel_name}</td>
                         <td class="db-center">${item.err_msg}</td>
                         <td class="db-center">${item.close_reason}</td>
+                        <td class="db-center">${item.quality_text}</td>
                     <tr>`
                 }
 
@@ -469,6 +470,7 @@
                                         <th class="db-right">供方名称</th>
                                         <th class="db-right">错误原因(充值)</th>
                                         <th class="db-right">错误原因(订单)</th>
+                                        <th class="db-right">订单质量</th>
                                     </tr>
                                 </thead>
                                 <tbody>${html}</tbody>
@@ -697,4 +699,4 @@
         document.execCommand("Copy"); // 执行浏览器复制命令
         oInput.parentNode.removeChild(oInput)
     }
-</script> 
+</script>

+ 214 - 0
admin/templates/default/refill_tax.merchant.php

@@ -0,0 +1,214 @@
+<?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=refill_tax_stats&op=index&tax_type=provider"><span>上游对账记录</span></a></li>
+                <li><a href="index.php?act=refill_tax_stats&op=index&tax_type=merchant"><span>下游对账记录</span></a></li>
+                <li><a href="index.php?act=refill_tax_stats&op=refill_tax_subject&tax_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="refill_tax_stats" name="act">
+        <input type="hidden" value="refill_tax_subject" name="op">
+        <input type="hidden" value="merchant" name="tax_type">
+        <input type="hidden" name="cids" value=""/>
+        <input type="hidden" name="default_cids" value="<?php echo $_GET['cids']; ?>"/>
+        <table class="tb-type1 noborder search">
+            <tbody>
+            <tr>
+                <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>
+                </td>
+            </tr>
+            </tbody>
+        </table>
+        <table class="tb-type1 noborder search">
+            <tr>
+                <td>
+                    <a href="#" class="btns"  id="hSet">
+                        <span><i class="icon-edit"></i>批量设置</span>
+                    </a>
+                </td>
+            </tr>
+        </table>
+    </form>
+    <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-center" id="selectAll">
+                    <input type="checkbox" name="chbox" value="">
+                </th>
+                <th>机构编号</th>
+                <th>机构账号</th>
+                <th>机构公司名称</th>
+            </tr>
+            </thead>
+            <tbody>
+            <?php if (!empty($output['list']) && is_array($output['list'])) { ?>
+                <?php foreach ($output['list'] as $k => $v) { ?>
+                    <tr class="trFlex">
+                        <td class="align-center">
+                            <input type="checkbox" id="checkBoxList" name="checkbox" value="<?php echo $v['mchid'];?>"
+                                <?php if(in_array($v['mchid'], $output['cache_cids'])) { echo 'checked'; }?>
+                            >
+                        </td>
+                        <td><?php echo $v['mchid']; ?></td>
+                        <td><?php echo $v['name']; ?></td>
+                        <td><?php echo $v['company_name']; ?></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/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 () {
+            select_set()
+            $('#formSearch').submit();
+        });
+        function select_set(){
+            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="cids"]').val(selectStr);
+        }
+
+        //全选
+        $('#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;
+                })
+            }
+        })
+
+        // 表格hover时背景
+        $('.trFlex').each(function () {
+            $(this).hover(function () {
+                $(this)[0].style.backgroundColor = '#cbe9f3'
+            },function() {
+                $(this)[0].style.backgroundColor = '#fff'
+            })
+        })
+        //多选
+        let selest_nc
+        let default_cids = $('input[name="default_cids"]').val().split(',');
+        $.get('index.php?act=refill_order&op=merchant_data', function (data) {
+            data = JSON.parse(data)
+            if (default_cids) {
+                for (let index = 0; index < default_cids.length; index++) {
+                    for (let j = 0; j < data.length; j++) {
+                        if (default_cids[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: '500px'
+                },
+                language: 'zn',
+                data: data
+            })
+        })
+
+        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(",")
+        }
+
+        //批量设置
+        $('#hSet').click(function () {
+            layer.confirm('您确定要设置为带票机构吗', {
+                btn: ['确定', '取消'],
+                title: '设置带票通道'
+            }, function () {
+                const cids = get_sel_id();
+                window.location.href = `index.php?act=refill_tax_stats&op=subject_set&tax_type=merchant&cids= ${cids ? cids : ''}`
+            }, function () {
+                layer.msg('取消成功')
+            });
+        })
+    });
+</script>

+ 214 - 0
admin/templates/default/refill_tax.provider.php

@@ -0,0 +1,214 @@
+<?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=refill_tax_stats&op=index&tax_type=provider"><span>上游对账记录</span></a></li>
+                <li><a href="index.php?act=refill_tax_stats&op=index&tax_type=merchant"><span>下游对账记录</span></a></li>
+                <li><a href="JavaScript:void(0);" class="current"><span>上游带票控制</span></a></li>
+                <li><a href="index.php?act=refill_tax_stats&op=refill_tax_subject&tax_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="refill_tax_stats" name="act">
+        <input type="hidden" value="refill_tax_subject" name="op">
+        <input type="hidden" value="provider" name="tax_type">
+        <input type="hidden" name="cids" value=""/>
+        <input type="hidden" name="default_cids" value="<?php echo $_GET['cids']; ?>"/>
+        <table class="tb-type1 noborder search">
+            <tbody>
+            <tr>
+                <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>
+                </td>
+            </tr>
+            </tbody>
+        </table>
+        <table class="tb-type1 noborder search">
+            <tr>
+                <td>
+                    <a href="#" class="btns"  id="hSet">
+                        <span><i class="icon-edit"></i>批量设置</span>
+                    </a>
+                </td>
+            </tr>
+        </table>
+    </form>
+    <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-center" id="selectAll">
+                    <input type="checkbox" name="chbox" value="">
+                </th>
+                <th>通道Id</th>
+                <th>通道名称</th>
+                <th>店铺ID</th>
+            </tr>
+            </thead>
+            <tbody>
+            <?php if (!empty($output['list']) && is_array($output['list'])) { ?>
+                <?php foreach ($output['list'] as $k => $v) { ?>
+                    <tr class="trFlex">
+                        <td class="align-center">
+                            <input type="checkbox" id="checkBoxList" name="checkbox" value="<?php echo $v['store_id'];?>"
+                                <?php if(in_array($v['store_id'], $output['cache_cids'])) { echo 'checked'; }?>
+                            >
+                        </td>
+                        <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>
+                    </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/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 () {
+            select_set()
+            $('#formSearch').submit();
+        });
+        function select_set(){
+            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="cids"]').val(selectStr);
+        }
+
+        //全选
+        $('#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;
+                })
+            }
+        })
+
+        // 表格hover时背景
+        $('.trFlex').each(function () {
+            $(this).hover(function () {
+                $(this)[0].style.backgroundColor = '#cbe9f3'
+            },function() {
+                $(this)[0].style.backgroundColor = '#fff'
+            })
+        })
+        //多选
+        let selest_nc
+        let default_cids = $('input[name="default_cids"]').val().split(',');
+        $.get('index.php?act=refill_order&op=provider_data', function (data) {
+            data = JSON.parse(data)
+            if (default_cids) {
+                for (let index = 0; index < default_cids.length; index++) {
+                    for (let j = 0; j < data.length; j++) {
+                        if (default_cids[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: '500px'
+                },
+                language: 'zn',
+                data: data
+            })
+        })
+
+        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(",")
+        }
+
+        //批量设置
+        $('#hSet').click(function () {
+            layer.confirm('您确定要设置为带票通道吗', {
+                btn: ['确定', '取消'],
+                title: '设置带票通道'
+            }, function () {
+                const cids = get_sel_id();
+                window.location.href = `index.php?act=refill_tax_stats&op=subject_set&tax_type=provider&cids= ${cids ? cids : ''}`
+            }, function () {
+                layer.msg('取消成功')
+            });
+        })
+    });
+</script>

+ 349 - 0
admin/templates/default/refill_tax.stats.merchant.php

@@ -0,0 +1,349 @@
+<?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=refill_tax_stats&op=index&tax_type=provider"><span>上游对账记录</span></a></li>
+                <li><a href="JavaScript:void(0);" class="current"><span>下游对账记录</span></a></li>
+                <li><a href="index.php?act=refill_tax_stats&op=refill_tax_subject&tax_type=provider"><span>上游带票控制</span></a></li>
+                <li><a href="index.php?act=refill_tax_stats&op=refill_tax_subject&tax_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="refill_tax_stats" name="act">
+        <input type="hidden" value="index" name="op">
+        <input type="hidden" value="merchant" name="tax_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>
+                </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>统计日期</th>
+                <th>主体名称</th>
+                <th>主体ID</th>
+                <th class="align-right">成功订单数</th>
+                <th class="align-right">成功金额</th>
+                <th class="align-right">下游金额</th>
+                <th class="align-right">充值中数量</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['time_text']; ?></td>
+                        <td><?php echo $v['cname']; ?></td>
+                        <td><?php echo $v['cid']; ?></td>
+                        <td class="align-right"><?php echo $v['success_count']; ?></td>
+                        <td class="align-right"><?php echo $v['success_refill_amounts']; ?></td>
+                        <td class="align-right"><?php echo $v['success_mch_amounts']; ?></td>
+                        <td class="align-right">
+                            <?php if($v['send_count'] != 0){?>
+                            <span style="color: #f30707">
+                            <?php }?>
+                            <?php echo $v['send_count']; ?>
+                            </span>
+                        </td>
+                        <td class="align-left"><?php echo $output['order_time_type_text'][$v['order_time_type']]; ?></td>
+                        <td class="align-center w200">
+                        </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 () {
+        $("#ncreload").click(function () {
+            $('input[name="reload"]').val('1');
+            select_set()
+            $('#formSearch').submit();
+        })
+        $('#ncsubmit').click(function () {
+            select_set()
+            $('#formSearch').submit();
+        });
+        function select_set(){
+            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);
+        }
+        // 日期选择器
+        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 time = ''
+                    let head = ''
+                    let admin_name = '<?php echo ADMIN_NAME;?>'
+                    if (admin_name === 'YEZI') {
+                        head = ['北京椰子电子商务有限责任公司']
+                    } else {
+                        head = ['北京椰林网络科技有限责任公司']
+                    }
+                    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_tax_stats&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>

+ 238 - 0
admin/templates/default/refill_tax.stats.provider.php

@@ -0,0 +1,238 @@
+<?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="JavaScript:void(0);" class="current"><span>上游对账记录</span></a></li>
+                <li><a href="index.php?act=refill_tax_stats&op=index&tax_type=merchant"><span>下游对账记录</span></a></li>
+                <li><a href="index.php?act=refill_tax_stats&op=refill_tax_subject&tax_type=provider"><span>上游带票控制</span></a></li>
+                <li><a href="index.php?act=refill_tax_stats&op=refill_tax_subject&tax_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="refill_tax_stats" name="act">
+        <input type="hidden" value="index" name="op">
+        <input type="hidden" value="provider" name="tax_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>
+                </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>统计日期</th>
+                <th>主体名称</th>
+                <th>主体ID</th>
+                <th class="align-right">成功订单数</th>
+                <th class="align-right">成功金额</th>
+                <th class="align-right">上游金额</th>
+                <th class="align-right">充值中数量</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['time_text']; ?></td>
+                        <td><?php echo $v['cname']; ?></td>
+                        <td><?php echo $v['cid']; ?></td>
+                        <td class="align-right"><?php echo $v['success_count']; ?></td>
+                        <td class="align-right"><?php echo $v['success_refill_amounts']; ?></td>
+                        <td class="align-right"><?php echo $v['success_channel_amounts']; ?></td>
+                        <td class="align-right">
+                            <?php if($v['send_count'] != 0){?>
+                            <span style="color: #f30707">
+                            <?php }?>
+                            <?php echo $v['send_count']; ?>
+                            </span>
+                        </td>
+                        <td class="align-left"><?php echo $output['order_time_type_text'][$v['order_time_type']]; ?></td>
+                        <td class="align-center w200">
+                        </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/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 () {
+        $("#ncreload").click(function () {
+            $('input[name="reload"]').val('1');
+            select_set()
+            $('#formSearch').submit();
+        })
+        $('#ncsubmit').click(function () {
+            select_set()
+            $('#formSearch').submit();
+        });
+        function select_set(){
+            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);
+        }
+        // 日期选择器
+        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'
+            })
+        })
+
+        //多选
+        let selest_nc
+        let default_no_mch = $('input[name="default_no_mch"]').val().split(',');
+        $.get('index.php?act=refill_tax_stats&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>

+ 3 - 1
admin/templates/default/transfer.order.recharge.php

@@ -439,6 +439,7 @@
                   <td class="db-center">${item.channel_name}</td>
                   <td class="db-center">${item.err_msg}</td>
                   <td class="db-center">${item.close_reason}</td>
+                  <td class="db-center">${item.quality_text}</td>
               <tr> `
                     }
                     let content = `<table>
@@ -452,6 +453,7 @@
                               <th class="db-right">供方名称</th>
                               <th class="db-right">错误原因(充值)</th>
                               <th class="db-right">错误原因(订单)</th>
+                              <th class="db-right">订单质量</th>
                             </tr>
                     </thead>
                     <tbody>${html}</tbody>
@@ -477,4 +479,4 @@
             })
         })
     });
-</script>
+</script>

+ 6 - 0
data/config/win/base.ini.php

@@ -121,3 +121,9 @@ $config['refill_specs'] = [
     'chinaunicom'   => [10 , 20 , 30 , 50 , 100 , 200 , 500 , 1000],
     'chinatelecom'  => [10 , 20 , 30 , 50 , 100 , 200 , 500 , 1000]
 ];
+
+$config['fulu_mchid'] = [
+    10300,10319,10294,10305,10320,10327,10299,10216,10306,10211,10265,10304,10308,10307,10311,10309,10318,10232,10213,10202,10215,
+    10325,10260,10239,10237,10277,10251,10317,10324,10323,10322,10301,10303,10326,10280,10314,10315,10214,10256,10249,10258,10295,
+    10285,10286,10230,10282,10255,10291,10275,10254,10276,
+];

+ 6 - 1
data/config/xyz/base.ini.php

@@ -115,4 +115,9 @@ $config['wsd_bradge_port'] = 60987;
 $config['card_key_stores'] = [6];
 
 $config['phone_life_check'] = true;
-$config['admin_layout_skin'] = 'skin_0';
+$config['admin_layout_skin'] = 'skin_0';
+$config['fulu_mchid'] = [
+    10300,10319,10294,10305,10320,10327,10299,10216,10306,10211,10265,10304,10308,10307,10311,10309,10318,10232,10213,10202,10215,
+    10325,10260,10239,10237,10277,10251,10317,10324,10323,10322,10301,10303,10326,10280,10314,10315,10214,10256,10249,10258,10295,
+    10285,10286,10230,10282,10255,10291,10275,10254,10276,10328,10329
+];

+ 596 - 156
data/config/xyz/refill.ini.php

@@ -4113,27 +4113,31 @@ $cangxin_phone = ['name' => 'cangxin', 'store_id' => 174, 'qualitys' => '1',
 
 $cangxin_high_phone = ['name' => 'cangxin_high', 'store_id' => 175, 'qualitys' => '1',
     'amount' => [
-//        10 => [['goods_id' => 7480, 'price' => 9.55, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-//        20 => [['goods_id' => 7481, 'price' => 19.1, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        10 => [
+            ['goods_id' => 7480, 'price' => 9.75, 'quality' => 1, 'card_type' => 'chinamobile']
+        ],
+        20 => [
+            ['goods_id' => 7481, 'price' => 19.5, 'quality' => 1, 'card_type' => 'chinamobile']
+        ],
         30 => [
-            ['goods_id' => 7482, 'price' => 28.92, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 7482, 'price' => 28.8, 'quality' => 1, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 7482, 'price' => 28.8, 'quality' => 1, 'card_type' => 'chinatelecom'],
+            ['goods_id' => 7482, 'price' => 29.1, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 7482, 'price' => 28.2, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7482, 'price' => 28.86, 'quality' => 1, 'card_type' => 'chinatelecom'],
         ],
         50 => [
-            ['goods_id' => 7483, 'price' => 48.2, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 7483, 'price' => 48, 'quality' => 1, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 7483, 'price' => 48, 'quality' => 1, 'card_type' => 'chinatelecom'],
+            ['goods_id' => 7483, 'price' => 48.5, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 7483, 'price' => 47, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7483, 'price' => 48.1, 'quality' => 1, 'card_type' => 'chinatelecom'],
         ],
         100 => [
-            ['goods_id' => 7484, 'price' => 96.4, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 7484, 'price' => 96, 'quality' => 1, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 7484, 'price' => 96, 'quality' => 1, 'card_type' => 'chinatelecom'],
+            ['goods_id' => 7484, 'price' => 97, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 7484, 'price' => 94, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7484, 'price' => 96.2, 'quality' => 1, 'card_type' => 'chinatelecom'],
         ],
         200 => [
-            ['goods_id' => 7485, 'price' => 192.8, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 7485, 'price' => 192, 'quality' => 1, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 7485, 'price' => 192, 'quality' => 1, 'card_type' => 'chinatelecom'],
+            ['goods_id' => 7485, 'price' => 194, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 7485, 'price' => 188, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7485, 'price' => 192.4, 'quality' => 1, 'card_type' => 'chinatelecom'],
         ],
 //        300 => [['goods_id' => 7486, 'price' => 286.5, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
 //        500 => [['goods_id' => 7487, 'price' => 477.5, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']]
@@ -4284,34 +4288,34 @@ $youhenew_phone = ['name' => 'youhenew', 'store_id' => 179,'qualitys' => '1',
         ],
         20 => [
             ['goods_id' => 7513, 'price' => 19.5, 'quality' => 1, 'card_type' => 'chinamobile'],
-//            ['goods_id' => 7513, 'price' => 19.06, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7513, 'price' => 19.06, 'quality' => 1, 'card_type' => 'chinaunicom'],
 //            ['goods_id' => 7513, 'price' => 19.06, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         30 => [
-            ['goods_id' => 7514, 'price' => 28.86, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 7514, 'price' => 28.95, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 7514, 'price' => 28.14, 'quality' => 1, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 7514, 'price' => 28.71, 'quality' => 1, 'card_type' => 'chinatelecom']
+//            ['goods_id' => 7514, 'price' => 28.71, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         50 => [
-            ['goods_id' => 7515, 'price' => 48.1, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 7515, 'price' => 48.25, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 7515, 'price' => 46.9, 'quality' => 1, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 7515, 'price' => 48.75, 'quality' => 1, 'card_type' => 'chinatelecom']
+            ['goods_id' => 7515, 'price' => 48.25, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         100 => [
-            ['goods_id' => 7516, 'price' => 96.2, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 7516, 'price' => 96.5, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 7516, 'price' => 93.8, 'quality' => 1, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 7516, 'price' => 97.5, 'quality' => 1, 'card_type' => 'chinatelecom']
+            ['goods_id' => 7516, 'price' => 96.5, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         200 => [
-            ['goods_id' => 7517, 'price' => 192.4, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 7517, 'price' => 193, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 7517, 'price' => 187.6, 'quality' => 1, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 7517, 'price' => 195, 'quality' => 1, 'card_type' => 'chinatelecom']
+            ['goods_id' => 7517, 'price' => 193, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
-//        300 => [
+        300 => [
 //            ['goods_id' => 7518, 'price' => 287.4, 'quality' => 1, 'card_type' => 'chinamobile'],
-//            ['goods_id' => 7518, 'price' => 285.9, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7518, 'price' => 285.9, 'quality' => 1, 'card_type' => 'chinaunicom'],
 //            ['goods_id' => 7518, 'price' => 285.9, 'quality' => 1, 'card_type' => 'chinatelecom']
-//        ],
+        ],
 //        500 => [
 //            ['goods_id' => 7519, 'price' => 479, 'quality' => 1, 'card_type' => 'chinamobile'],
 //            ['goods_id' => 7519, 'price' => 476.5, 'quality' => 1, 'card_type' => 'chinaunicom'],
@@ -4457,16 +4461,16 @@ $chizeng_normal_phone = ['name' => 'chizeng_normal', 'store_id' => 182,'qualitys
 
 $xinhengyangnew_phone = ['name' => 'xinhengyangnew', 'store_id' => 183,'qualitys' => '1',
     'amount' => [
-//        10 => [
-//            ['goods_id' => 7553, 'price' => 9.54, 'quality' => 1, 'card_type' => 'chinamobile'],
+        10 => [
+            ['goods_id' => 7553, 'price' => 9.54, 'quality' => 1, 'card_type' => 'chinamobile'],
 //            ['goods_id' => 7553, 'price' => 9.53, 'quality' => 1, 'card_type' => 'chinaunicom'],
 //            ['goods_id' => 7553, 'price' => 9.54, 'quality' => 1, 'card_type' => 'chinatelecom']
-//        ],
-//        20 => [
-//            ['goods_id' => 7554, 'price' => 19.08, 'quality' => 1, 'card_type' => 'chinamobile'],
+        ],
+        20 => [
+            ['goods_id' => 7554, 'price' => 19.08, 'quality' => 1, 'card_type' => 'chinamobile'],
 //            ['goods_id' => 7554, 'price' => 19.06, 'quality' => 1, 'card_type' => 'chinaunicom'],
 //            ['goods_id' => 7554, 'price' => 19.08, 'quality' => 1, 'card_type' => 'chinatelecom']
-//        ],
+        ],
         30 => [
             ['goods_id' => 7555, 'price' => 28.77, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 7555, 'price' => 28.35, 'quality' => 1, 'card_type' => 'chinaunicom'],
@@ -5089,119 +5093,119 @@ $ruixundaman_phone = ['name' => 'ruixundaman', 'store_id' => 201, 'qualitys' =>
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 
-$ruizhi_tax_phone = ['name' => 'ruizhi_tax', 'store_id' => 202, 'qualitys' => '2',
+$ruizhi_tax_phone = ['name' => 'ruizhi_tax', 'store_id' => 202, 'qualitys' => '3',
     'amount' => [
-        1  => [
-            ['goods_id' => 8047, 'price' => 1.085, 'quality' => 2, 'card_type' => 'chinaunicom'],
-        ],
-        2  => [
-            ['goods_id' => 8048, 'price' => 2.17, 'quality' => 2, 'card_type' => 'chinaunicom'],
-        ],
-        3  => [
-            ['goods_id' => 8049, 'price' => 3.255, 'quality' => 2, 'card_type' => 'chinaunicom'],
-        ],
-        4  => [
-            ['goods_id' => 8050, 'price' => 4.34, 'quality' => 2, 'card_type' => 'chinaunicom'],
-        ],
-        5 => [
-            ['goods_id' => 7697, 'price' => 5.425, 'quality' => 2, 'card_type' => 'chinaunicom']
-        ],
-        6  => [
-            ['goods_id' => 8051, 'price' => 6.51, 'quality' => 2, 'card_type' => 'chinaunicom'],
-        ],
-        7  => [
-            ['goods_id' => 8052, 'price' => 7.595, 'quality' => 2, 'card_type' => 'chinaunicom'],
-        ],
-        8  => [
-            ['goods_id' => 8053, 'price' => 8.68, 'quality' => 2, 'card_type' => 'chinaunicom'],
-        ],
-        9  => [
-            ['goods_id' => 8054, 'price' => 9.765, 'quality' => 2, 'card_type' => 'chinaunicom'],
-        ],
+//        1  => [
+//            ['goods_id' => 8047, 'price' => 1.085, 'quality' => 3, 'card_type' => 'chinaunicom'],
+//        ],
+//        2  => [
+//            ['goods_id' => 8048, 'price' => 2.17, 'quality' => 3, 'card_type' => 'chinaunicom'],
+//        ],
+//        3  => [
+//            ['goods_id' => 8049, 'price' => 3.255, 'quality' => 3, 'card_type' => 'chinaunicom'],
+//        ],
+//        4  => [
+//            ['goods_id' => 8050, 'price' => 4.34, 'quality' => 3, 'card_type' => 'chinaunicom'],
+//        ],
+//        5 => [
+//            ['goods_id' => 7697, 'price' => 5.425, 'quality' => 3, 'card_type' => 'chinaunicom']
+//        ],
+//        6  => [
+//            ['goods_id' => 8051, 'price' => 6.51, 'quality' => 3, 'card_type' => 'chinaunicom'],
+//        ],
+//        7  => [
+//            ['goods_id' => 8052, 'price' => 7.595, 'quality' => 3, 'card_type' => 'chinaunicom'],
+//        ],
+//        8  => [
+//            ['goods_id' => 8053, 'price' => 8.68, 'quality' => 3, 'card_type' => 'chinaunicom'],
+//        ],
+//        9  => [
+//            ['goods_id' => 8054, 'price' => 9.765, 'quality' => 3, 'card_type' => 'chinaunicom'],
+//        ],
         10 => [
-            ['goods_id' => 7698, 'price' => 10.98, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 7698, 'price' => 10.62, 'quality' => 2, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 7698, 'price' => 11.1, 'quality' => 2, 'card_type' => 'chinatelecom']
+            ['goods_id' => 7698, 'price' => 10.98, 'quality' => 3, 'card_type' => 'chinamobile'],
+            ['goods_id' => 7698, 'price' => 10.62, 'quality' => 3, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7698, 'price' => 11.1, 'quality' => 3, 'card_type' => 'chinatelecom']
         ],
         20 => [
-            ['goods_id' => 7699, 'price' => 21.96, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 7699, 'price' => 21.04, 'quality' => 2, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 7699, 'price' => 21.5, 'quality' => 2, 'card_type' => 'chinatelecom']
+            ['goods_id' => 7699, 'price' => 21.96, 'quality' => 3, 'card_type' => 'chinamobile'],
+            ['goods_id' => 7699, 'price' => 21.04, 'quality' => 3, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7699, 'price' => 21.5, 'quality' => 3, 'card_type' => 'chinatelecom']
         ],
         30 => [
-            ['goods_id' => 7700, 'price' => 31.25, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 7700, 'price' => 31.56, 'quality' => 2, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 7700, 'price' => 31.95, 'quality' => 2, 'card_type' => 'chinatelecom']
+            ['goods_id' => 7700, 'price' => 32.25, 'quality' => 3, 'card_type' => 'chinamobile'],
+            ['goods_id' => 7700, 'price' => 31.56, 'quality' => 3, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7700, 'price' => 31.95, 'quality' => 3, 'card_type' => 'chinatelecom']
         ],
         50 => [
-            ['goods_id' => 7701, 'price' => 52.15, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 7701, 'price' => 52.05, 'quality' => 2, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 7701, 'price' => 52.75, 'quality' => 2, 'card_type' => 'chinatelecom'],
+            ['goods_id' => 7701, 'price' => 52.15, 'quality' => 3, 'card_type' => 'chinamobile'],
+            ['goods_id' => 7701, 'price' => 52.05, 'quality' => 3, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7701, 'price' => 52.75, 'quality' => 3, 'card_type' => 'chinatelecom'],
         ],
         100 => [
-            ['goods_id' => 7702, 'price' => 104, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 7702, 'price' => 103.95, 'quality' => 2, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 7702, 'price' => 104.5, 'quality' => 2, 'card_type' => 'chinatelecom']
+            ['goods_id' => 7702, 'price' => 104, 'quality' => 3, 'card_type' => 'chinamobile'],
+            ['goods_id' => 7702, 'price' => 103.95, 'quality' => 3, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7702, 'price' => 104.5, 'quality' => 3, 'card_type' => 'chinatelecom']
         ],
         200 => [
-            ['goods_id' => 7703, 'price' => 208, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 7703, 'price' => 207.9, 'quality' => 2, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 7703, 'price' => 208.6, 'quality' => 2, 'card_type' => 'chinatelecom']
+            ['goods_id' => 7703, 'price' => 208, 'quality' => 3, 'card_type' => 'chinamobile'],
+            ['goods_id' => 7703, 'price' => 207.9, 'quality' => 3, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7703, 'price' => 208.6, 'quality' => 3, 'card_type' => 'chinatelecom']
         ],
         300 => [
-            ['goods_id' => 7704, 'price' => 312, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 7704, 'price' => 311.85, 'quality' => 2, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 7704, 'price' => 312.9, 'quality' => 2, 'card_type' => 'chinatelecom']
+            ['goods_id' => 7704, 'price' => 312, 'quality' => 3, 'card_type' => 'chinamobile'],
+            ['goods_id' => 7704, 'price' => 311.85, 'quality' => 3, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7704, 'price' => 312.9, 'quality' => 3, 'card_type' => 'chinatelecom']
         ],
         500 => [
-            ['goods_id' => 7705, 'price' => 520, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 7705, 'price' => 519.75, 'quality' => 2, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 7705, 'price' => 521.5, 'quality' => 2, 'card_type' => 'chinatelecom']
+            ['goods_id' => 7705, 'price' => 520, 'quality' => 3, 'card_type' => 'chinamobile'],
+            ['goods_id' => 7705, 'price' => 519.75, 'quality' => 3, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7705, 'price' => 521.5, 'quality' => 3, 'card_type' => 'chinatelecom']
         ]
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 
-$pengxinda_phone = ['name' => 'pengxinda', 'store_id' => 203,'qualitys' => '2',
+$pengxinda_phone = ['name' => 'pengxinda', 'store_id' => 203,'qualitys' => '3',
     'amount' => [
         10 => [
-            ['goods_id' => 7706, 'price' => 10.8, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 7706, 'price' => 10.8, 'quality' => 2, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 7706, 'price' => 10.8, 'quality' => 2, 'card_type' => 'chinatelecom']
+            ['goods_id' => 7706, 'price' => 10.8, 'quality' => 3, 'card_type' => 'chinamobile'],
+            ['goods_id' => 7706, 'price' => 10.8, 'quality' => 3, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7706, 'price' => 10.8, 'quality' => 3, 'card_type' => 'chinatelecom']
         ],
         20 => [
-            ['goods_id' => 7707, 'price' => 21.6, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 7707, 'price' => 21.6, 'quality' => 2, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 7707, 'price' => 21.6, 'quality' => 2, 'card_type' => 'chinatelecom']
+            ['goods_id' => 7707, 'price' => 21.6, 'quality' => 3, 'card_type' => 'chinamobile'],
+            ['goods_id' => 7707, 'price' => 21.6, 'quality' => 3, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7707, 'price' => 21.6, 'quality' => 3, 'card_type' => 'chinatelecom']
         ],
         30 => [
-//            ['goods_id' => 7708, 'price' => 31.11, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 7708, 'price' => 31.065, 'quality' => 2, 'card_type' => 'chinaunicom'],
-//            ['goods_id' => 7708, 'price' => 31.11, 'quality' => 2, 'card_type' => 'chinatelecom']
+//            ['goods_id' => 7708, 'price' => 31.11, 'quality' => 3, 'card_type' => 'chinamobile'],
+            ['goods_id' => 7708, 'price' => 31.065, 'quality' => 3, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 7708, 'price' => 31.11, 'quality' => 3, 'card_type' => 'chinatelecom']
         ],
         50 => [
-            ['goods_id' => 7709, 'price' => 51.85, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 7709, 'price' => 51.775, 'quality' => 2, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 7709, 'price' => 51.85, 'quality' => 2, 'card_type' => 'chinatelecom']
+            ['goods_id' => 7709, 'price' => 51.85, 'quality' => 3, 'card_type' => 'chinamobile'],
+            ['goods_id' => 7709, 'price' => 51.35, 'quality' => 3, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7709, 'price' => 51.85, 'quality' => 3, 'card_type' => 'chinatelecom']
         ],
         100 => [
-            ['goods_id' => 7710, 'price' => 103.6, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 7710, 'price' => 103.55, 'quality' => 2, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 7710, 'price' => 103.55, 'quality' => 2, 'card_type' => 'chinatelecom']
+            ['goods_id' => 7710, 'price' => 102.7, 'quality' => 3, 'card_type' => 'chinamobile'],
+            ['goods_id' => 7710, 'price' => 102.7, 'quality' => 3, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7710, 'price' => 102.7, 'quality' => 3, 'card_type' => 'chinatelecom']
         ],
         200 => [
-            ['goods_id' => 7711, 'price' => 207.2, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 7711, 'price' => 207.1, 'quality' => 2, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 7711, 'price' => 207.1, 'quality' => 2, 'card_type' => 'chinatelecom']
+            ['goods_id' => 7711, 'price' => 205.4, 'quality' => 3, 'card_type' => 'chinamobile'],
+            ['goods_id' => 7711, 'price' => 205.4, 'quality' => 3, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7711, 'price' => 205.4, 'quality' => 3, 'card_type' => 'chinatelecom']
         ],
         300 => [
-            ['goods_id' => 7712, 'price' => 310.8, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 7712, 'price' => 310.65, 'quality' => 2, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 7712, 'price' => 310.65, 'quality' => 2, 'card_type' => 'chinatelecom']
+            ['goods_id' => 7712, 'price' => 308.1, 'quality' => 3, 'card_type' => 'chinamobile'],
+            ['goods_id' => 7712, 'price' => 308.1, 'quality' => 3, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7712, 'price' => 308.1, 'quality' => 3, 'card_type' => 'chinatelecom']
         ],
         500 => [
-            ['goods_id' => 7713, 'price' => 518, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 7713, 'price' => 518.5, 'quality' => 2, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 7713, 'price' => 517.75, 'quality' => 2, 'card_type' => 'chinatelecom']
+            ['goods_id' => 7713, 'price' => 513.5, 'quality' => 3, 'card_type' => 'chinamobile'],
+            ['goods_id' => 7713, 'price' => 518.5, 'quality' => 3, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7713, 'price' => 513.5, 'quality' => 3, 'card_type' => 'chinatelecom']
         ]
     ],
     'official_sn' => true, 'refill_type' => 'api'];
@@ -6685,16 +6689,16 @@ $yelin_hf_phone = ['name' => 'yelin_hf', 'store_id' => 244, 'qualitys' => '1',
             ['goods_id' => 8020, 'price' => 190, 'quality' => 1, 'card_type' => 'chinaunicom'],
             ['goods_id' => 8020, 'price' => 190, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
-//        300 => [
-//            ['goods_id' => 8021, 'price' => 288, 'quality' => 1, 'card_type' => 'chinamobile'],
-//            ['goods_id' => 8021, 'price' => 285, 'quality' => 1, 'card_type' => 'chinaunicom'],
-//            ['goods_id' => 8021, 'price' => 285, 'quality' => 1, 'card_type' => 'chinatelecom']
-//        ],
-//        500 => [
-//            ['goods_id' => 8022, 'price' => 480, 'quality' => 1, 'card_type' => 'chinamobile'],
-//            ['goods_id' => 8022, 'price' => 475, 'quality' => 1, 'card_type' => 'chinaunicom'],
-//            ['goods_id' => 8022, 'price' => 475, 'quality' => 1, 'card_type' => 'chinatelecom']
-//        ]
+        300 => [
+            ['goods_id' => 8021, 'price' => 288, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8021, 'price' => 285, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8021, 'price' => 285, 'quality' => 1, 'card_type' => 'chinatelecom']
+        ],
+        500 => [
+            ['goods_id' => 8022, 'price' => 480, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8022, 'price' => 475, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8022, 'price' => 475, 'quality' => 1, 'card_type' => 'chinatelecom']
+        ]
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 
@@ -7109,14 +7113,14 @@ $xinruiheng_yd_phone = ['name' => 'xinruiheng_yd', 'store_id' => 259, 'qualitys'
 
 $wanxin_fs_phone = ['name' => 'wanxin_fs', 'store_id' => 260, 'qualitys' => '2',
     'amount' => [
-        10 => [['goods_id' => 8151, 'price' => 10, 'quality' => 2, 'card_type' => 'chinamobile']],
-        20 => [['goods_id' => 8152, 'price' => 20, 'quality' => 2, 'card_type' => 'chinamobile']],
-        30 => [['goods_id' => 8153, 'price' => 30, 'quality' => 2, 'card_type' => 'chinamobile']],
-        50 => [['goods_id' => 8154, 'price' => 50, 'quality' => 2, 'card_type' => 'chinamobile']],
-        100 => [['goods_id' => 8155, 'price' => 100, 'quality' => 2, 'card_type' => 'chinamobile']],
-        200 => [['goods_id' => 8156, 'price' => 200, 'quality' => 2, 'card_type' => 'chinamobile']],
-        300 => [['goods_id' => 8157, 'price' => 300, 'quality' => 2, 'card_type' => 'chinamobile']],
-        500 => [['goods_id' => 8158, 'price' => 500, 'quality' => 2, 'card_type' => 'chinamobile']]
+        10 => [['goods_id' => 8151, 'price' => 10, 'quality' => 2, 'card_type' => 'chinamobile,chinatelecom']],
+        20 => [['goods_id' => 8152, 'price' => 20, 'quality' => 2, 'card_type' => 'chinamobile,chinatelecom']],
+        30 => [['goods_id' => 8153, 'price' => 30, 'quality' => 2, 'card_type' => 'chinamobile,chinatelecom']],
+        50 => [['goods_id' => 8154, 'price' => 50, 'quality' => 2, 'card_type' => 'chinamobile,chinatelecom']],
+        100 => [['goods_id' => 8155, 'price' => 100, 'quality' => 2, 'card_type' => 'chinamobile,chinatelecom']],
+        200 => [['goods_id' => 8156, 'price' => 200, 'quality' => 2, 'card_type' => 'chinamobile,chinatelecom']],
+        300 => [['goods_id' => 8157, 'price' => 300, 'quality' => 2, 'card_type' => 'chinamobile,chinatelecom']],
+        500 => [['goods_id' => 8158, 'price' => 500, 'quality' => 2, 'card_type' => 'chinamobile,chinatelecom']]
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 
@@ -7189,8 +7193,8 @@ $yuewen_phone = ['name' => 'yuewen', 'store_id' => 262, 'qualitys' => '1',
             ['goods_id' => 8188, 'price' => 186, 'quality' => 1, 'card_type' => 'chinaunicom'],
             ['goods_id' => 8188, 'price' => 192.6, 'quality' => 1, 'card_type' => 'chinatelecom'],
         ],
-//        300 => [['goods_id' => 8189, 'price' => 288, 'quality' => 1, 'card_type' => 'chinamobile']],
-//        500 => [['goods_id' => 8190, 'price' => 480, 'quality' => 1, 'card_type' => 'chinamobile']]
+        300 => [['goods_id' => 8189, 'price' => 288, 'quality' => 1, 'card_type' => 'chinaunicom']],
+        500 => [['goods_id' => 8190, 'price' => 480, 'quality' => 1, 'card_type' => 'chinaunicom']]
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 
@@ -7339,27 +7343,31 @@ $huishi_phone = ['name' => 'huishi', 'store_id' => 269, 'qualitys' => '1',
 
 $yangchi_phone = ['name' => 'yangchi', 'store_id' => 270, 'qualitys' => '1',
     'amount' => [
-//        10 => [['goods_id' => 8247, 'price' => 9.6, 'quality' => 1, 'card_type' => 'chinamobile']],
-//        20 => [['goods_id' => 8248, 'price' => 19.2, 'quality' => 1, 'card_type' => 'chinamobile']],
+        10 => [
+            ['goods_id' => 8247, 'price' => 9.68, 'quality' => 1, 'card_type' => 'chinamobile'],
+        ],
+        20 => [
+            ['goods_id' => 8248, 'price' => 19.36, 'quality' => 1, 'card_type' => 'chinamobile'],
+        ],
         30 => [
 //            ['goods_id' => 8249, 'price' => 28.98, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 8249, 'price' => 28.05, 'quality' => 1, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 8249, 'price' => 29.04, 'quality' => 1, 'card_type' => 'chinatelecom'],
+            ['goods_id' => 8249, 'price' => 27.75, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8249, 'price' => 28.95, 'quality' => 1, 'card_type' => 'chinatelecom'],
         ],
         50 => [
-            ['goods_id' => 8250, 'price' => 48.3, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 8250, 'price' => 46.75, 'quality' => 1, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 8250, 'price' => 48.4, 'quality' => 1, 'card_type' => 'chinatelecom'],
+            ['goods_id' => 8250, 'price' => 48.4, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8250, 'price' => 46.25, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8250, 'price' => 48.25, 'quality' => 1, 'card_type' => 'chinatelecom'],
         ],
         100 => [
-            ['goods_id' => 8251, 'price' => 96.6, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 8251, 'price' => 93.5, 'quality' => 1, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 8251, 'price' => 96.8, 'quality' => 1, 'card_type' => 'chinatelecom'],
+            ['goods_id' => 8251, 'price' => 96.8, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8251, 'price' => 92.5, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8251, 'price' => 96.5, 'quality' => 1, 'card_type' => 'chinatelecom'],
         ],
         200 => [
-            ['goods_id' => 8252, 'price' => 193.2, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 8252, 'price' => 187, 'quality' => 1, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 8252, 'price' => 193.6, 'quality' => 1, 'card_type' => 'chinatelecom'],
+            ['goods_id' => 8252, 'price' => 193.6, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8252, 'price' => 185, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8252, 'price' => 193, 'quality' => 1, 'card_type' => 'chinatelecom'],
         ],
 //        300 => [
 //            ['goods_id' => 8253, 'price' => 267, 'quality' => 1, 'card_type' => 'chinaunicom']
@@ -7485,23 +7493,27 @@ $bodian_dx_phone = ['name' => 'bodian_dx', 'store_id' => 276, 'qualitys' => '2',
 
 $hanwei_phone = ['name' => 'hanwei', 'store_id' => 277, 'qualitys' => '1',
     'amount' => [
-//        10 => [['goods_id' => 8303, 'price' => 9.6, 'quality' => 1, 'card_type' => 'chinamobile']],
-//        20 => [['goods_id' => 8304, 'price' => 19.2, 'quality' => 1, 'card_type' => 'chinamobile']],
+        10 => [['goods_id' => 8303, 'price' => 9.6, 'quality' => 1, 'card_type' => 'chinamobile']],
+        20 => [['goods_id' => 8304, 'price' => 19.2, 'quality' => 1, 'card_type' => 'chinamobile']],
         30 => [
 //            ['goods_id' => 8305, 'price' => 28.98, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 8305, 'price' => 27.6, 'quality' => 1, 'card_type' => 'chinaunicom']
+            ['goods_id' => 8305, 'price' => 27.6, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8305, 'price' => 27.6, 'quality' => 1, 'card_type' => 'chinatelecom'],
         ],
         50 => [
             ['goods_id' => 8306, 'price' => 48.3, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 8306, 'price' => 46, 'quality' => 1, 'card_type' => 'chinaunicom']
+            ['goods_id' => 8306, 'price' => 46, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8306, 'price' => 46, 'quality' => 1, 'card_type' => 'chinatelecom'],
         ],
         100 => [
             ['goods_id' => 8307, 'price' => 96.6, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 8307, 'price' => 92, 'quality' => 1, 'card_type' => 'chinaunicom']
+            ['goods_id' => 8307, 'price' => 92, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8307, 'price' => 92, 'quality' => 1, 'card_type' => 'chinatelecom'],
         ],
         200 => [
             ['goods_id' => 8308, 'price' => 193.2, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 8308, 'price' => 184, 'quality' => 1, 'card_type' => 'chinaunicom']
+            ['goods_id' => 8308, 'price' => 184, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8308, 'price' => 184, 'quality' => 1, 'card_type' => 'chinatelecom'],
         ],
 //        300 => [
 //            ['goods_id' => 8309, 'price' => 267, 'quality' => 1, 'card_type' => 'chinaunicom']
@@ -7516,10 +7528,10 @@ $hanwei_fs_phone = ['name' => 'hanwei_fs', 'store_id' => 279, 'qualitys' => '1',
     'amount' => [
 //        10 => [['goods_id' => 8317, 'price' => 9.5, 'quality' => 1, 'card_type' => 'chinamobile']],
 //        20 => [['goods_id' => 8318, 'price' => 19, 'quality' => 1, 'card_type' => 'chinamobile']],
-        30 => [['goods_id' => 8319, 'price' => 28.5, 'quality' => 1, 'card_type' => 'chinamobile']],
-        50 => [['goods_id' => 8320, 'price' => 47.5, 'quality' => 1, 'card_type' => 'chinamobile']],
-        100 => [['goods_id' => 8321, 'price' => 95, 'quality' => 1, 'card_type' => 'chinamobile']],
-        200 => [['goods_id' => 8322, 'price' => 190, 'quality' => 1, 'card_type' => 'chinamobile']],
+        30 => [['goods_id' => 8319, 'price' => 28.5, 'quality' => 1, 'card_type' => 'chinamobile,chinatelecom']],
+        50 => [['goods_id' => 8320, 'price' => 47.5, 'quality' => 1, 'card_type' => 'chinamobile,chinatelecom']],
+        100 => [['goods_id' => 8321, 'price' => 95, 'quality' => 1, 'card_type' => 'chinamobile,chinatelecom']],
+        200 => [['goods_id' => 8322, 'price' => 190, 'quality' => 1, 'card_type' => 'chinamobile,chinatelecom']],
 //        300 => [['goods_id' => 8323, 'price' => 285, 'quality' => 1, 'card_type' => 'chinamobile']],
 //        500 => [['goods_id' => 8324, 'price' => 475, 'quality' => 1, 'card_type' => 'chinamobile']]
     ],
@@ -7529,10 +7541,10 @@ $feimingyu_fs_phone = ['name' => 'feimingyu_fs', 'store_id' => 280, 'qualitys' =
     'amount' => [
 //        10 => [['goods_id' => 8325, 'price' => 9.5, 'quality' => 1, 'card_type' => 'chinatelecom']],
 //        20 => [['goods_id' => 8326, 'price' => 19, 'quality' => 1, 'card_type' => 'chinatelecom']],
-        30 => [['goods_id' => 8327, 'price' => 28.5, 'quality' => 1, 'card_type' => 'chinamobile, chinatelecom']],
-        50 => [['goods_id' => 8328, 'price' => 47.5, 'quality' => 1, 'card_type' => 'chinamobile, chinatelecom']],
-        100 => [['goods_id' => 8329, 'price' => 95, 'quality' => 1, 'card_type' => 'chinamobile, chinatelecom']],
-        200 => [['goods_id' => 8330, 'price' => 190, 'quality' => 1, 'card_type' => 'chinamobile, chinatelecom']],
+        30 => [['goods_id' => 8327, 'price' => 28.5, 'quality' => 1, 'card_type' => 'chinamobile,chinatelecom']],
+        50 => [['goods_id' => 8328, 'price' => 47.5, 'quality' => 1, 'card_type' => 'chinamobile,chinatelecom']],
+        100 => [['goods_id' => 8329, 'price' => 95, 'quality' => 1, 'card_type' => 'chinamobile,chinatelecom']],
+        200 => [['goods_id' => 8330, 'price' => 190, 'quality' => 1, 'card_type' => 'chinamobile,chinatelecom']],
 //        300 => [['goods_id' => 8331, 'price' => 285, 'quality' => 1, 'card_type' => 'chinatelecom']],
 //        500 => [['goods_id' => 8332, 'price' => 475, 'quality' => 1, 'card_type' => 'chinatelecom']]
     ],
@@ -7551,6 +7563,424 @@ $yuewen_fs_gd_phone = ['name' => 'yuewen_fs_gd', 'store_id' => 281, 'qualitys' =
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 
+$douxun_sec_phone = ['name' => 'douxun_sec', 'store_id' => 282, 'qualitys' => '3',
+    'amount' => [
+//        10 => [
+//            ['goods_id' => 8341, 'price' => 10.01, 'quality' => 3, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 8341, 'price' => 10.01, 'quality' => 3, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 8341, 'price' => 10.01, 'quality' => 3, 'card_type' => 'chinatelecom']
+//        ],
+//        20 => [
+//            ['goods_id' => 8342, 'price' => 20.02, 'quality' => 3, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 8342, 'price' => 20.02, 'quality' => 3, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 8342, 'price' => 20.02, 'quality' => 3, 'card_type' => 'chinatelecom']
+//        ],
+//        30 => [
+//            ['goods_id' => 8343, 'price' => 30.03, 'quality' => 3, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 8343, 'price' => 30.03, 'quality' => 3, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 8343, 'price' => 30.03, 'quality' => 3, 'card_type' => 'chinatelecom']
+//        ],
+        50 => [
+            ['goods_id' => 8344, 'price' => 51.75, 'quality' => 3, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8344, 'price' => 51.275, 'quality' => 3, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8344, 'price' => 51.5, 'quality' => 3, 'card_type' => 'chinatelecom']
+        ],
+        100 => [
+            ['goods_id' => 8345, 'price' => 102.85, 'quality' => 3, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8345, 'price' => 102.55, 'quality' => 3, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8345, 'price' => 103.7, 'quality' => 3, 'card_type' => 'chinatelecom']
+        ],
+        200 => [
+            ['goods_id' => 8346, 'price' => 205.7, 'quality' => 3, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8346, 'price' => 205.1, 'quality' => 3, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8346, 'price' => 206, 'quality' => 3, 'card_type' => 'chinatelecom']
+        ],
+        300 => [
+            ['goods_id' => 8347, 'price' => 308.55, 'quality' => 3, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8347, 'price' => 307.65, 'quality' => 3, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8347, 'price' => 309, 'quality' => 3, 'card_type' => 'chinatelecom']
+        ],
+        500 => [
+            ['goods_id' => 8348, 'price' => 514.25, 'quality' => 3, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 8348, 'price' => 500.5, 'quality' => 3, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8348, 'price' => 515, 'quality' => 3, 'card_type' => 'chinatelecom']
+        ]
+    ],
+    'official_sn' => true, 'refill_type' => 'api'];
+
+$miaoxt_tax_copy_phone = ['name' => 'miaoxt_tax_copy', 'store_id' => 283, 'qualitys' => '2',
+    'amount' => [
+        10 => [
+            ['goods_id' => 8349, 'price' => 10.7, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8349, 'price' => 10.6, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8349, 'price' => 10.9, 'quality' => 2, 'card_type' => 'chinatelecom']
+        ],
+        20 => [
+            ['goods_id' => 8350, 'price' => 21.4, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8350, 'price' => 21.2, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8350, 'price' => 21.4, 'quality' => 2, 'card_type' => 'chinatelecom']
+        ],
+        30 => [
+            ['goods_id' => 8351, 'price' => 32.1, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8351, 'price' => 31.2, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8351, 'price' => 31.35, 'quality' => 2, 'card_type' => 'chinatelecom']
+        ],
+        50 => [
+            ['goods_id' => 8352, 'price' => 51.9, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8352, 'price' => 51.55, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8352, 'price' => 52, 'quality' => 2, 'card_type' => 'chinatelecom']
+        ],
+        100 => [
+            ['goods_id' => 8353, 'price' => 103.2, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8353, 'price' => 103.1, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8353, 'price' => 103.7, 'quality' => 2, 'card_type' => 'chinatelecom']
+        ],
+        200 => [
+            ['goods_id' => 8354, 'price' => 206.4, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8354, 'price' => 206.2, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8354, 'price' => 207.3, 'quality' => 2, 'card_type' => 'chinatelecom']
+        ],
+        300 => [
+            ['goods_id' => 8355, 'price' => 309.6, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8355, 'price' => 309.3, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8355, 'price' => 311.4, 'quality' => 2, 'card_type' => 'chinatelecom']
+        ],
+        500 => [
+            ['goods_id' => 8356, 'price' => 516, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8356, 'price' => 515.5, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8356, 'price' => 519, 'quality' => 2, 'card_type' => 'chinatelecom']
+        ]
+    ],
+    'official_sn' => true, 'refill_type' => 'api'];
+
+$douxun_copy_phone = ['name' => 'douxun_copy', 'store_id' => 284, 'qualitys' => '2',
+    'amount' => [
+//        10 => [
+//            ['goods_id' => 8357, 'price' => 10.01, 'quality' => 2, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 8357, 'price' => 10.01, 'quality' => 2, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 8357, 'price' => 10.01, 'quality' => 2, 'card_type' => 'chinatelecom']
+//        ],
+//        20 => [
+//            ['goods_id' => 8358, 'price' => 20.02, 'quality' => 2, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 8358, 'price' => 20.02, 'quality' => 2, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 8358, 'price' => 20.02, 'quality' => 2, 'card_type' => 'chinatelecom']
+//        ],
+//        30 => [
+//            ['goods_id' => 8359, 'price' => 30.03, 'quality' => 2, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 8359, 'price' => 30.03, 'quality' => 2, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 8359, 'price' => 30.03, 'quality' => 2, 'card_type' => 'chinatelecom']
+//        ],
+        50 => [
+            ['goods_id' => 8360, 'price' => 51.75, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8360, 'price' => 51.45, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8360, 'price' => 51.5, 'quality' => 2, 'card_type' => 'chinatelecom']
+        ],
+        100 => [
+            ['goods_id' => 8361, 'price' => 102.85, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8361, 'price' => 102.9, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8361, 'price' => 103.7, 'quality' => 2, 'card_type' => 'chinatelecom']
+        ],
+        200 => [
+            ['goods_id' => 8362, 'price' => 205.7, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8362, 'price' => 205.8, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8362, 'price' => 206, 'quality' => 2, 'card_type' => 'chinatelecom']
+        ],
+        300 => [
+            ['goods_id' => 8363, 'price' => 308.55, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8363, 'price' => 308.7, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8363, 'price' => 309, 'quality' => 2, 'card_type' => 'chinatelecom']
+        ],
+        500 => [
+            ['goods_id' => 8364, 'price' => 514.25, 'quality' => 2, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 8364, 'price' => 500.5, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8364, 'price' => 515, 'quality' => 2, 'card_type' => 'chinatelecom']
+        ]
+    ],
+    'official_sn' => true, 'refill_type' => 'api'];
+
+$douxun_sec_copy_phone = ['name' => 'douxun_sec_copy', 'store_id' => 285, 'qualitys' => '2',
+    'amount' => [
+//        10 => [
+//            ['goods_id' => 8365, 'price' => 10.01, 'quality' => 2, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 8365, 'price' => 10.01, 'quality' => 2, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 8365, 'price' => 10.01, 'quality' => 2, 'card_type' => 'chinatelecom']
+//        ],
+//        20 => [
+//            ['goods_id' => 8366, 'price' => 20.02, 'quality' => 2, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 8366, 'price' => 20.02, 'quality' => 2, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 8366, 'price' => 20.02, 'quality' => 2, 'card_type' => 'chinatelecom']
+//        ],
+//        30 => [
+//            ['goods_id' => 8367, 'price' => 30.03, 'quality' => 2, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 8367, 'price' => 30.03, 'quality' => 2, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 8367, 'price' => 30.03, 'quality' => 2, 'card_type' => 'chinatelecom']
+//        ],
+        50 => [
+            ['goods_id' => 8368, 'price' => 51.75, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8368, 'price' => 51.45, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8368, 'price' => 51.5, 'quality' => 2, 'card_type' => 'chinatelecom']
+        ],
+        100 => [
+            ['goods_id' => 8369, 'price' => 102.85, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8369, 'price' => 102.9, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8369, 'price' => 103.7, 'quality' => 2, 'card_type' => 'chinatelecom']
+        ],
+        200 => [
+            ['goods_id' => 8370, 'price' => 205.7, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8370, 'price' => 205.8, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8370, 'price' => 206, 'quality' => 2, 'card_type' => 'chinatelecom']
+        ],
+        300 => [
+            ['goods_id' => 8371, 'price' => 308.55, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8371, 'price' => 308.7, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8371, 'price' => 309, 'quality' => 2, 'card_type' => 'chinatelecom']
+        ],
+        500 => [
+            ['goods_id' => 8372, 'price' => 514.25, 'quality' => 2, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 8372, 'price' => 500.5, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8372, 'price' => 515, 'quality' => 2, 'card_type' => 'chinatelecom']
+        ]
+    ],
+    'official_sn' => true, 'refill_type' => 'api'];
+
+$ruizhi_tax_copy_phone = ['name' => 'ruizhi_tax_copy', 'store_id' => 286, 'qualitys' => '3',
+    'amount' => [
+        10 => [
+            ['goods_id' => 8373, 'price' => 10.98, 'quality' => 3, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8373, 'price' => 10.62, 'quality' => 3, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8373, 'price' => 11.1, 'quality' => 3, 'card_type' => 'chinatelecom']
+        ],
+        20 => [
+            ['goods_id' => 8374, 'price' => 21.96, 'quality' => 3, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8374, 'price' => 21.04, 'quality' => 3, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8374, 'price' => 21.5, 'quality' => 3, 'card_type' => 'chinatelecom']
+        ],
+        30 => [
+            ['goods_id' => 8375, 'price' => 31.25, 'quality' => 3, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8375, 'price' => 31.56, 'quality' => 3, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8375, 'price' => 31.95, 'quality' => 3, 'card_type' => 'chinatelecom']
+        ],
+        50 => [
+            ['goods_id' => 8376, 'price' => 52.15, 'quality' => 3, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8376, 'price' => 52.05, 'quality' => 3, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8376, 'price' => 52.75, 'quality' => 3, 'card_type' => 'chinatelecom'],
+        ],
+        100 => [
+            ['goods_id' => 8377, 'price' => 104, 'quality' => 3, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8377, 'price' => 103.95, 'quality' => 3, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8377, 'price' => 104.5, 'quality' => 3, 'card_type' => 'chinatelecom']
+        ],
+        200 => [
+            ['goods_id' => 8378, 'price' => 208, 'quality' => 3, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8378, 'price' => 207.9, 'quality' => 3, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8378, 'price' => 208.6, 'quality' => 3, 'card_type' => 'chinatelecom']
+        ],
+        300 => [
+            ['goods_id' => 8379, 'price' => 312, 'quality' => 3, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8379, 'price' => 311.85, 'quality' => 3, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8379, 'price' => 312.9, 'quality' => 3, 'card_type' => 'chinatelecom']
+        ],
+        500 => [
+            ['goods_id' => 8380, 'price' => 520, 'quality' => 3, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8380, 'price' => 519.75, 'quality' => 3, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8380, 'price' => 521.5, 'quality' => 3, 'card_type' => 'chinatelecom']
+        ]
+    ],
+    'official_sn' => true, 'refill_type' => 'api'];
+
+$meixu_tax_phone = ['name' => 'meixu_tax', 'store_id' => 287, 'qualitys' => '3',
+    'amount' => [
+        10 => [
+            ['goods_id' => 8381, 'price' => 10.67, 'quality' => 3, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8381, 'price' => 10.52, 'quality' => 3, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8381, 'price' => 10.77, 'quality' => 3, 'card_type' => 'chinatelecom']
+        ],
+        20 => [
+            ['goods_id' => 8382, 'price' => 21.34, 'quality' => 3, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8382, 'price' => 20.94, 'quality' => 3, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8382, 'price' => 21.14, 'quality' => 3, 'card_type' => 'chinatelecom']
+        ],
+        30 => [
+            ['goods_id' => 8383, 'price' => 31.29, 'quality' => 3, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8383, 'price' => 31.26, 'quality' => 3, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8383, 'price' => 31.29, 'quality' => 3, 'card_type' => 'chinatelecom']
+        ],
+        50 => [
+            ['goods_id' => 8384, 'price' => 52.6, 'quality' => 3, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8384, 'price' => 51.575, 'quality' => 3, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8384, 'price' => 51.975, 'quality' => 3, 'card_type' => 'chinatelecom'],
+        ],
+        100 => [
+            ['goods_id' => 8385, 'price' => 103.15, 'quality' => 3, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8385, 'price' => 103.15, 'quality' => 3, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8385, 'price' => 103.15, 'quality' => 3, 'card_type' => 'chinatelecom']
+        ],
+        200 => [
+            ['goods_id' => 8386, 'price' => 206.3, 'quality' => 3, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8386, 'price' => 206.3, 'quality' => 3, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8386, 'price' => 206.3, 'quality' => 3, 'card_type' => 'chinatelecom']
+        ],
+        300 => [
+            ['goods_id' => 8387, 'price' => 309.45, 'quality' => 3, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8387, 'price' => 309.45, 'quality' => 3, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8387, 'price' => 309.45, 'quality' => 3, 'card_type' => 'chinatelecom']
+        ],
+        500 => [
+            ['goods_id' => 8388, 'price' => 515.75, 'quality' => 3, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8388, 'price' => 515.75, 'quality' => 3, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8388, 'price' => 515.75, 'quality' => 3, 'card_type' => 'chinatelecom']
+        ]
+    ],
+    'official_sn' => true, 'refill_type' => 'api'];
+
+$meixu_tax_sec_phone = ['name' => 'meixu_tax_sec', 'store_id' => 288, 'qualitys' => '3',
+    'amount' => [
+        10 => [
+            ['goods_id' => 8389, 'price' => 10.67, 'quality' => 3, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8389, 'price' => 10.52, 'quality' => 3, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8389, 'price' => 10.77, 'quality' => 3, 'card_type' => 'chinatelecom']
+        ],
+        20 => [
+            ['goods_id' => 8390, 'price' => 21.34, 'quality' => 3, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8390, 'price' => 20.94, 'quality' => 3, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8390, 'price' => 21.14, 'quality' => 3, 'card_type' => 'chinatelecom']
+        ],
+        30 => [
+            ['goods_id' => 8391, 'price' => 31.29, 'quality' => 3, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8391, 'price' => 31.26, 'quality' => 3, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8391, 'price' => 31.29, 'quality' => 3, 'card_type' => 'chinatelecom']
+        ],
+        50 => [
+            ['goods_id' => 8392, 'price' => 52.6, 'quality' => 3, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8392, 'price' => 51.575, 'quality' => 3, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8392, 'price' => 51.975, 'quality' => 3, 'card_type' => 'chinatelecom'],
+        ],
+        100 => [
+            ['goods_id' => 8393, 'price' => 103.15, 'quality' => 3, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8393, 'price' => 103.15, 'quality' => 3, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8393, 'price' => 103.15, 'quality' => 3, 'card_type' => 'chinatelecom']
+        ],
+        200 => [
+            ['goods_id' => 8394, 'price' => 206.3, 'quality' => 3, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8394, 'price' => 206.3, 'quality' => 3, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8394, 'price' => 206.3, 'quality' => 3, 'card_type' => 'chinatelecom']
+        ],
+        300 => [
+            ['goods_id' => 8395, 'price' => 309.45, 'quality' => 3, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8395, 'price' => 309.45, 'quality' => 3, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8395, 'price' => 309.45, 'quality' => 3, 'card_type' => 'chinatelecom']
+        ],
+        500 => [
+            ['goods_id' => 8396, 'price' => 515.75, 'quality' => 3, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8396, 'price' => 515.75, 'quality' => 3, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8396, 'price' => 515.75, 'quality' => 3, 'card_type' => 'chinatelecom']
+        ]
+    ],
+    'official_sn' => true, 'refill_type' => 'api'];
+
+$ruizhi_sec_phone = ['name' => 'ruizhi_sec', 'store_id' => 289, 'qualitys' => '3',
+    'amount' => [
+//        10 => [
+//            ['goods_id' => 8397, 'price' => 10.67, 'quality' => 3, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 8397, 'price' => 10.52, 'quality' => 3, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 8397, 'price' => 10.77, 'quality' => 3, 'card_type' => 'chinatelecom']
+//        ],
+//        20 => [
+//            ['goods_id' => 8398, 'price' => 21.34, 'quality' => 3, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 8398, 'price' => 20.94, 'quality' => 3, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 8398, 'price' => 21.14, 'quality' => 3, 'card_type' => 'chinatelecom']
+//        ],
+        30 => [
+            ['goods_id' => 8399, 'price' => 30.84, 'quality' => 3, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8399, 'price' => 30.84, 'quality' => 3, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8399, 'price' => 30.84, 'quality' => 3, 'card_type' => 'chinatelecom']
+        ],
+        50 => [
+            ['goods_id' => 8400, 'price' => 51.4, 'quality' => 3, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8400, 'price' => 51.4, 'quality' => 3, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8400, 'price' => 51.4, 'quality' => 3, 'card_type' => 'chinatelecom'],
+        ],
+        100 => [
+            ['goods_id' => 8401, 'price' => 102.8, 'quality' => 3, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8401, 'price' => 102.8, 'quality' => 3, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8401, 'price' => 102.8, 'quality' => 3, 'card_type' => 'chinatelecom']
+        ],
+        200 => [
+            ['goods_id' => 8402, 'price' => 205.6, 'quality' => 3, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8402, 'price' => 205.6, 'quality' => 3, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8402, 'price' => 205.6, 'quality' => 3, 'card_type' => 'chinatelecom']
+        ],
+        300 => [
+            ['goods_id' => 8403, 'price' => 308.4, 'quality' => 3, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8403, 'price' => 308.4, 'quality' => 3, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8403, 'price' => 308.4, 'quality' => 3, 'card_type' => 'chinatelecom']
+        ],
+        500 => [
+            ['goods_id' => 8404, 'price' => 514, 'quality' => 3, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 8404, 'price' => 514, 'quality' => 3, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8404, 'price' => 514, 'quality' => 3, 'card_type' => 'chinatelecom']
+        ]
+    ],
+    'official_sn' => true, 'refill_type' => 'api'];
+
+$ruizhi_third_phone = ['name' => 'ruizhi_third', 'store_id' => 290, 'qualitys' => '3',
+    'amount' => [
+//        10 => [
+//            ['goods_id' => 8405, 'price' => 10.67, 'quality' => 3, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 8405, 'price' => 10.52, 'quality' => 3, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 8405, 'price' => 10.77, 'quality' => 3, 'card_type' => 'chinatelecom']
+//        ],
+//        20 => [
+//            ['goods_id' => 8406, 'price' => 21.34, 'quality' => 3, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 8406, 'price' => 20.94, 'quality' => 3, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 8406, 'price' => 21.14, 'quality' => 3, 'card_type' => 'chinatelecom']
+//        ],
+        30 => [
+            ['goods_id' => 8407, 'price' => 30.84, 'quality' => 3, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8407, 'price' => 30.84, 'quality' => 3, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8407, 'price' => 30.84, 'quality' => 3, 'card_type' => 'chinatelecom']
+        ],
+        50 => [
+            ['goods_id' => 8408, 'price' => 51.4, 'quality' => 3, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8408, 'price' => 51.4, 'quality' => 3, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8408, 'price' => 51.4, 'quality' => 3, 'card_type' => 'chinatelecom'],
+        ],
+        100 => [
+            ['goods_id' => 8409, 'price' => 102.8, 'quality' => 3, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8409, 'price' => 102.8, 'quality' => 3, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8409, 'price' => 102.8, 'quality' => 3, 'card_type' => 'chinatelecom']
+        ],
+        200 => [
+            ['goods_id' => 8410, 'price' => 205.6, 'quality' => 3, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8410, 'price' => 205.6, 'quality' => 3, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8410, 'price' => 205.6, 'quality' => 3, 'card_type' => 'chinatelecom']
+        ],
+        300 => [
+            ['goods_id' => 8411, 'price' => 308.4, 'quality' => 3, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8411, 'price' => 308.4, 'quality' => 3, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8411, 'price' => 308.4, 'quality' => 3, 'card_type' => 'chinatelecom']
+        ],
+        500 => [
+            ['goods_id' => 8412, 'price' => 514, 'quality' => 3, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 8412, 'price' => 514, 'quality' => 3, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8412, 'price' => 514, 'quality' => 3, 'card_type' => 'chinatelecom']
+        ]
+    ],
+    'official_sn' => true, 'refill_type' => 'api'];
+
+$xinhengyang_fs_phone = ['name' => 'xinhengyang_fs', 'store_id' => 291, 'qualitys' => '1',
+    'amount' => [
+//        10 => [['goods_id' => 8413, 'price' => 9.5, 'quality' => 1, 'card_type' => 'chinatelecom']],
+//        20 => [['goods_id' => 8414, 'price' => 19, 'quality' => 1, 'card_type' => 'chinatelecom']],
+        30 => [['goods_id' => 8415, 'price' => 28.5, 'quality' => 1, 'card_type' => 'chinamobile, chinatelecom']],
+        50 => [['goods_id' => 8416, 'price' => 47.5, 'quality' => 1, 'card_type' => 'chinamobile, chinatelecom']],
+        100 => [['goods_id' => 8417, 'price' => 95, 'quality' => 1, 'card_type' => 'chinamobile, chinatelecom']],
+        200 => [['goods_id' => 8418, 'price' => 190, 'quality' => 1, 'card_type' => 'chinamobile, chinatelecom']],
+//        300 => [['goods_id' => 8419, 'price' => 285, 'quality' => 1, 'card_type' => 'chinatelecom']],
+//        500 => [['goods_id' => 8420, 'price' => 475, 'quality' => 1, 'card_type' => 'chinatelecom']]
+    ],
+    'official_sn' => true, 'refill_type' => 'api'];
+
 $phone_providers = [
 //    ['name' => 'beixt', 'cfg' => $beixt_phone],
 //    ['name' => 'bxtwt', 'cfg' => $bxtwt_phone],
@@ -7788,6 +8218,16 @@ $phone_providers = [
     ['name' => 'hanwei_fs', 'cfg' => $hanwei_fs_phone],
     ['name' => 'feimingyu_fs', 'cfg' => $feimingyu_fs_phone],
     ['name' => 'yuewen_fs_gd', 'cfg' => $yuewen_fs_gd_phone],
+    ['name' => 'douxun_sec', 'cfg' => $douxun_sec_phone],
+    ['name' => 'miaoxt_tax_copy', 'cfg' => $miaoxt_tax_copy_phone],
+    ['name' => 'douxun_copy', 'cfg' => $douxun_copy_phone],
+    ['name' => 'douxun_sec_copy', 'cfg' => $douxun_sec_copy_phone],
+    ['name' => 'ruizhi_tax_copy', 'cfg' => $ruizhi_tax_copy_phone],
+    ['name' => 'meixu_tax', 'cfg' => $meixu_tax_phone],
+    ['name' => 'meixu_tax_sec', 'cfg' => $meixu_tax_sec_phone],
+    ['name' => 'ruizhi_sec', 'cfg' => $ruizhi_sec_phone],
+    ['name' => 'ruizhi_third', 'cfg' => $ruizhi_third_phone],
+    ['name' => 'xinhengyang_fs', 'cfg' => $xinhengyang_fs_phone],
 
 ];
 $config['phone_providers'] = $phone_providers;

+ 4 - 1
data/config/yl/base.ini.php

@@ -115,4 +115,7 @@ $config['wsd_bradge_port'] = 60987;
 $config['card_key_stores'] = [6];
 
 $config['phone_life_check'] = true;
-$config['admin_layout_skin'] = 'skin_1';
+$config['admin_layout_skin'] = 'skin_1';
+$config['fulu_mchid'] = [
+
+];

+ 97 - 64
data/config/yl/refill.ini.php

@@ -4121,27 +4121,31 @@ $cangxin_phone = ['name' => 'cangxin', 'store_id' => 174, 'qualitys' => '1',
 
 $cangxin_high_phone = ['name' => 'cangxin_high', 'store_id' => 175, 'qualitys' => '1',
     'amount' => [
-//        10 => [['goods_id' => 7480, 'price' => 9.55, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-//        20 => [['goods_id' => 7481, 'price' => 19.1, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        10 => [
+            ['goods_id' => 7480, 'price' => 9.75, 'quality' => 1, 'card_type' => 'chinamobile']
+        ],
+        20 => [
+            ['goods_id' => 7481, 'price' => 19.5, 'quality' => 1, 'card_type' => 'chinamobile']
+        ],
         30 => [
-            ['goods_id' => 7482, 'price' => 28.92, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 7482, 'price' => 28.8, 'quality' => 1, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 7482, 'price' => 28.8, 'quality' => 1, 'card_type' => 'chinatelecom'],
+            ['goods_id' => 7482, 'price' => 29.1, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 7482, 'price' => 28.2, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7482, 'price' => 28.86, 'quality' => 1, 'card_type' => 'chinatelecom'],
         ],
         50 => [
-            ['goods_id' => 7483, 'price' => 48.2, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 7483, 'price' => 48, 'quality' => 1, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 7483, 'price' => 48, 'quality' => 1, 'card_type' => 'chinatelecom'],
+            ['goods_id' => 7483, 'price' => 48.5, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 7483, 'price' => 47, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7483, 'price' => 48.1, 'quality' => 1, 'card_type' => 'chinatelecom'],
         ],
         100 => [
-            ['goods_id' => 7484, 'price' => 96.4, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 7484, 'price' => 96, 'quality' => 1, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 7484, 'price' => 96, 'quality' => 1, 'card_type' => 'chinatelecom'],
+            ['goods_id' => 7484, 'price' => 97, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 7484, 'price' => 94, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7484, 'price' => 96.2, 'quality' => 1, 'card_type' => 'chinatelecom'],
         ],
         200 => [
-            ['goods_id' => 7485, 'price' => 192.8, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 7485, 'price' => 192, 'quality' => 1, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 7485, 'price' => 192, 'quality' => 1, 'card_type' => 'chinatelecom'],
+            ['goods_id' => 7485, 'price' => 194, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 7485, 'price' => 188, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7485, 'price' => 192.4, 'quality' => 1, 'card_type' => 'chinatelecom'],
         ],
 //        300 => [['goods_id' => 7486, 'price' => 286.5, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
 //        500 => [['goods_id' => 7487, 'price' => 477.5, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']]
@@ -4292,34 +4296,34 @@ $youhenew_phone = ['name' => 'youhenew', 'store_id' => 179,'qualitys' => '1',
         ],
         20 => [
             ['goods_id' => 7513, 'price' => 19.5, 'quality' => 1, 'card_type' => 'chinamobile'],
-//            ['goods_id' => 7513, 'price' => 19.06, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7513, 'price' => 19.06, 'quality' => 1, 'card_type' => 'chinaunicom'],
 //            ['goods_id' => 7513, 'price' => 19.06, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         30 => [
-            ['goods_id' => 7514, 'price' => 28.86, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 7514, 'price' => 28.95, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 7514, 'price' => 28.14, 'quality' => 1, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 7514, 'price' => 28.71, 'quality' => 1, 'card_type' => 'chinatelecom']
+//            ['goods_id' => 7514, 'price' => 28.71, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         50 => [
-            ['goods_id' => 7515, 'price' => 48.1, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 7515, 'price' => 48.25, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 7515, 'price' => 46.9, 'quality' => 1, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 7515, 'price' => 48.75, 'quality' => 1, 'card_type' => 'chinatelecom']
+            ['goods_id' => 7515, 'price' => 48.25, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         100 => [
-            ['goods_id' => 7516, 'price' => 96.2, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 7516, 'price' => 96.5, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 7516, 'price' => 93.8, 'quality' => 1, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 7516, 'price' => 97.5, 'quality' => 1, 'card_type' => 'chinatelecom']
+            ['goods_id' => 7516, 'price' => 96.5, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         200 => [
-            ['goods_id' => 7517, 'price' => 192.4, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 7517, 'price' => 193, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 7517, 'price' => 187.6, 'quality' => 1, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 7517, 'price' => 195, 'quality' => 1, 'card_type' => 'chinatelecom']
+            ['goods_id' => 7517, 'price' => 193, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
-//        300 => [
+        300 => [
 //            ['goods_id' => 7518, 'price' => 287.4, 'quality' => 1, 'card_type' => 'chinamobile'],
-//            ['goods_id' => 7518, 'price' => 285.9, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7518, 'price' => 285.9, 'quality' => 1, 'card_type' => 'chinaunicom'],
 //            ['goods_id' => 7518, 'price' => 285.9, 'quality' => 1, 'card_type' => 'chinatelecom']
-//        ],
+        ],
 //        500 => [
 //            ['goods_id' => 7519, 'price' => 479, 'quality' => 1, 'card_type' => 'chinamobile'],
 //            ['goods_id' => 7519, 'price' => 476.5, 'quality' => 1, 'card_type' => 'chinaunicom'],
@@ -4465,16 +4469,16 @@ $chizeng_normal_phone = ['name' => 'chizeng_normal', 'store_id' => 182,'qualitys
 
 $xinhengyangnew_phone = ['name' => 'xinhengyangnew', 'store_id' => 183,'qualitys' => '1',
     'amount' => [
-//        10 => [
-//            ['goods_id' => 7553, 'price' => 9.54, 'quality' => 1, 'card_type' => 'chinamobile'],
+        10 => [
+            ['goods_id' => 7553, 'price' => 9.54, 'quality' => 1, 'card_type' => 'chinamobile'],
 //            ['goods_id' => 7553, 'price' => 9.53, 'quality' => 1, 'card_type' => 'chinaunicom'],
 //            ['goods_id' => 7553, 'price' => 9.54, 'quality' => 1, 'card_type' => 'chinatelecom']
-//        ],
-//        20 => [
-//            ['goods_id' => 7554, 'price' => 19.08, 'quality' => 1, 'card_type' => 'chinamobile'],
+        ],
+        20 => [
+            ['goods_id' => 7554, 'price' => 19.08, 'quality' => 1, 'card_type' => 'chinamobile'],
 //            ['goods_id' => 7554, 'price' => 19.06, 'quality' => 1, 'card_type' => 'chinaunicom'],
 //            ['goods_id' => 7554, 'price' => 19.08, 'quality' => 1, 'card_type' => 'chinatelecom']
-//        ],
+        ],
         30 => [
             ['goods_id' => 7555, 'price' => 28.77, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 7555, 'price' => 28.35, 'quality' => 1, 'card_type' => 'chinaunicom'],
@@ -6420,11 +6424,11 @@ $yezi_hf_phone = ['name' => 'yezi_hf', 'store_id' => 234, 'qualitys' => '1',
 $weixue_phone = ['name' => 'weixue', 'store_id' => 235, 'qualitys' => '1',
     'amount' => [
         10 => [
-//            ['goods_id' => 7963, 'price' => 9.67, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 7963, 'price' => 9.67, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 7963, 'price' => 9.68, 'quality' => 1, 'card_type' => 'chinaunicom']
         ],
         20 => [
-//            ['goods_id' => 7964, 'price' => 19.34, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 7964, 'price' => 19.34, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 7964, 'price' => 19.36, 'quality' => 1, 'card_type' => 'chinaunicom']
         ],
         30 => [
@@ -6847,27 +6851,31 @@ $youhe_fs_phone = ['name' => 'youhe_fs', 'store_id' => 252, 'qualitys' => '1',
 
 $yangchi_phone = ['name' => 'yangchi', 'store_id' => 253, 'qualitys' => '1',
     'amount' => [
-//        10 => [['goods_id' => 8107, 'price' => 9.6, 'quality' => 1, 'card_type' => 'chinamobile']],
-//        20 => [['goods_id' => 8108, 'price' => 19.2, 'quality' => 1, 'card_type' => 'chinamobile']],
+        10 => [
+            ['goods_id' => 8107, 'price' => 9.68, 'quality' => 1, 'card_type' => 'chinamobile'],
+        ],
+        20 => [
+            ['goods_id' => 8108, 'price' => 19.36, 'quality' => 1, 'card_type' => 'chinamobile'],
+        ],
         30 => [
 //            ['goods_id' => 8109, 'price' => 28.98, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 8109, 'price' => 28.05, 'quality' => 1, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 8109, 'price' => 29.04, 'quality' => 1, 'card_type' => 'chinatelecom'],
+            ['goods_id' => 8109, 'price' => 27.75, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8109, 'price' => 28.95, 'quality' => 1, 'card_type' => 'chinatelecom'],
         ],
         50 => [
-            ['goods_id' => 8110, 'price' => 48.3, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 8110, 'price' => 46.75, 'quality' => 1, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 8110, 'price' => 48.4, 'quality' => 1, 'card_type' => 'chinatelecom'],
+            ['goods_id' => 8110, 'price' => 48.4, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8110, 'price' => 46.25, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8110, 'price' => 48.25, 'quality' => 1, 'card_type' => 'chinatelecom'],
         ],
         100 => [
-            ['goods_id' => 8111, 'price' => 96.6, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 8111, 'price' => 93.5, 'quality' => 1, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 8111, 'price' => 96.8, 'quality' => 1, 'card_type' => 'chinatelecom'],
+            ['goods_id' => 8111, 'price' => 96.8, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8111, 'price' => 92.5, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8111, 'price' => 96.5, 'quality' => 1, 'card_type' => 'chinatelecom'],
         ],
         200 => [
-            ['goods_id' => 8112, 'price' => 193.2, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 8112, 'price' => 187, 'quality' => 1, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 8112, 'price' => 193.6, 'quality' => 1, 'card_type' => 'chinatelecom'],
+            ['goods_id' => 8112, 'price' => 193.6, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8112, 'price' => 185, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8112, 'price' => 193, 'quality' => 1, 'card_type' => 'chinatelecom'],
         ],
 //        300 => [
 //            ['goods_id' => 8113, 'price' => 267, 'quality' => 1, 'card_type' => 'chinaunicom']
@@ -6908,10 +6916,10 @@ $feimingyu_fs_phone = ['name' => 'feimingyu_fs', 'store_id' => 256, 'qualitys' =
     'amount' => [
 //        10 => [['goods_id' => 8131, 'price' => 9.5, 'quality' => 1, 'card_type' => 'chinatelecom']],
 //        20 => [['goods_id' => 8132, 'price' => 19, 'quality' => 1, 'card_type' => 'chinatelecom']],
-        30 => [['goods_id' => 8133, 'price' => 28.5, 'quality' => 1, 'card_type' => 'chinamobile, chinatelecom']],
-        50 => [['goods_id' => 8134, 'price' => 47.5, 'quality' => 1, 'card_type' => 'chinamobile, chinatelecom']],
-        100 => [['goods_id' => 8135, 'price' => 95, 'quality' => 1, 'card_type' => 'chinamobile, chinatelecom']],
-        200 => [['goods_id' => 8136, 'price' => 190, 'quality' => 1, 'card_type' => 'chinamobile, chinatelecom']],
+        30 => [['goods_id' => 8133, 'price' => 28.5, 'quality' => 1, 'card_type' => 'chinamobile,chinatelecom']],
+        50 => [['goods_id' => 8134, 'price' => 47.5, 'quality' => 1, 'card_type' => 'chinamobile,chinatelecom']],
+        100 => [['goods_id' => 8135, 'price' => 95, 'quality' => 1, 'card_type' => 'chinamobile,chinatelecom']],
+        200 => [['goods_id' => 8136, 'price' => 190, 'quality' => 1, 'card_type' => 'chinamobile,chinatelecom']],
 //        300 => [['goods_id' => 8137, 'price' => 285, 'quality' => 1, 'card_type' => 'chinatelecom']],
 //        500 => [['goods_id' => 8138, 'price' => 475, 'quality' => 1, 'card_type' => 'chinatelecom']]
     ],
@@ -6919,23 +6927,27 @@ $feimingyu_fs_phone = ['name' => 'feimingyu_fs', 'store_id' => 256, 'qualitys' =
 
 $hanwei_phone = ['name' => 'hanwei', 'store_id' => 258, 'qualitys' => '1',
     'amount' => [
-//        10 => [['goods_id' => 8145, 'price' => 9.6, 'quality' => 1, 'card_type' => 'chinamobile']],
-//        20 => [['goods_id' => 8146, 'price' => 19.2, 'quality' => 1, 'card_type' => 'chinamobile']],
+        10 => [['goods_id' => 8145, 'price' => 9.6, 'quality' => 1, 'card_type' => 'chinamobile']],
+        20 => [['goods_id' => 8146, 'price' => 19.2, 'quality' => 1, 'card_type' => 'chinamobile']],
         30 => [
 //            ['goods_id' => 8147, 'price' => 28.98, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 8147, 'price' => 28.2, 'quality' => 1, 'card_type' => 'chinaunicom']
+            ['goods_id' => 8147, 'price' => 28.2, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8147, 'price' => 28.2, 'quality' => 1, 'card_type' => 'chinatelecom'],
         ],
         50 => [
             ['goods_id' => 8148, 'price' => 48.3, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 8148, 'price' => 47, 'quality' => 1, 'card_type' => 'chinaunicom']
+            ['goods_id' => 8148, 'price' => 47, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8148, 'price' => 47, 'quality' => 1, 'card_type' => 'chinatelecom'],
         ],
         100 => [
             ['goods_id' => 8149, 'price' => 96.6, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 8149, 'price' => 94, 'quality' => 1, 'card_type' => 'chinaunicom']
+            ['goods_id' => 8149, 'price' => 94, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8149, 'price' => 94, 'quality' => 1, 'card_type' => 'chinatelecom'],
         ],
         200 => [
             ['goods_id' => 8150, 'price' => 193.2, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 8150, 'price' => 188, 'quality' => 1, 'card_type' => 'chinaunicom']
+            ['goods_id' => 8150, 'price' => 188, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8150, 'price' => 188, 'quality' => 1, 'card_type' => 'chinatelecom'],
         ],
 //        300 => [
 //            ['goods_id' => 8151, 'price' => 267, 'quality' => 1, 'card_type' => 'chinaunicom']
@@ -6950,10 +6962,10 @@ $hanwei_fs_phone = ['name' => 'hanwei_fs', 'store_id' => 259, 'qualitys' => '1',
     'amount' => [
 //        10 => [['goods_id' => 8153, 'price' => 9.5, 'quality' => 1, 'card_type' => 'chinamobile']],
 //        20 => [['goods_id' => 8154, 'price' => 19, 'quality' => 1, 'card_type' => 'chinamobile']],
-        30 => [['goods_id' => 8155, 'price' => 28.5, 'quality' => 1, 'card_type' => 'chinamobile']],
-        50 => [['goods_id' => 8156, 'price' => 47.5, 'quality' => 1, 'card_type' => 'chinamobile']],
-        100 => [['goods_id' => 8157, 'price' => 95, 'quality' => 1, 'card_type' => 'chinamobile']],
-        200 => [['goods_id' => 8158, 'price' => 190, 'quality' => 1, 'card_type' => 'chinamobile']],
+        30 => [['goods_id' => 8155, 'price' => 28.5, 'quality' => 1, 'card_type' => 'chinamobile,chinatelecom']],
+        50 => [['goods_id' => 8156, 'price' => 47.5, 'quality' => 1, 'card_type' => 'chinamobile,chinatelecom']],
+        100 => [['goods_id' => 8157, 'price' => 95, 'quality' => 1, 'card_type' => 'chinamobile,chinatelecom']],
+        200 => [['goods_id' => 8158, 'price' => 190, 'quality' => 1, 'card_type' => 'chinamobile,chinatelecom']],
 //        300 => [['goods_id' => 8159, 'price' => 285, 'quality' => 1, 'card_type' => 'chinamobile']],
 //        500 => [['goods_id' => 8160, 'price' => 475, 'quality' => 1, 'card_type' => 'chinamobile']]
     ],
@@ -6987,8 +6999,21 @@ $yuewen_phone = ['name' => 'yuewen', 'store_id' => 260, 'qualitys' => '1',
             ['goods_id' => 8166, 'price' => 186, 'quality' => 1, 'card_type' => 'chinaunicom'],
             ['goods_id' => 8166, 'price' => 192.6, 'quality' => 1, 'card_type' => 'chinatelecom'],
         ],
-//        300 => [['goods_id' => 8167, 'price' => 288, 'quality' => 1, 'card_type' => 'chinamobile']],
-//        500 => [['goods_id' => 8168, 'price' => 480, 'quality' => 1, 'card_type' => 'chinamobile']]
+        300 => [['goods_id' => 8167, 'price' => 288, 'quality' => 1, 'card_type' => 'chinaunicom']],
+        500 => [['goods_id' => 8168, 'price' => 480, 'quality' => 1, 'card_type' => 'chinaunicom']]
+    ],
+    'official_sn' => true, 'refill_type' => 'api'];
+
+$xinhengyang_fs_phone = ['name' => 'xinhengyang_fs', 'store_id' => 262, 'qualitys' => '1',
+    'amount' => [
+//        10 => [['goods_id' => 8170, 'price' => 9.5, 'quality' => 1, 'card_type' => 'chinatelecom']],
+//        20 => [['goods_id' => 8171, 'price' => 19, 'quality' => 1, 'card_type' => 'chinatelecom']],
+        30 => [['goods_id' => 8172, 'price' => 28.5, 'quality' => 1, 'card_type' => 'chinamobile, chinatelecom']],
+        50 => [['goods_id' => 8173, 'price' => 47.5, 'quality' => 1, 'card_type' => 'chinamobile, chinatelecom']],
+        100 => [['goods_id' => 8174, 'price' => 95, 'quality' => 1, 'card_type' => 'chinamobile, chinatelecom']],
+        200 => [['goods_id' => 8175, 'price' => 190, 'quality' => 1, 'card_type' => 'chinamobile, chinatelecom']],
+//        300 => [['goods_id' => 8176, 'price' => 285, 'quality' => 1, 'card_type' => 'chinatelecom']],
+//        500 => [['goods_id' => 8177, 'price' => 475, 'quality' => 1, 'card_type' => 'chinatelecom']]
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 
@@ -7212,6 +7237,7 @@ $phone_providers = [
     ['name' => 'hanwei', 'cfg' => $hanwei_phone],
     ['name' => 'hanwei_fs', 'cfg' => $hanwei_fs_phone],
     ['name' => 'yuewen', 'cfg' => $yuewen_phone],
+    ['name' => 'xinhengyang_fs', 'cfg' => $xinhengyang_fs_phone],
 ];
 $config['phone_providers'] = $phone_providers;
 
@@ -7253,10 +7279,17 @@ $jiyemei_doubi = ['name' => 'jiyemei_doubi', 'store_id' => 173,'qualitys' => '1'
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 
+$runpu = ['name' => 'runpu', 'store_id' => 261, 'qualitys' => '1',
+    'amount' => [
+        100 => [['goods_id' => 8169, 'price' => 99, 'quality' => 1, 'card_type' => 'third']],
+    ],
+    'official_sn' => true, 'refill_type' => 'api'];
+
 $third_providers = [
+    ['name' => 'runpu', 'cfg' => $runpu],
 //    ['name' => 'lingzhthird', 'cfg' => $lingzhthird],
 //    ['name' => 'jumithird', 'cfg' => $jumithird],
-//    ['name' => 'santi', 'cfg' => $santi],
+    ['name' => 'santi', 'cfg' => $santi],
 //    ['name' => 'yanhao', 'cfg' => $yanhao],
 //    ['name' => 'xiaoniu_doubi', 'cfg' => $xiaoniu_doubi],
 //    ['name' => 'jiyemei_doubi', 'cfg' => $jiyemei_doubi]

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

@@ -10,7 +10,7 @@ services:
       - /nfs/upload:/var/www/html/data/upload
       - /mnt/testlog:/var/www/html/data/log
     container_name: "panda-codispatcher"
-    command: [php,"/var/www/html/rdispatcher/codispatcher.php","32"]
+    command: [php,"/var/www/html/rdispatcher/codispatcher.php","1"]
     deploy:
       resources:
         limits:

+ 1 - 0
helper/rbridge/RBridgeFactory.php

@@ -8,6 +8,7 @@ require_once(BASE_HELPER_PATH . '/rbridge/wsd/Bridge.php');
 require_once(BASE_HELPER_PATH . '/rbridge/fulu/Bridge.php');
 require_once(BASE_HELPER_PATH . '/rbridge/fulu_ylyw/Bridge.php');
 require_once(BASE_HELPER_PATH . '/rbridge/fulu_youjun/Bridge.php');
+require_once(BASE_HELPER_PATH . '/rbridge/fulu_qdw/Bridge.php');
 
 use Exception;
 use Log;

+ 4 - 0
helper/rbridge/fulu/Bridge.php

@@ -48,6 +48,10 @@ class Bridge implements IBridge
         if (!in_array($chargeType, [1, 3, 4], true)) {
             return [false, '订单类型不支持'];
         }
+        $SupBuyNum = $params['SupBuyNum'];
+        if($SupBuyNum > 1) {
+            return [false, '不支持多数量下单'];
+        }
 
         Model('merchant_query')->add_info($mchid, $params['Id'], json_encode($params));
         $mchinfo = Model('merchant')->getMerchantInfo(['mchid' => $mchid]);

+ 163 - 0
helper/rbridge/fulu_qdw/Bridge.php

@@ -0,0 +1,163 @@
+<?php
+
+namespace rbridge\fulu_qdw;
+
+require_once(BASE_HELPER_PATH . '/rbridge/fulu_qdw/config.php');
+
+use rbridge\IBridge;
+use refill;
+use Log;
+use StatesHelper;
+
+class Bridge implements IBridge
+{
+    public function add($params)
+    {
+        if(StatesHelper::fetch_state('bridge')) {
+            include (BASE_HELPER_PATH . '/rbridge/fulu_qdw/product.php');
+        }
+
+        $dispatcher = function ($product_num)
+        {
+            global $fulu_qdw_product;
+            if(empty($fulu_qdw_product)) return [config::DEFAULT_MCHID,[]];
+
+            foreach ($fulu_qdw_product as $mchid => $product_infos)
+            {
+                if(array_key_exists($product_num, $product_infos)) {
+                    $card_types = $product_infos[$product_num];
+                    return [$mchid,$card_types];
+                }
+            }
+
+            return [config::DEFAULT_MCHID,[]];
+        };
+
+        $params = $this->aes_decrypt($params);
+        if (empty($params)) {
+            return [false, '数据解密失败'];
+        }
+        $json_str = json_encode($params);
+        Log::record("fulu_qdw add params: {$json_str}", Log::DEBUG);
+
+        $SupProductId = $params['SupProductId'];
+        [$mchid,$mch_card_types] = $dispatcher($SupProductId);
+        $chargeType = intval($params['OrderType']);
+
+        //订单类型:1话费 2流量 3卡密 4直充,
+        if (!in_array($chargeType, [1, 3, 4], true)) {
+            return [false, '订单类型不支持'];
+        }
+        $SupBuyNum = $params['SupBuyNum'];
+        if($SupBuyNum > 1) {
+            return [false, '不支持多数量下单'];
+        }
+
+        Model('merchant_query')->add_info($mchid, $params['Id'], json_encode($params));
+        $mchinfo = Model('merchant')->getMerchantInfo(['mchid' => $mchid]);
+        $userid = intval($mchinfo['admin_id']);
+
+        $order_time = time();
+        $mch_order = $params['Id'];
+        $card_no = $params['ChargeAccount'];
+        $input = [ 'mchid' => $mchid,
+            'buyer_id' => $userid,
+            'amount' => $params['SupProductFaceValue'],
+            'card_no' => $card_no,
+            'mch_order' => $mch_order,
+            'mch_card_types' => $mch_card_types,
+            'notify_url' => config::MCH_NOTIFY_URL,
+            'order_time' => $order_time
+        ];
+
+        refill\util::push_queue_order($mchid,$mch_order,ORDER_STATE_QUEUE);
+        Model('refill_order')->add_detail($mchid,$mch_order,$order_time,$params,ORDER_STATE_QUEUE);
+
+        $state = refill\util::push_add($input);
+        if ($state === true) {
+            Log::record("fulu_qdw::Bridge refill::util::push_add success mchid={$mchid} mch_order={$mch_order} state={$state}",Log::DEBUG);
+            return [true, '提交成功'];
+        } else {
+            refill\util::del_queue_order($mchid,$mch_order);
+            Model('refill_order')->del_detail($mchid,$mch_order);
+            Log::record("fulu_qdw::Bridge refill::util::push_add error mchid={$mchid} mch_order={$mch_order} state={$state}",Log::DEBUG);
+            return [false, '提交失败'];
+        }
+    }
+
+    public function notify($params)
+    {
+        $mchid = $params['mchid'];
+        $mch_ordersn = $params['order_sn'];
+        $body = $this->notify_body($params);
+
+        $userID = config::USER_ID;
+        $header = [
+            'Content-Type: application/json',
+            "OrderNo: {$mch_ordersn}",
+            "UserID: {$userID}",
+        ];
+
+        $body = json_encode($body, JSON_UNESCAPED_UNICODE);
+        $body = $this->aes_encrypt($body);
+        $reqData['PostData'] = $body;
+        $reqData = json_encode($reqData, JSON_UNESCAPED_UNICODE);
+
+        $resp = http_post_data(config::ORDER_COMPLETE_URL, $reqData, $header, $net_errno);
+        if (empty($resp)) {
+            Log::record("回调下游,请求超时 mchid = {$mchid} mch_order = {$mch_ordersn}", Log::ERR);
+            return false;
+        }
+        else
+        {
+            Log::record($resp, Log::DEBUG);
+            $resp = json_decode($resp, true);
+            if (empty($resp)) {
+                Log::record("回调下游,返回数据格式有误 mchid = {$mchid} mch_order = {$mch_ordersn}", Log::ERR);
+                return false;
+            } elseif ($resp['code'] === '200' && $resp['data'] === true) {
+                return true;
+            } else {
+                Log::record("回调下游,返回失败 mchid = {$mchid} mch_order = {$mch_ordersn} message = {$resp['message']}", Log::ERR);
+                return false;
+            }
+        }
+    }
+
+    private function notify_body($params)
+    {
+        $success = $params['state'] == 'SUCCESS';
+        $body = [
+            "OrderNo" => $params['order_sn'],
+            "Status" => $success ? 1 : 2,
+            "Description" => '',
+            "RealCost" => "",
+            "SubstituteAccount" => "",
+            "ChannelAccountId" => "",
+            "InventoryId" => "",
+            "OperatorSerialNumber" => ""
+        ];
+
+        if($body['Status'] === 1) {
+            $body['OperatorSerialNumber'] = $params['official_sn'];
+        }
+
+        return $body;
+    }
+
+    private function aes_encrypt($data) {
+        $str_padded = $data;
+        if (strlen($str_padded) % 16) {
+            $str_padded = str_pad($str_padded,strlen($str_padded) + 16 - strlen($str_padded) % 16, "\0");
+        }
+        $data =  openssl_encrypt($str_padded, 'AES-128-CBC', config::KEY, OPENSSL_NO_PADDING, config::AES_IV);
+        return base64_encode($data);
+    }
+
+    //AES-128-ECB解密  data 字符串
+    private function aes_decrypt($data) {
+        $encrypted = base64_decode($data);
+        $params = openssl_decrypt($encrypted, 'AES-128-CBC', config::KEY, OPENSSL_NO_PADDING, config::AES_IV);
+        return json_decode(trim($params), true);
+    }
+}

+ 23 - 0
helper/rbridge/fulu_qdw/config.php

@@ -0,0 +1,23 @@
+<?php
+
+namespace rbridge\fulu_qdw;
+
+class config
+{
+    const DEFAULT_MCHID = 10328;
+    const MCH_KEY  = '';
+    const MCH_NOTIFY_URL = 'fulu_qdw';
+
+    const AES_IV = '1111111111111111';
+    const KEY   = 'jAQB*jCGppBb3_BU';
+    const USER_ID = 'cc790b12-d636-4d7b-863d-5ec0ec964a1b';
+
+    const ORDER_SEND_URL = 'https://public-robot.open.fulu.com/api/OutOrder/UpdateStatusProcess'; //配送中
+    const ORDER_COMPLETE_URL = 'https://public-robot.open.fulu.com/api/OutOrder/UpdateStatus'; //成功/失败/可疑
+
+    const ORDER_STATUS = [
+        ORDER_STATE_SUCCESS => 1,
+        ORDER_STATE_CANCEL  => 2,
+    ];
+}
+

+ 20 - 0
helper/rbridge/fulu_qdw/product.php

@@ -0,0 +1,20 @@
+<?php
+
+namespace rbridge\fulu_qdw;
+
+global $fulu_qdw_product;
+$fulu_qdw_product = [
+    10328 => [
+        507750379 => [4, 5, 6],
+        502503703 => [4, 5, 6],
+        506934469 => [4, 5, 6],
+    ],
+
+    10329 => [
+        509336009 => [4, 5, 6],
+        507245319 => [4, 5, 6],
+        505425072 => [4, 5, 6],
+        505900095 => [4, 5, 6],
+    ],
+];
+

+ 30 - 0
helper/rbridge/fulu_qdw/readme.txt

@@ -0,0 +1,30 @@
+福禄开放平台我要供货教程-客户版 https://docs.qq.com/doc/DVmZ5QWhhQnFMQUNW
+物流自助服务使用教程-客户版 https://docs.qq.com/doc/DVnVQSERJdnZWTFRZ
+物流接口文档-V2.0 https://www.yuque.com/docs/share/4d5956bb-ca0f-46a2-a5e3-dd110f81a7ec?#
+
+http://console.open.fulu.com/
+
+公司:北京趣带娃科技有限公司(新)
+账号:17801048874
+密码:xy123456
+
+UserId:
+cc790b12-d636-4d7b-863d-5ec0ec964a1b
+UserKey:
+jAQB*jCGppBb3_BU
+aesIV=1111111111111111
+
+https://www.xyzshops.cn/mobile/bridge/fulu_qdw.php
+
+机构id:10328
+
+507750379 50
+502503703 100
+506934469 200
+
+机构id:10329
+
+509336009 50
+507245319 100
+505425072 200
+505900095 500

+ 4 - 0
helper/rbridge/fulu_ylyw/Bridge.php

@@ -48,6 +48,10 @@ class Bridge implements IBridge
         if (!in_array($chargeType, [1, 3, 4], true)) {
             return [false, '订单类型不支持'];
         }
+        $SupBuyNum = $params['SupBuyNum'];
+        if($SupBuyNum > 1) {
+            return [false, '不支持多数量下单'];
+        }
 
         Model('merchant_query')->add_info($mchid, $params['Id'], json_encode($params));
         $mchinfo = Model('merchant')->getMerchantInfo(['mchid' => $mchid]);

+ 7 - 0
helper/rbridge/fulu_ylyw/product.php

@@ -11,5 +11,12 @@ $fulu_ylyw_product = [
         508604768 => [4, 5, 6],
         506875500 => [4, 5, 6],
     ],
+
+    10327 => [
+        //移动
+        509090268 => [4, 5, 6],
+        507634297 => [4, 5, 6],
+        503855886 => [4, 5, 6],
+    ],
 ];
 

+ 5 - 0
helper/rbridge/fulu_ylyw/readme.txt

@@ -32,3 +32,8 @@ https://www.xyzshops.cn/mobile/bridge/fulu_ylyw.php
 
 2022.12.27
 506875500
+
+2023.1.2
+下架 509090268 三网通话费-全国-50元-直充-【95%成功率1-15分回调】
+下架 507634297 三网通话费-全国-100元-直充-【95%成功率 1-15分回调】
+下架 503855886 三网通话费-全国-200元-直充-【95%成功率 1-15分回调】

+ 4 - 0
helper/rbridge/fulu_youjun/Bridge.php

@@ -48,6 +48,10 @@ class Bridge implements IBridge
         if (!in_array($chargeType, [1, 3, 4], true)) {
             return [false, '订单类型不支持'];
         }
+        $SupBuyNum = $params['SupBuyNum'];
+        if($SupBuyNum > 1) {
+            return [false, '不支持多数量下单'];
+        }
 
         Model('merchant_query')->add_info($mchid, $params['Id'], json_encode($params));
         $mchinfo = Model('merchant')->getMerchantInfo(['mchid' => $mchid]);

+ 7 - 2
helper/refill/ProviderManager.php

@@ -78,7 +78,7 @@ class ProviderManager
                     foreach ($types as $type) {
                         $this->mAllQMapPTS[$quality]["{$name}-{$type}-{$spec}"] = ['goods_id' => $gitem['goods_id'],'price' => $gitem['price'],'provider' => $provider];
                         $this->mSpecTypes[$quality]["{$type}-{$spec}"][] = $name;
-                        Log::record("map_cfg: {$type}-{$spec}",Log::DEBUG);
+                        Log::record("map_cfg: quality={$quality} {$type}-{$spec} {$name}",Log::DEBUG);
                     }
                 }
             }
@@ -214,9 +214,14 @@ class ProviderManager
                 $provider = $this->mProviders[$name];
                 $opened = $provider->opened();
 
-                if($opened == false) continue;
+                if($opened == false) {
+                    continue;
+                }
+
                 if($provider->match_regin($card_type,$regin_no)) {
                     $providers[] = $provider;
+                } else {
+                    Log::record("get_providers quality = {$quality} , key = {$key} name={$name} regin={$regin_no} match_regin fail",Log::DEBUG);
                 }
             }
             return $providers;

+ 18 - 0
helper/refill/api/xyz/bier_fs/config.php

@@ -116,6 +116,21 @@ class config
                 30 => 'CTCCAHr30r', 50 => 'CTCCAHr50r',
                 100 => 'CTCCAHr100r', 200 => 'CTCCAHr200r'
             ],
+            //江苏
+            10 => [
+                30 => 'CTCCJSr30r', 50 => 'CTCCJSr50r',
+                100 => 'CTCCJSr100r', 200 => 'CTCCJSr200r'
+            ],
+            //福建
+            13 => [
+                30 => 'CTCCFJr30r', 50 => 'CTCCFJr50r',
+                100 => 'CTCCFJr100r', 200 => 'CTCCFJr200r'
+            ],
+            //浙江
+            11 => [
+                30 => 'CTCCZJr30r', 50 => 'CTCCZJr50r',
+                100 => 'CTCCZJr100r', 200 => 'CTCCZJr200r'
+            ],
         ]
     ];
 
@@ -150,5 +165,8 @@ class config
         "6-50-9" => 47.75, "6-100-9" => 95.5, "6-200-9" => 191,//上海 9
         "6-30-18" => 28.8, "6-50-18" => 48, "6-100-18" => 96, "6-200-18" => 192,//湖南 18
         "6-30-12" => 28.8, "6-50-12" => 48, "6-100-12" => 96, "6-200-12" => 192,//安徽 12
+        "6-30-10" => 28.65, "6-50-10" => 47.75, "6-100-10" => 95.5, "6-200-10" => 191,//江苏 10
+        "6-30-13" => 28.65, "6-50-13" => 47.75, "6-100-13" => 95.5, "6-200-13" => 191,//福建 13
+        "6-30-11" => 28.65, "6-50-11" => 47.75, "6-100-11" => 95.5, "6-200-11" => 191,//浙江 11
     ];
 }

+ 22 - 0
helper/refill/api/xyz/bier_fs/椰子.txt

@@ -145,3 +145,25 @@ CMCCSCr200r
 CMCCCQr50r
 CMCCCQr100r
 CMCCCQr200r
+
+2023.1.29
+新增电信分省  江苏,福建,折扣0.955
+江苏电信分省产品编码
+CTCCJSr30r
+CTCCJSr50r
+CTCCJSr100r
+CTCCJSr200r
+福建电信分省产品编码
+CTCCFJr30r
+CTCCFJr50r
+CTCCFJr100r
+CTCCFJr200r
+
+2023.2.13
+比尔
+浙江电信 30-200 折扣955
+
+CTCCZJr30r
+CTCCZJr50r
+CTCCZJr100r
+CTCCZJr200r

+ 3 - 1
helper/refill/api/xyz/cangxin_high/config.php

@@ -15,6 +15,8 @@ class config
     const NOTIFY_URL = BASE_SITE_URL . "/mobile/callback/refill_cangxin_high.php";
     const PRODUCT = [
         mtopcard\ChinaMobileCard => [
+            10  => 1320010,
+            20  => 1320020,
             30  => 1320030,
             50  => 1320050,
             100 => 1320100,
@@ -34,4 +36,4 @@ class config
         ],
     ];
     const ExtHeaders = ['Content-Type:application/x-www-form-urlencoded;charset=utf-8'];
-}
+}

+ 4 - 0
helper/refill/api/xyz/cangxin_high/开户信息.txt

@@ -14,3 +14,7 @@
 3320050  全国联通50元
 3320100  全国联通100元
 3320200  全国联通200元
+
+2023.1.4
+10 1320010
+20 1320020

二進制
helper/refill/api/xyz/dazhanggui_fs/20230105贵州移动调价函.png


二進制
helper/refill/api/xyz/dazhanggui_fs/20230113福建移动调价函.jpg


二進制
helper/refill/api/xyz/dazhanggui_fs/20230205云南移动调价函.jpg


+ 16 - 0
helper/refill/api/xyz/dazhanggui_fs/api.txt

@@ -136,3 +136,19 @@
 1500050
 1500100
 1500200
+
+
+2023.2.1
+3350030   福建电信30元
+3350050   福建电信50元
+3350100   福建电信100元
+3350200   福建电信200元
+
+2023.2.13
+浙江电信  30--200面值 折扣935
+
+商品编码
+3330030   浙江电信30元
+3330050   浙江电信50元
+3330100   浙江电信100元
+3330200   浙江电信200元

+ 19 - 3
helper/refill/api/xyz/dazhanggui_fs/config.php

@@ -164,6 +164,20 @@ class config
                 100 => 3320100,
                 200 => 3320200,
             ],
+            //福建
+            13 => [
+                30  => 3350030,
+                50  => 3350050,
+                100 => 3350100,
+                200 => 3350200,
+            ],
+            //浙江
+            11 => [
+                30  => 3330030,
+                50  => 3330050,
+                100 => 3330100,
+                200 => 3330200,
+            ],
         ],
     ];
 
@@ -173,9 +187,9 @@ class config
         "4-50-10" => 47.25, "4-100-10" => 94.5, "4-200-10" => 189,//江苏 10
         "4-50-15" => 47.25, "4-100-15" => 94.5, "4-200-15" => 189,//山东 15
         "4-30-19" => 28.65, "4-50-19" => 47.75, "4-100-19" => 95.5, "4-200-19" => 191,//广东 19
-        "4-30-24" => 27.6, "4-50-24" => 46, "4-100-24" => 92, "4-200-24" => 184,//贵州 24
-        "4-30-13" => 27.9, "4-50-13" => 46.5, "4-100-13" => 93, "4-200-13" => 186,//福建 13
-        "4-30-25" => 28.08, "4-50-25" => 46.8, "4-100-25" => 93.6, "4-200-25" => 187.2,//云南 25
+        "4-30-24" => 27.9, "4-50-24" => 46.5, "4-100-24" => 93, "4-200-24" => 186,//贵州 24
+        "4-30-13" => 27.9, "4-50-13" => 47, "4-100-13" => 94, "4-200-13" => 188,//福建 13
+        "4-30-25" => 28.08, "4-50-25" => 47.1, "4-100-25" => 94.2, "4-200-25" => 188.4,//云南 25
         "4-30-16" => 28.2, "4-50-16" => 47, "4-100-16" => 94, "4-200-16" => 188,//河南 16
         "4-30-11" => 28.95, "4-50-11" => 48.25, "4-100-11" => 96.5, "4-200-11" => 193,//浙江 11
         "4-50-3" => 47, "4-100-3" => 94, "4-200-3" => 188,//河北 3
@@ -192,6 +206,8 @@ class config
         "6-30-15" => 28.2, "6-50-15" => 47, "6-100-15" => 94, "6-200-15" => 188,//山东 15
         "6-30-25" => 28.2, "6-50-25" => 47, "6-100-25" => 94, "6-200-25" => 188,//云南 25
         "6-30-10" => 28.5, "6-50-10" => 47.5, "6-100-10" => 95, "6-200-10" => 190,//江苏 10
+        "6-30-13" => 27.9, "6-50-13" => 46.5, "6-100-13" => 93, "6-200-13" => 186,//福建 13
+        "6-30-11" => 28.05, "6-50-11" => 46.75, "6-100-11" => 93.5, "6-200-11" => 187,//浙江 11
     ];
 
 }

二進制
helper/refill/api/xyz/dazhanggui_fs_gd/20230203广东移动调价函.jpg


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

@@ -39,7 +39,7 @@ class config
     //key格式 卡类型-面值-regin_no
     const Price = [
         //移动
-        "4-50-19" => 47.75, "4-100-19" => 95.5, "4-200-19" => 191,//广东 19
+        "4-50-19" => 48, "4-100-19" => 96, "4-200-19" => 192,//广东 19
     ];
 
 }

二進制
helper/refill/api/xyz/dezhi_fs/20221230江苏浙江移动调价函.jpg


二進制
helper/refill/api/xyz/dezhi_fs/20230101江苏二次调价函.jpg


二進制
helper/refill/api/xyz/dezhi_fs/20230101江苏移动调价函.jpg


二進制
helper/refill/api/xyz/dezhi_fs/20230104贵州移动调价函.jpg


二進制
helper/refill/api/xyz/dezhi_fs/20230112江苏移动调价函.jpg


二進制
helper/refill/api/xyz/dezhi_fs/20230208广西移动调价函.jpg


二進制
helper/refill/api/xyz/dezhi_fs/20230212江苏移动调价函.jpg


二進制
helper/refill/api/xyz/dezhi_fs/20230212贵州移动调价函.jpg


二進制
helper/refill/api/xyz/dezhi_fs/20230213广西移动调价函.jpg


二進制
helper/refill/api/xyz/dezhi_fs/20230217广西移动调价函.png


+ 5 - 2
helper/refill/api/xyz/dezhi_fs/config.php

@@ -28,14 +28,15 @@ class config
     const Price = [
         //移动
         "4-30-24" => 27.6, "4-50-24" => 46, "4-100-24" => 92, "4-200-24" => 184,//贵州 24
-        "4-30-10" => 28.08, "4-50-10" => 46.8, "4-100-10" => 93.6, "4-200-10" => 187.2,//江苏 10
+        "4-30-10" => 28.05, "4-50-10" => 48.1, "4-100-10" => 96.2, "4-200-10" => 192.4,//江苏 10
         "4-30-15" => 28.56, "4-50-15" => 47.6, "4-100-15" => 95.2, "4-200-15" => 190.4,//山东 15
         "4-30-13" => 28.08, "4-50-13" => 46.8, "4-100-13" => 93.6, "4-200-13" => 187.2,//福建 13
         "4-30-25" => 28.44, "4-50-25" => 47.4, "4-100-25" => 94.8, "4-200-25" => 189.6,//云南 25
         "4-50-16" => 46.9, "4-100-16" => 93.8, "4-200-16" => 187.6,//河南 16
         "4-50-3" => 47.1, "4-100-3" => 94.2, "4-200-3" => 188.4,//河北 3
-        "4-50-20" => 46.6, "4-100-20" => 93.2, "4-200-20" => 186.4,//广西 20
+        "4-50-20" => 46.75, "4-100-20" => 93.5, "4-200-20" => 187,//广西 20
         "4-30-23" => 28.26, "4-50-23" => 47.1, "4-100-23" => 94.2, "4-200-23" => 188.4,//四川 23
+        "4-50-11" => 47.6, "4-100-11" => 95.2, "4-200-11" => 190.4,//浙江 11
 
         //电信
         "6-30-19" => 28.26, "6-50-19" => 47.1, "6-100-19" => 94.2, "6-200-19" => 188.4,//广东 19
@@ -43,5 +44,7 @@ class config
         "6-30-23" => 27.84, "6-50-23" => 46.4, "6-100-23" => 92.8, "6-200-23" => 185.6,//四川 23
         "6-30-2" => 27.99, "6-50-2" => 46.65, "6-100-2" => 93.3, "6-200-2" => 186.6,//天津 2
         "6-30-18" => 28.44, "6-50-18" => 47.4, "6-100-18" => 94.8, "6-200-18" => 189.6,//湖南 18
+        "6-30-13" => 27.96, "6-50-13" => 46.6, "6-100-13" => 93.2, "6-200-13" => 186.4,//福建 13
+        "6-30-11" => 28.14, "6-50-11" => 46.9, "6-100-11" => 93.8, "6-200-11" => 187.6,//浙江 11
     ];
 }

+ 2 - 2
helper/refill/api/xyz/douxun/RefillCallBack.php

@@ -18,7 +18,7 @@ class RefillCallBack implements refill\IRefillCallBack
 
     private function sign($params)
     {
-        $content = config::custInteId . $params['echo'] . config::KEY . $params['timestamp'];
+        $content = config::custInteId . $params['head']['echo'] . config::KEY . $params['head']['timestamp'];
         return base64_encode(md5($content, true));
     }
 
@@ -26,7 +26,7 @@ class RefillCallBack implements refill\IRefillCallBack
     {
         $item = $params['body']['item'];
         $status = $item['result'];
-        $order_sn = $params['id'];
+        $order_sn = $item['orderId'];
         $order_info = Model('vr_order')->getOrderInfoForNotify(['order_sn' => $order_sn]);
         if (empty($order_info)) {
             return [false, false, false,false];

+ 45 - 0
helper/refill/api/xyz/douxun_copy/RefillCallBack.php

@@ -0,0 +1,45 @@
+<?php
+namespace refill\douxun_copy;
+
+require_once(BASE_HELPER_RAPI_PATH . '/douxun_copy/config.php');
+
+use refill;
+class RefillCallBack implements refill\IRefillCallBack
+{
+    public function verify($params): bool
+    {
+        $sign = $this->sign($params);
+        if ($params['head']['chargeSign'] == $sign) {
+            return true;
+        } else {
+            return false;
+        }
+    }
+
+    private function sign($params)
+    {
+        $content = config::custInteId . $params['head']['echo'] . config::KEY . $params['head']['timestamp'];
+        return base64_encode(md5($content, true));
+    }
+
+    public function notify($params)
+    {
+        $item = $params['body']['item'];
+        $status = $item['result'];
+        $order_sn = $item['orderId'];
+        $order_info = Model('vr_order')->getOrderInfoForNotify(['order_sn' => $order_sn]);
+        if (empty($order_info)) {
+            return [false, false, false,false];
+        }
+
+        $order_id = $order_info['order_id'];
+        if ($status === '0000') {
+            $data['official_sn'] = strtolower($item['operatorNo']) == 'null' ? '' : $item['operatorNo'];
+            Model('refill_order')->edit($order_id, $data);
+            return [$order_id, true, false,true];
+        }
+        else {
+            return [$order_id, false, true,true];
+        }
+    }
+}

+ 188 - 0
helper/refill/api/xyz/douxun_copy/RefillPhone.php

@@ -0,0 +1,188 @@
+<?php
+namespace refill\douxun_copy;
+
+require_once(BASE_HELPER_RAPI_PATH . '/douxun_copy/config.php');
+
+use refill;
+use Log;
+class RefillPhone extends refill\IRefillPhone
+{
+    public function __construct($cfgs)
+    {
+        parent::__construct($cfgs);
+    }
+
+    private function req_params(int $phone, int $card_type, int $amount, string $order_sn)
+    {
+        $head['custInteId'] = config::custInteId;
+        $head['orderId'] = $order_sn;
+        $head['orderType'] = 1;
+        $head['echo'] = rand(100000,999999);
+        $head['timestamp'] = date("YmdHis");
+        $head['version'] = 1;
+
+        $params['packCode'] = config::PRODUCT[$card_type][$amount];
+        $params['mobile'] = $phone;
+        $params['effectType'] = 1;
+        $params['mobileOper'] = config::operator[$card_type];
+        return [$head,$params];
+    }
+
+    public function add($card_no, $card_type, $amount, $params, &$net_errno = 0)
+    {
+        $order_sn = $params['order_sn'];
+        [$head,$params] = $this->req_params($card_no, $card_type, $amount, $order_sn);
+        $sign = $this->sign($head);
+        $head['chargeSign'] = $sign;
+
+        $data = [
+            'head' => $head,
+            'body' => [
+                'item' => $params
+            ]
+        ];
+        $xmlData = $this->toXmlData($data);
+
+        $resp = http_post_data(config::ORDER_URL, $xmlData, config::ExtHeaders, $net_errno);
+
+        if (empty($resp)) {
+            return [false, '网络错误', true];
+        }
+        else
+        {
+            Log::record($resp, Log::DEBUG);
+            $resp = refill\util::xmlToArray($resp);
+            if (empty($resp)) {
+                return [false, '网络错误', true];
+            } elseif ($resp['result'] === '0000') {
+                return [true, '', false];
+            } else {
+                return [false, $resp['desc'], false];
+            }
+        }
+    }
+
+    public function query($refill_info)
+    {
+        if (time() - $refill_info['commit_time'] > 86400*30) {
+            return [false, '时效已过'];
+        }
+        $head['custInteId'] = config::custInteId;
+        $head['echo'] = rand(100000,999999);
+        $head['timestamp'] = date("YmdHis");
+        $head['version'] = 1;
+        $content = $head['custInteId'] . config::KEY . $head['echo'] . $head['timestamp'];
+        $head['chargeSign'] = base64_encode(md5($content, true));
+
+        $params['orderIds'] = $refill_info['order_sn'];
+        $data = [
+            'head' => $head,
+            'body' => [
+                'item' => $params
+            ]
+        ];
+        $xmlData = $this->toXmlData($data);
+        $resp = http_post_data(config::QUERY_URL, $xmlData, config::ExtHeaders);
+
+        if (empty($resp)) {
+            return [false, '网络错误'];
+        }
+        else
+        {
+            Log::record($resp, Log::DEBUG);
+            $resp = refill\util::xmlToArray($resp);
+            if (empty($resp)) {
+                return [false, '网络错误'];
+            }
+            elseif ($resp['head']['result'] === '0000')
+            {
+                $item = $resp['body']['item'];
+                $status = $item['state'];
+
+                if ($status === '1') {
+                    $order_state = ORDER_STATE_SUCCESS;
+                    $updata['official_sn'] = $item['operatorNo'];
+                    Model('refill_order')->edit($refill_info['order_id'], $updata);
+                } elseif ($status === '2') {
+                    $order_state = ORDER_STATE_CANCEL;
+                } elseif ($status === '0') {
+                    $order_state = ORDER_STATE_SEND;
+                } elseif ($status === '-1' && (time() - $refill_info['commit_time'] > 600)) {
+                    $order_state = ORDER_STATE_NOEXIST;
+                } else {
+                    return [false, $item['desc']];
+                }
+
+                return [true, $order_state];
+            }
+            else {
+                return [false, $resp['head']['desc']];
+            }
+        }
+    }
+
+    public function balance()
+    {
+        $head['custInteId'] = config::custInteId;
+        $head['echo'] = rand(100000,999999);
+        $head['timestamp'] = date("YmdHis");
+        $head['version'] = 1;
+
+        $content = $head['custInteId'] . config::KEY . $head['echo'] . $head['timestamp'];
+        $head['chargeSign'] = base64_encode(md5($content, true));
+
+        $data = [
+            'head' => $head,
+        ];
+        $xmlData = $this->toXmlData($data);
+        $resp = http_post_data(config::BALANCE_URL, $xmlData, config::ExtHeaders);
+
+        if (empty($resp)) {
+            return [false, '网络错误'];
+        }
+        else
+        {
+            Log::record($resp, Log::DEBUG);
+            $resp = refill\util::xmlToArray($resp);
+            if (empty($resp)) {
+                return [false, '网络错误', true];
+            } elseif ($resp['result'] === '0000') {
+                return [true, $resp['balance'], false];
+            } else {
+                return [false, $resp['desc'], false];
+            }
+        }
+    }
+
+    private function sign($params)
+    {
+        $content = $params['custInteId'] . $params['orderId'] . config::KEY. $params['echo'] . $params['timestamp'];
+        return base64_encode(md5($content, true));
+    }
+
+    private function toXmlData($data)
+    {
+        return $this->xml_encode($data);
+    }
+
+    private function xml_encode($data, $encoding='utf-8') {
+        $xml = '<?xml version="1.0" encoding="' . $encoding . '"?>';
+        $xml .= '<request>';
+        $xml .= $this->data_to_xml($data);
+        $xml .= '</request>';
+        return $xml;
+    }
+
+    private function data_to_xml($data) {
+
+        $xml = '';
+        foreach ($data as $key => $val) {
+            is_numeric($key) && $key = "item id=\"$key\"";
+            $xml    .=  "<$key>";
+            $xml    .=  ( is_array($val) || is_object($val)) ? $this->data_to_xml($val) : $val;
+            list($key, ) = explode(' ', $key);
+            $xml    .=  "</$key>";
+        }
+        return $xml;
+    }
+}

+ 6 - 0
helper/refill/api/xyz/douxun_copy/api.txt

@@ -0,0 +1,6 @@
+北京趣带娃:
+后台地址:http://b.juhemall.cn/
+账户:BJQDWTC
+密码:12345678
+ID:BJQDWTC
+密钥:JK-BJQDWTC

+ 54 - 0
helper/refill/api/xyz/douxun_copy/config.php

@@ -0,0 +1,54 @@
+<?php
+namespace refill\douxun_copy;
+
+use mtopcard;
+class config
+{
+    const ORDER_URL = 'http://bapi.juhemall.cn/order.action';
+    const QUERY_URL= 'http://bapi.juhemall.cn/queryOrder.action';
+    const BALANCE_URL = 'http://bapi.juhemall.cn/balance.action';
+
+    const custInteId = 'BJQDWTC';
+    const KEY = 'JK-BJQDWTC';
+    const NOTIFY_URL = BASE_SITE_URL . "/mobile/callback/refill_douxun.php";
+    const ExtHeaders = ['Content-Type:text/xml; charset=utf-8'];
+
+    const operator = [
+        mtopcard\ChinaMobileCard  => 1,
+        mtopcard\ChinaUnicomCard  => 2,
+        mtopcard\ChinaTelecomCard => 3
+    ];
+    const PRODUCT = [
+        mtopcard\ChinaMobileCard => [
+            10  => 400010,
+            20  => 400020,
+            30  => 400030,
+            50  => 400050,
+            100 => 400100,
+            200 => 400200,
+            300 => 400300,
+            500 => 400500
+        ],
+        mtopcard\ChinaUnicomCard => [
+            10  => 100010,
+            20  => 100020,
+            30  => 100030,
+            50  => 100050,
+            100 => 100100,
+            200 => 100200,
+            300 => 100300,
+            500 => 100500
+        ],
+        mtopcard\ChinaTelecomCard => [
+            10  => 400010,
+            20  => 400020,
+            30  => 400030,
+            50  => 400050,
+            100 => 400100,
+            200 => 400200,
+            300 => 400300,
+            500 => 400500
+        ],
+    ];
+}
+

二進制
helper/refill/api/xyz/douxun_copy/新豆讯话费网关平台接口文档V2.1.doc


二進制
helper/refill/api/xyz/douxun_copy/话费产品编码.xls


+ 45 - 0
helper/refill/api/xyz/douxun_sec/RefillCallBack.php

@@ -0,0 +1,45 @@
+<?php
+namespace refill\douxun_sec;
+
+require_once(BASE_HELPER_RAPI_PATH . '/douxun_sec/config.php');
+
+use refill;
+class RefillCallBack implements refill\IRefillCallBack
+{
+    public function verify($params): bool
+    {
+        $sign = $this->sign($params);
+        if ($params['head']['chargeSign'] == $sign) {
+            return true;
+        } else {
+            return false;
+        }
+    }
+
+    private function sign($params)
+    {
+        $content = config::custInteId . $params['head']['echo'] . config::KEY . $params['head']['timestamp'];
+        return base64_encode(md5($content, true));
+    }
+
+    public function notify($params)
+    {
+        $item = $params['body']['item'];
+        $status = $item['result'];
+        $order_sn = $item['orderId'];
+        $order_info = Model('vr_order')->getOrderInfoForNotify(['order_sn' => $order_sn]);
+        if (empty($order_info)) {
+            return [false, false, false,false];
+        }
+
+        $order_id = $order_info['order_id'];
+        if ($status === '0000') {
+            $data['official_sn'] = strtolower($item['operatorNo']) == 'null' ? '' : $item['operatorNo'];
+            Model('refill_order')->edit($order_id, $data);
+            return [$order_id, true, false,true];
+        }
+        else {
+            return [$order_id, false, true,true];
+        }
+    }
+}

+ 188 - 0
helper/refill/api/xyz/douxun_sec/RefillPhone.php

@@ -0,0 +1,188 @@
+<?php
+namespace refill\douxun_sec;
+
+require_once(BASE_HELPER_RAPI_PATH . '/douxun_sec/config.php');
+
+use refill;
+use Log;
+class RefillPhone extends refill\IRefillPhone
+{
+    public function __construct($cfgs)
+    {
+        parent::__construct($cfgs);
+    }
+
+    private function req_params(int $phone, int $card_type, int $amount, string $order_sn)
+    {
+        $head['custInteId'] = config::custInteId;
+        $head['orderId'] = $order_sn;
+        $head['orderType'] = 1;
+        $head['echo'] = rand(100000,999999);
+        $head['timestamp'] = date("YmdHis");
+        $head['version'] = 1;
+
+        $params['packCode'] = config::PRODUCT[$card_type][$amount];
+        $params['mobile'] = $phone;
+        $params['effectType'] = 1;
+        $params['mobileOper'] = config::operator[$card_type];
+        return [$head,$params];
+    }
+
+    public function add($card_no, $card_type, $amount, $params, &$net_errno = 0)
+    {
+        $order_sn = $params['order_sn'];
+        [$head,$params] = $this->req_params($card_no, $card_type, $amount, $order_sn);
+        $sign = $this->sign($head);
+        $head['chargeSign'] = $sign;
+
+        $data = [
+            'head' => $head,
+            'body' => [
+                'item' => $params
+            ]
+        ];
+        $xmlData = $this->toXmlData($data);
+
+        $resp = http_post_data(config::ORDER_URL, $xmlData, config::ExtHeaders, $net_errno);
+
+        if (empty($resp)) {
+            return [false, '网络错误', true];
+        }
+        else
+        {
+            Log::record($resp, Log::DEBUG);
+            $resp = refill\util::xmlToArray($resp);
+            if (empty($resp)) {
+                return [false, '网络错误', true];
+            } elseif ($resp['result'] === '0000') {
+                return [true, '', false];
+            } else {
+                return [false, $resp['desc'], false];
+            }
+        }
+    }
+
+    public function query($refill_info)
+    {
+        if (time() - $refill_info['commit_time'] > 86400*30) {
+            return [false, '时效已过'];
+        }
+        $head['custInteId'] = config::custInteId;
+        $head['echo'] = rand(100000,999999);
+        $head['timestamp'] = date("YmdHis");
+        $head['version'] = 1;
+        $content = $head['custInteId'] . config::KEY . $head['echo'] . $head['timestamp'];
+        $head['chargeSign'] = base64_encode(md5($content, true));
+
+        $params['orderIds'] = $refill_info['order_sn'];
+        $data = [
+            'head' => $head,
+            'body' => [
+                'item' => $params
+            ]
+        ];
+        $xmlData = $this->toXmlData($data);
+        $resp = http_post_data(config::QUERY_URL, $xmlData, config::ExtHeaders);
+
+        if (empty($resp)) {
+            return [false, '网络错误'];
+        }
+        else
+        {
+            Log::record($resp, Log::DEBUG);
+            $resp = refill\util::xmlToArray($resp);
+            if (empty($resp)) {
+                return [false, '网络错误'];
+            }
+            elseif ($resp['head']['result'] === '0000')
+            {
+                $item = $resp['body']['item'];
+                $status = $item['state'];
+
+                if ($status === '1') {
+                    $order_state = ORDER_STATE_SUCCESS;
+                    $updata['official_sn'] = $item['operatorNo'];
+                    Model('refill_order')->edit($refill_info['order_id'], $updata);
+                } elseif ($status === '2') {
+                    $order_state = ORDER_STATE_CANCEL;
+                } elseif ($status === '0') {
+                    $order_state = ORDER_STATE_SEND;
+                } elseif ($status === '-1' && (time() - $refill_info['commit_time'] > 600)) {
+                    $order_state = ORDER_STATE_NOEXIST;
+                } else {
+                    return [false, $item['desc']];
+                }
+
+                return [true, $order_state];
+            }
+            else {
+                return [false, $resp['head']['desc']];
+            }
+        }
+    }
+
+    public function balance()
+    {
+        $head['custInteId'] = config::custInteId;
+        $head['echo'] = rand(100000,999999);
+        $head['timestamp'] = date("YmdHis");
+        $head['version'] = 1;
+
+        $content = $head['custInteId'] . config::KEY . $head['echo'] . $head['timestamp'];
+        $head['chargeSign'] = base64_encode(md5($content, true));
+
+        $data = [
+            'head' => $head,
+        ];
+        $xmlData = $this->toXmlData($data);
+        $resp = http_post_data(config::BALANCE_URL, $xmlData, config::ExtHeaders);
+
+        if (empty($resp)) {
+            return [false, '网络错误'];
+        }
+        else
+        {
+            Log::record($resp, Log::DEBUG);
+            $resp = refill\util::xmlToArray($resp);
+            if (empty($resp)) {
+                return [false, '网络错误', true];
+            } elseif ($resp['result'] === '0000') {
+                return [true, $resp['balance'], false];
+            } else {
+                return [false, $resp['desc'], false];
+            }
+        }
+    }
+
+    private function sign($params)
+    {
+        $content = $params['custInteId'] . $params['orderId'] . config::KEY. $params['echo'] . $params['timestamp'];
+        return base64_encode(md5($content, true));
+    }
+
+    private function toXmlData($data)
+    {
+        return $this->xml_encode($data);
+    }
+
+    private function xml_encode($data, $encoding='utf-8') {
+        $xml = '<?xml version="1.0" encoding="' . $encoding . '"?>';
+        $xml .= '<request>';
+        $xml .= $this->data_to_xml($data);
+        $xml .= '</request>';
+        return $xml;
+    }
+
+    private function data_to_xml($data) {
+
+        $xml = '';
+        foreach ($data as $key => $val) {
+            is_numeric($key) && $key = "item id=\"$key\"";
+            $xml    .=  "<$key>";
+            $xml    .=  ( is_array($val) || is_object($val)) ? $this->data_to_xml($val) : $val;
+            list($key, ) = explode(' ', $key);
+            $xml    .=  "</$key>";
+        }
+        return $xml;
+    }
+}

+ 6 - 0
helper/refill/api/xyz/douxun_sec/api.txt

@@ -0,0 +1,6 @@
+游来有旺:
+后台地址:http://b.juhemall.cn/
+账户:YLYWTC
+密码:12345678
+ID:YLYWTC
+密钥:JK-YLYWTC

+ 54 - 0
helper/refill/api/xyz/douxun_sec/config.php

@@ -0,0 +1,54 @@
+<?php
+namespace refill\douxun_sec;
+
+use mtopcard;
+class config
+{
+    const ORDER_URL = 'http://bapi.juhemall.cn/order.action';
+    const QUERY_URL= 'http://bapi.juhemall.cn/queryOrder.action';
+    const BALANCE_URL = 'http://bapi.juhemall.cn/balance.action';
+
+    const custInteId = 'YLYWTC';
+    const KEY = 'JK-YLYWTC';
+    const NOTIFY_URL = BASE_SITE_URL . "/mobile/callback/refill_douxun_sec.php";
+    const ExtHeaders = ['Content-Type:text/xml; charset=utf-8'];
+
+    const operator = [
+        mtopcard\ChinaMobileCard  => 1,
+        mtopcard\ChinaUnicomCard  => 2,
+        mtopcard\ChinaTelecomCard => 3
+    ];
+    const PRODUCT = [
+        mtopcard\ChinaMobileCard => [
+            10  => 400010,
+            20  => 400020,
+            30  => 400030,
+            50  => 400050,
+            100 => 400100,
+            200 => 400200,
+            300 => 400300,
+            500 => 400500
+        ],
+        mtopcard\ChinaUnicomCard => [
+            10  => 100010,
+            20  => 100020,
+            30  => 100030,
+            50  => 100050,
+            100 => 100100,
+            200 => 100200,
+            300 => 100300,
+            500 => 100500
+        ],
+        mtopcard\ChinaTelecomCard => [
+            10  => 400010,
+            20  => 400020,
+            30  => 400030,
+            50  => 400050,
+            100 => 400100,
+            200 => 400200,
+            300 => 400300,
+            500 => 400500
+        ],
+    ];
+}
+

二進制
helper/refill/api/xyz/douxun_sec/新豆讯话费网关平台接口文档V2.1.doc


二進制
helper/refill/api/xyz/douxun_sec/话费产品编码.xls


+ 45 - 0
helper/refill/api/xyz/douxun_sec_copy/RefillCallBack.php

@@ -0,0 +1,45 @@
+<?php
+namespace refill\douxun_sec_copy;
+
+require_once(BASE_HELPER_RAPI_PATH . '/douxun_sec_copy/config.php');
+
+use refill;
+class RefillCallBack implements refill\IRefillCallBack
+{
+    public function verify($params): bool
+    {
+        $sign = $this->sign($params);
+        if ($params['head']['chargeSign'] == $sign) {
+            return true;
+        } else {
+            return false;
+        }
+    }
+
+    private function sign($params)
+    {
+        $content = config::custInteId . $params['head']['echo'] . config::KEY . $params['head']['timestamp'];
+        return base64_encode(md5($content, true));
+    }
+
+    public function notify($params)
+    {
+        $item = $params['body']['item'];
+        $status = $item['result'];
+        $order_sn = $item['orderId'];
+        $order_info = Model('vr_order')->getOrderInfoForNotify(['order_sn' => $order_sn]);
+        if (empty($order_info)) {
+            return [false, false, false,false];
+        }
+
+        $order_id = $order_info['order_id'];
+        if ($status === '0000') {
+            $data['official_sn'] = strtolower($item['operatorNo']) == 'null' ? '' : $item['operatorNo'];
+            Model('refill_order')->edit($order_id, $data);
+            return [$order_id, true, false,true];
+        }
+        else {
+            return [$order_id, false, true,true];
+        }
+    }
+}

+ 188 - 0
helper/refill/api/xyz/douxun_sec_copy/RefillPhone.php

@@ -0,0 +1,188 @@
+<?php
+namespace refill\douxun_sec_copy;
+
+require_once(BASE_HELPER_RAPI_PATH . '/douxun_sec_copy/config.php');
+
+use refill;
+use Log;
+class RefillPhone extends refill\IRefillPhone
+{
+    public function __construct($cfgs)
+    {
+        parent::__construct($cfgs);
+    }
+
+    private function req_params(int $phone, int $card_type, int $amount, string $order_sn)
+    {
+        $head['custInteId'] = config::custInteId;
+        $head['orderId'] = $order_sn;
+        $head['orderType'] = 1;
+        $head['echo'] = rand(100000,999999);
+        $head['timestamp'] = date("YmdHis");
+        $head['version'] = 1;
+
+        $params['packCode'] = config::PRODUCT[$card_type][$amount];
+        $params['mobile'] = $phone;
+        $params['effectType'] = 1;
+        $params['mobileOper'] = config::operator[$card_type];
+        return [$head,$params];
+    }
+
+    public function add($card_no, $card_type, $amount, $params, &$net_errno = 0)
+    {
+        $order_sn = $params['order_sn'];
+        [$head,$params] = $this->req_params($card_no, $card_type, $amount, $order_sn);
+        $sign = $this->sign($head);
+        $head['chargeSign'] = $sign;
+
+        $data = [
+            'head' => $head,
+            'body' => [
+                'item' => $params
+            ]
+        ];
+        $xmlData = $this->toXmlData($data);
+
+        $resp = http_post_data(config::ORDER_URL, $xmlData, config::ExtHeaders, $net_errno);
+
+        if (empty($resp)) {
+            return [false, '网络错误', true];
+        }
+        else
+        {
+            Log::record($resp, Log::DEBUG);
+            $resp = refill\util::xmlToArray($resp);
+            if (empty($resp)) {
+                return [false, '网络错误', true];
+            } elseif ($resp['result'] === '0000') {
+                return [true, '', false];
+            } else {
+                return [false, $resp['desc'], false];
+            }
+        }
+    }
+
+    public function query($refill_info)
+    {
+        if (time() - $refill_info['commit_time'] > 86400*30) {
+            return [false, '时效已过'];
+        }
+        $head['custInteId'] = config::custInteId;
+        $head['echo'] = rand(100000,999999);
+        $head['timestamp'] = date("YmdHis");
+        $head['version'] = 1;
+        $content = $head['custInteId'] . config::KEY . $head['echo'] . $head['timestamp'];
+        $head['chargeSign'] = base64_encode(md5($content, true));
+
+        $params['orderIds'] = $refill_info['order_sn'];
+        $data = [
+            'head' => $head,
+            'body' => [
+                'item' => $params
+            ]
+        ];
+        $xmlData = $this->toXmlData($data);
+        $resp = http_post_data(config::QUERY_URL, $xmlData, config::ExtHeaders);
+
+        if (empty($resp)) {
+            return [false, '网络错误'];
+        }
+        else
+        {
+            Log::record($resp, Log::DEBUG);
+            $resp = refill\util::xmlToArray($resp);
+            if (empty($resp)) {
+                return [false, '网络错误'];
+            }
+            elseif ($resp['head']['result'] === '0000')
+            {
+                $item = $resp['body']['item'];
+                $status = $item['state'];
+
+                if ($status === '1') {
+                    $order_state = ORDER_STATE_SUCCESS;
+                    $updata['official_sn'] = $item['operatorNo'];
+                    Model('refill_order')->edit($refill_info['order_id'], $updata);
+                } elseif ($status === '2') {
+                    $order_state = ORDER_STATE_CANCEL;
+                } elseif ($status === '0') {
+                    $order_state = ORDER_STATE_SEND;
+                } elseif ($status === '-1' && (time() - $refill_info['commit_time'] > 600)) {
+                    $order_state = ORDER_STATE_NOEXIST;
+                } else {
+                    return [false, $item['desc']];
+                }
+
+                return [true, $order_state];
+            }
+            else {
+                return [false, $resp['head']['desc']];
+            }
+        }
+    }
+
+    public function balance()
+    {
+        $head['custInteId'] = config::custInteId;
+        $head['echo'] = rand(100000,999999);
+        $head['timestamp'] = date("YmdHis");
+        $head['version'] = 1;
+
+        $content = $head['custInteId'] . config::KEY . $head['echo'] . $head['timestamp'];
+        $head['chargeSign'] = base64_encode(md5($content, true));
+
+        $data = [
+            'head' => $head,
+        ];
+        $xmlData = $this->toXmlData($data);
+        $resp = http_post_data(config::BALANCE_URL, $xmlData, config::ExtHeaders);
+
+        if (empty($resp)) {
+            return [false, '网络错误'];
+        }
+        else
+        {
+            Log::record($resp, Log::DEBUG);
+            $resp = refill\util::xmlToArray($resp);
+            if (empty($resp)) {
+                return [false, '网络错误', true];
+            } elseif ($resp['result'] === '0000') {
+                return [true, $resp['balance'], false];
+            } else {
+                return [false, $resp['desc'], false];
+            }
+        }
+    }
+
+    private function sign($params)
+    {
+        $content = $params['custInteId'] . $params['orderId'] . config::KEY. $params['echo'] . $params['timestamp'];
+        return base64_encode(md5($content, true));
+    }
+
+    private function toXmlData($data)
+    {
+        return $this->xml_encode($data);
+    }
+
+    private function xml_encode($data, $encoding='utf-8') {
+        $xml = '<?xml version="1.0" encoding="' . $encoding . '"?>';
+        $xml .= '<request>';
+        $xml .= $this->data_to_xml($data);
+        $xml .= '</request>';
+        return $xml;
+    }
+
+    private function data_to_xml($data) {
+
+        $xml = '';
+        foreach ($data as $key => $val) {
+            is_numeric($key) && $key = "item id=\"$key\"";
+            $xml    .=  "<$key>";
+            $xml    .=  ( is_array($val) || is_object($val)) ? $this->data_to_xml($val) : $val;
+            list($key, ) = explode(' ', $key);
+            $xml    .=  "</$key>";
+        }
+        return $xml;
+    }
+}

+ 6 - 0
helper/refill/api/xyz/douxun_sec_copy/api.txt

@@ -0,0 +1,6 @@
+游来有旺:
+后台地址:http://b.juhemall.cn/
+账户:YLYWTC
+密码:12345678
+ID:YLYWTC
+密钥:JK-YLYWTC

+ 54 - 0
helper/refill/api/xyz/douxun_sec_copy/config.php

@@ -0,0 +1,54 @@
+<?php
+namespace refill\douxun_sec_copy;
+
+use mtopcard;
+class config
+{
+    const ORDER_URL = 'http://bapi.juhemall.cn/order.action';
+    const QUERY_URL= 'http://bapi.juhemall.cn/queryOrder.action';
+    const BALANCE_URL = 'http://bapi.juhemall.cn/balance.action';
+
+    const custInteId = 'YLYWTC';
+    const KEY = 'JK-YLYWTC';
+    const NOTIFY_URL = BASE_SITE_URL . "/mobile/callback/refill_douxun_sec.php";
+    const ExtHeaders = ['Content-Type:text/xml; charset=utf-8'];
+
+    const operator = [
+        mtopcard\ChinaMobileCard  => 1,
+        mtopcard\ChinaUnicomCard  => 2,
+        mtopcard\ChinaTelecomCard => 3
+    ];
+    const PRODUCT = [
+        mtopcard\ChinaMobileCard => [
+            10  => 400010,
+            20  => 400020,
+            30  => 400030,
+            50  => 400050,
+            100 => 400100,
+            200 => 400200,
+            300 => 400300,
+            500 => 400500
+        ],
+        mtopcard\ChinaUnicomCard => [
+            10  => 100010,
+            20  => 100020,
+            30  => 100030,
+            50  => 100050,
+            100 => 100100,
+            200 => 100200,
+            300 => 100300,
+            500 => 100500
+        ],
+        mtopcard\ChinaTelecomCard => [
+            10  => 400010,
+            20  => 400020,
+            30  => 400030,
+            50  => 400050,
+            100 => 400100,
+            200 => 400200,
+            300 => 400300,
+            500 => 400500
+        ],
+    ];
+}
+

二進制
helper/refill/api/xyz/douxun_sec_copy/新豆讯话费网关平台接口文档V2.1.doc


二進制
helper/refill/api/xyz/douxun_sec_copy/话费产品编码.xls


+ 0 - 0
helper/refill/api/xyz/feimingyu_fs/20230217贵州移动调价函.jpg


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