浏览代码

Merge branch 'raccount' into rtest

xiaoyu 3 年之前
父节点
当前提交
49dd5c8d15
共有 49 个文件被更改,包括 1750 次插入700 次删除
  1. 5 1
      admin/config/config.ini.php
  2. 37 1
      admin/control/control.php
  3. 0 227
      admin/control/merchant.php
  4. 67 0
      admin/control/provider.php
  5. 186 0
      admin/control/provider_ctl.php
  6. 1 0
      admin/include/menu.php
  7. 5 15
      admin/templates/default/merchant.edit.php
  8. 2 2
      admin/templates/default/merchant.index.php
  9. 5 5
      admin/templates/default/merchant.ratios.php
  10. 14 15
      admin/templates/default/provider.amount.control.php
  11. 4 14
      admin/templates/default/provider.index.php
  12. 268 37
      admin/templates/default/provider.price.php
  13. 180 0
      admin/templates/default/provider.recharge.php
  14. 0 141
      admin/templates/default/provider.stats.php
  15. 4 15
      admin/templates/default/recharge.manual.add.php
  16. 3 15
      admin/templates/default/recharge.manual.edit.php
  17. 3 1
      admin/templates/default/refill.order.index.php
  18. 1 1
      admin/templates/default/refill.order.search.php
  19. 25 3
      data/config/dev/refill.ini.php
  20. 39 26
      data/config/win/refill.ini.php
  21. 39 26
      data/config/xyz/refill.ini.php
  22. 39 26
      data/config/xyzadm/refill.ini.php
  23. 8 1
      data/config/xyztest/refill.ini.php
  24. 12 1
      docker/compose/xyz/stat/docker-compose.yml
  25. 12 1
      docker/compose/xyzt/stat/docker-compose.yml
  26. 1 1
      helper/refill/LZRefillFactory.php
  27. 2 2
      helper/refill/RefillBase.php
  28. 2 1
      helper/refill/XYZRefillFactory.php
  29. 二进制
      helper/refill/api/xyz/guochuang/20210929移动调价.png
  30. 2 2
      helper/refill/api/xyz/guochuang/config.php
  31. 1 1
      helper/refill/policy/IPolicy.php
  32. 32 0
      helper/refill/policy/PolicyUtil.php
  33. 0 15
      helper/refill/policy/lingzh/PolicyUtil.php
  34. 128 5
      helper/refill/policy/lingzh/policy.php
  35. 32 0
      helper/refill/policy/mavg_price.php
  36. 22 6
      helper/refill/policy/mchctl.php
  37. 12 5
      helper/refill/policy/mchoilctl.php
  38. 13 0
      helper/refill/policy/merchant_price.php
  39. 133 33
      helper/refill/policy/mratio_control.php
  40. 32 22
      helper/refill/policy/quaility.php
  41. 0 15
      helper/refill/policy/xyz/PolicyUtil.php
  42. 168 7
      helper/refill/policy/xyz/policy.php
  43. 2 2
      helper/refill/util.php
  44. 122 1
      plot/MchDataCenter.py
  45. 23 0
      plot/mcounts.py
  46. 4 0
      plot/thdf5.py
  47. 10 7
      rdispatcher/codispatcher.php
  48. 17 0
      test/TestBigData.php
  49. 33 1
      test/TestRefillThird.php

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

@@ -7,7 +7,11 @@ $config['receive_bank'] = [
     'XYZ_COMPANY' => [
     'XYZ_COMPANY' => [
         '椰子招行',
         '椰子招行',
         '椰子建行',
         '椰子建行',
-        '国研建行'
+        '国研建行',
+        '椰子浦发',
+        '国研浦发',
+        '国研招行',
+        '趣带娃建行'
     ],
     ],
     'LZKJ_COMPANY' => [
     'LZKJ_COMPANY' => [
         '琳珠收款'
         '琳珠收款'

+ 37 - 1
admin/control/control.php

@@ -447,4 +447,40 @@ class SystemControl
         return $items;
         return $items;
     }
     }
 
 
-}
+    protected function credit_save_money($money, $operatetype, $member_id, $bz = '')
+    {
+        $obj_member = Model('member');
+        $member_id = intval($member_id);
+        $member_info = $obj_member->getMemberInfo(['member_id' => $member_id], '*', true);
+        $admininfo = $this->getAdminInfo();
+        $bz = $bz == '' ? '管理员更改客户授信' : $bz;
+        switch ($operatetype) {
+            case 'add':
+                $admin_act = "sys_add_money";
+                $log_msg = "管理员【{$admininfo['name']}】操作会员{$member_id}余额:【{$member_info['member_name']}】,预存款【增加】,金额为{$money}。备注:{$bz}。";
+                break;
+            case 'del':
+                $admin_act = "sys_del_money";
+                $log_msg = "管理员【{$admininfo['name']}】操作会员{$member_id}余额:【{$member_info['member_name']}】,预存款【减少】,金额为{$money}。备注:{$bz}。";
+                break;
+            default:
+                return [false, '调节类型错误'];
+        }
+        $model_pd = Model('predeposit');
+        //调节预存款
+        $data = [];
+        $data['member_id'] = $member_info['member_id'];
+        $data['member_name'] = $member_info['member_name'];
+        $data['amount'] = $money;
+        $data['order_sn'] = '';
+        $data['admin_name'] = $admininfo['name'];
+        $data['pdr_sn'] = '';
+        $data['lg_desc'] = $bz;
+
+        $isRefill = $model_pd->isRefill($data['member_id']);
+        $model_pd->changePd($admin_act, $data,$isRefill);
+
+        $this->log($log_msg, 1);
+        return [true, 'success'];
+    }
+}

+ 0 - 227
admin/control/merchant.php

@@ -203,43 +203,6 @@ class merchantControl extends SystemControl
         Tpl::showpage('merchant.edit');
         Tpl::showpage('merchant.edit');
     }
     }
 
 
-    private function credit_save_money($money, $operatetype, $member_id, $bz = '')
-    {
-        $obj_member = Model('member');
-        $member_id = intval($member_id);
-        $member_info = $obj_member->getMemberInfo(['member_id' => $member_id], '*', true);
-        $admininfo = $this->getAdminInfo();
-        $bz = $bz == '' ? '管理员更改客户授信' : $bz;
-        switch ($operatetype) {
-            case 'add':
-                $admin_act = "sys_add_money";
-                $log_msg = "管理员【{$admininfo['name']}】操作会员{$member_id}授信:【{$member_info['member_name']}】,预存款【增加】,金额为{$money}。备注:{$bz}。";
-                break;
-            case 'del':
-                $admin_act = "sys_del_money";
-                $log_msg = "管理员【{$admininfo['name']}】操作会员{$member_id}授信:【{$member_info['member_name']}】,预存款【减少】,金额为{$money}。备注:{$bz}。";
-                break;
-            default:
-                return [false, '调节类型错误'];
-        }
-        $model_pd = Model('predeposit');
-        //调节预存款
-        $data = [];
-        $data['member_id'] = $member_info['member_id'];
-        $data['member_name'] = $member_info['member_name'];
-        $data['amount'] = $money;
-        $data['order_sn'] = '';
-        $data['admin_name'] = $admininfo['name'];
-        $data['pdr_sn'] = '';
-        $data['lg_desc'] = $bz;
-
-        $isRefill = $model_pd->isRefill($data['member_id']);
-        $model_pd->changePd($admin_act, $data,$isRefill);
-
-        $this->log($log_msg, 1);
-        return [true, 'success'];
-    }
-
     public function priceOp()
     public function priceOp()
     {
     {
         $quality = $_GET['quality'] ?? 1;
         $quality = $_GET['quality'] ?? 1;
@@ -838,20 +801,6 @@ class merchantControl extends SystemControl
         showMessage('操作成功', '');
         showMessage('操作成功', '');
     }
     }
 
 
-    public function providerStatsOp()
-    {
-        $provider_model = Model('refill_provider');
-        $condition = [];
-        $provider_list = $provider_model->getProviderList($condition, 1000);
-        $opened_text = ['使用中', '已禁用'];
-        $type_text = ['油卡', '手机充值卡'];
-        Tpl::output('opened_text', $opened_text);
-        Tpl::output('type_text', $type_text);
-        Tpl::output('provider_list', $provider_list);
-        Tpl::output('show_page', $provider_model->showpage());
-        Tpl::showpage('provider.stats');
-    }
-
     public function provider_provinceOp()
     public function provider_provinceOp()
     {
     {
         $provider_model = Model('refill_provider');
         $provider_model = Model('refill_provider');
@@ -993,182 +942,6 @@ class merchantControl extends SystemControl
         }
         }
     }
     }
 
 
-    public function provider_amount_controlOp()
-    {
-        $type = $_GET['type'] ?? $_POST['type'];
-        $form = $_GET['form'] ?? $_POST['form'];
-        $rkey = $this->speed_key($type, $form);
-        $quality = [
-            'common' => \refill\Quality::Normal, 'fast' => \refill\Quality::Quick, 'card' => \refill\Quality::CardKey,
-            'third' => \refill\Quality::ThirdShop, 'slow' => \refill\Quality::SlowTwentyFour, 'slow6' => \refill\Quality::SlowSix,
-            'slow2' => \refill\Quality::SlowTwo, 'slow48' => \refill\Quality::SlowFortyEight, 'slow72' => \refill\Quality::SlowSeventyTwo
-        ];
-        if (chksubmit()) {
-            $provider_list = $this->providers();
-            foreach ($provider_list as $provider) {
-                $providers[$provider['provider_id']] = $provider;
-            }
-            $strs = $_POST['str'];
-            $speeds = $_POST['speed'];
-            $sorts = $_POST['sort'];
-            $openeds = $_POST['opened'];
-
-            foreach ($strs as $key => $str) {
-                $item = explode('-', $str);
-
-                $pid = $item[0];
-                $type = $item[1];
-                $amount = $item[2];
-                $has = $item[3];
-                if ($has == 0) {
-                    continue;
-                }
-                $data['pid'] = intval($pid);
-                $data['name'] = $providers[$pid]['name'];
-                $data['type'] = intval($type);
-                $data['amount'] = intval($amount);
-                $data['speed'] = intval($speeds[$key]);
-                $data['sort'] = intval($sorts[$key]);
-                $data['opened'] = intval($openeds[$key]);
-
-                $index = "{$data['type']}-{$data['amount']}";
-                $result[$index][] = $data;
-            }
-//            var_dump($result);die;
-//            Log::record("provider amount data:".json_encode($result),Log::DEBUG);
-            wcache($rkey, ['data' => serialize($result)], 'provider-');
-            showMessage('编辑成功');
-        } else {
-            $speed_limit = rcache($rkey, 'provider-');
-            if (empty($speed_limit)) {
-                $speed_limit = [];
-            } else {
-                $speed_limit = unserialize($speed_limit['data']);
-            }
-            $initialiser = function ($provider) {
-                $data['pid'] = $provider['provider_id'];
-                $data['name'] = $provider['name'];
-                $data['speed'] = -1;
-                $data['sort'] = 1;
-                $data['opened'] = 1;
-                return $data;
-            };
-
-            $providers = Model('')->table('refill_provider,store')
-                ->field('refill_provider.*,store.store_name')
-                ->join('inner')
-                ->on('store.store_id=refill_provider.store_id')
-                ->where(['type' => $type, 'qualitys' => ['like', '%' . $quality[$form] . '%']])
-                ->limit(1000)
-                ->order('opened asc , sort desc')
-                ->select();
-            if (empty($providers)) {
-                showMessage('暂无相关通道', 'index.php?act=provider&op=index');
-            }
-            $formData = $this->formData($type, $form);
-
-            $amounts = $formData['amounts'];
-            $cfgs = $formData['cfgs'];
-            $types = $formData['types'];
-            if (!empty($speed_limit)) {
-                foreach ($speed_limit as $key => $speed) {
-                    foreach ($speed as $value) {
-                        $speed_limit[$key][$value['pid']] = $value;
-                    }
-                }
-            }
-
-            $ProviderManager = new \refill\ProviderManager();
-            $ProviderManager->load();
-            $QPTA = $ProviderManager->getQPTA();
-            $QPTA = $QPTA[$quality[$form]];
-
-            foreach ($providers as $key => $provider) {
-                $result = [];
-                $pid = $provider['provider_id'];
-                $name = $provider['name'];
-                if (empty($cfgs) || !array_key_exists($name, $cfgs)) {
-                    unset($providers[$key]);
-                    continue;
-                }
-                foreach ($types as $type) {
-                    foreach ($amounts as $k => $amount) {
-                        $key = $type . '-' . $amount;
-                        if (is_array($speed_limit[$key]) && array_key_exists($pid, $speed_limit[$key])) {
-                            $speed = $speed_limit[$key][$pid];
-                        } else {
-                            $speed = $initialiser($provider);
-                        }
-                        if (is_array($QPTA["{$name}-{$type}-{$amount}"]) && array_key_exists("{$name}-{$type}-{$amount}", $QPTA)) {
-                            $speed['has'] = 1;
-                        } else {
-                            $speed['has'] = 0;
-                        }
-                        $result[] = $speed;
-                    }
-                }
-                $datas[$pid] = $result;
-            }
-            if (empty($datas)) {
-                showMessage('暂无相关通道配置', 'index.php?act=provider&op=index');
-            }
-            Tpl::output('form', $formData);
-            Tpl::output('datas', $datas);
-            Tpl::output('providers', $providers);
-            Tpl::showpage('provider.amount.control');
-        }
-    }
-
-    private function speed_key($type, $form)
-    {
-        if ($type == 1) {
-            $rkey = "channel-ctl-oil-{$form}-limit";
-        } elseif ($type == 2) {
-            $rkey = "channel-ctl-phone-{$form}-limit";
-        } else {
-            showMessage('类型有误', "index.php?act=provider&op=index");
-        }
-        Log::record($rkey, Log::DEBUG);
-        return $rkey;
-    }
-
-    private function formData($type, $form)
-    {
-        global $config;
-        $texts = [
-            ["中石油", '中石化'], ['移动', '联通', '电信']
-        ];
-        $type_data = [[1, 2], [4, 5, 6]];
-        $type_text = $texts[$type - 1];
-        $type_data = $type_data[$type - 1];
-        $amounts = [];
-        if ($type == 1) {
-            $amounts = $config['refill_oil_specs'];
-            $cfgs = $config['oil_providers'];
-        }
-        if ($type == 2) {
-            $amounts = $config['refill_phone_specs'];
-            $cfgs = $config['phone_providers'];
-            if ($form == 'fast') {
-                //快充质量,加小面值
-                $amounts = array_merge($config['refill_phone_small_specs'], $amounts);
-            }
-        }
-
-        foreach ($type_text as $key => $value) {
-            foreach ($amounts as $amount) {
-                $data['text'] = $value . '-' . $amount . '元';
-                $data['type'] = $type_data[$key];
-                $data['amount'] = $amount;
-                $amountData[] = $data;
-            }
-        }
-        foreach ($cfgs as $cfg) {
-            $pcfgs[$cfg['name']] = $cfg;
-        }
-        return ['amountData' => $amountData, 'form' => $form, 'amounts' => $amounts, 'types' => $type_data, 'cfgs' => $pcfgs];
-    }
-
     public function OrderStatsCheckOp()
     public function OrderStatsCheckOp()
     {
     {
         $stat_id = $_GET['stat_id'] ?? $_POST['stat_id'];
         $stat_id = $_GET['stat_id'] ?? $_POST['stat_id'];

+ 67 - 0
admin/control/provider.php

@@ -82,6 +82,73 @@ class providerControl extends SystemControl
         Tpl::showpage('provider.index');
         Tpl::showpage('provider.index');
     }
     }
 
 
+    public function recharge_manualOp()
+    {
+        $provider_id = $_GET['provider_id'] ?? $_POST['provider_id'];
+        $provider_model = Model('refill_provider');
+        $provider_info = $provider_model->getProviderInfo(['provider_id' => $provider_id]);
+        if (empty($provider_info)) {
+            showMessage('通道信息有误');
+        }
+
+        if (chksubmit())
+        {
+            $obj_validate = new Validator();
+            $obj_validate->validateparam = [
+                ["input" => $_POST["operation"], "require" => "true", "message" => '操作人姓名不能为空'],
+                ["input" => $_POST["pointsnum"], "require" => "true", "message" => '预存金额不能为空']
+            ];
+            $operatetype = $_POST['operatetype'];
+            $pointsnum   = $_POST['pointsnum'];
+            $money = abs($pointsnum);
+            if ($money == 0) {
+                showMessage('金额错误');
+            }
+
+            try {
+                $model_merchant = Model('merchant');
+                $trans = new trans_wapper($model_merchant, __METHOD__);
+                $member_id = $provider_info['account_id'];
+                if ($operatetype == 'add') {
+                    $bz = "管理员调款操作,手动增加通道余额";
+                    $this->credit_save_money($money, 'add', $member_id, $bz);
+                    $_POST['pointsnum'] = $money;
+                } elseif ($operatetype == 'del') {
+                    $bz = "管理员调款操作,手动减少通道余额";
+                    $this->credit_save_money($money, 'del', $member_id, $bz);
+                    $_POST['pointsnum'] = -($money);
+                } else {
+                    showMessage('预存类型错误');
+                }
+                $result = $this->ct_provider_amount($_POST, $provider_info);
+                if (!$result) {
+                    $trans->rollback();
+                    showMessage('操作失败');
+                }
+                $trans->commit();
+                showMessage('操作成功', 'index.php?act=provider&op=index');
+            } catch (Exception $e) {
+                $trans->rollback();
+                showMessage('操作失败');
+            }
+        }
+        else
+        {
+            Tpl::output('provider', $provider_info);
+            Tpl::showpage('provider.recharge');
+        }
+    }
+
+    private function ct_provider_amount($params, $provider_info)
+    {
+        $input['provider_id'] = $provider_info['provider_id'];
+        $input['memeber_id'] = $provider_info['account_id'];
+        $input['amount'] = $params['pointsnum'];
+        $input['operation'] = $params['operation'];
+
+        return Model('')->table('provider_amount')->insert($input);
+    }
+
     public function sync_cfgs()
     public function sync_cfgs()
     {
     {
         $name_val = function ($items) {
         $name_val = function ($items) {

+ 186 - 0
admin/control/provider_ctl.php

@@ -0,0 +1,186 @@
+<?php
+require_once(BASE_HELPER_PATH . '/refill/RefillFactory.php');
+include(BASE_CONFIG_PATH . CONFIG_PREFIX . '/refill.ini.php');
+class provider_ctlControl extends SystemControl
+{
+    public function __construct()
+    {
+        parent::__construct();
+    }
+
+    public function indexOp()
+    {
+        $type = $_GET['type'] ?? $_POST['type'];
+        $form = $_GET['form'] ?? $_POST['form'];
+        $rkey = $this->speed_key($type, $form);
+        $quality = [
+            'common' => \refill\Quality::Normal, 'fast' => \refill\Quality::Quick, 'card' => \refill\Quality::CardKey,
+            'third' => \refill\Quality::ThirdShop, 'slow' => \refill\Quality::SlowTwentyFour, 'slow6' => \refill\Quality::SlowSix,
+            'slow2' => \refill\Quality::SlowTwo, 'slow48' => \refill\Quality::SlowFortyEight, 'slow72' => \refill\Quality::SlowSeventyTwo
+        ];
+        if (chksubmit()) {
+            $provider_list = $this->providers();
+            foreach ($provider_list as $provider) {
+                $providers[$provider['provider_id']] = $provider;
+            }
+            $strs = $_POST['str'];
+            $speeds = $_POST['speed'];
+            $sorts = $_POST['sort'];
+            $openeds = $_POST['opened'];
+
+            foreach ($strs as $key => $str) {
+                $item = explode('-', $str);
+
+                $pid = $item[0];
+                $type = $item[1];
+                $amount = $item[2];
+                $has = $item[3];
+                if ($has == 0) {
+                    continue;
+                }
+                $data['pid'] = intval($pid);
+                $data['name'] = $providers[$pid]['name'];
+                $data['type'] = intval($type);
+                $data['amount'] = intval($amount);
+                $data['speed'] = intval($speeds[$key]);
+                $data['sort'] = intval($sorts[$key]);
+                $data['opened'] = intval($openeds[$key]);
+
+                $index = "{$data['type']}-{$data['amount']}";
+                $result[$index][] = $data;
+            }
+//            var_dump($result);die;
+//            Log::record("provider amount data:".json_encode($result),Log::DEBUG);
+            wcache($rkey, ['data' => serialize($result)], 'provider-');
+            showMessage('编辑成功');
+        } else {
+            $speed_limit = rcache($rkey, 'provider-');
+            if (empty($speed_limit)) {
+                $speed_limit = [];
+            } else {
+                $speed_limit = unserialize($speed_limit['data']);
+            }
+            $initialiser = function ($provider) {
+                $data['pid'] = $provider['provider_id'];
+                $data['name'] = $provider['name'];
+                $data['speed'] = -1;
+                $data['sort'] = 1;
+                $data['opened'] = 1;
+                return $data;
+            };
+
+            $providers = Model('')->table('refill_provider,store')
+                ->field('refill_provider.*,store.store_name')
+                ->join('inner')
+                ->on('store.store_id=refill_provider.store_id')
+                ->where(['type' => $type, 'qualitys' => ['like', '%' . $quality[$form] . '%']])
+                ->limit(1000)
+                ->order('opened asc , sort desc')
+                ->select();
+            if (empty($providers)) {
+                showMessage('暂无相关通道', 'index.php?act=provider&op=index');
+            }
+            $formData = $this->formData($type, $form);
+
+            $amounts = $formData['amounts'];
+            $cfgs = $formData['cfgs'];
+            $types = $formData['types'];
+            if (!empty($speed_limit)) {
+                foreach ($speed_limit as $key => $speed) {
+                    foreach ($speed as $value) {
+                        $speed_limit[$key][$value['pid']] = $value;
+                    }
+                }
+            }
+
+            $ProviderManager = new \refill\ProviderManager();
+            $ProviderManager->load();
+            $QPTA = $ProviderManager->getQPTA();
+            $QPTA = $QPTA[$quality[$form]];
+
+            foreach ($providers as $key => $provider) {
+                $result = [];
+                $pid = $provider['provider_id'];
+                $name = $provider['name'];
+                if (empty($cfgs) || !array_key_exists($name, $cfgs)) {
+                    unset($providers[$key]);
+                    continue;
+                }
+                foreach ($types as $type) {
+                    foreach ($amounts as $k => $amount) {
+                        $key = $type . '-' . $amount;
+                        if (is_array($speed_limit[$key]) && array_key_exists($pid, $speed_limit[$key])) {
+                            $speed = $speed_limit[$key][$pid];
+                        } else {
+                            $speed = $initialiser($provider);
+                        }
+                        if (is_array($QPTA["{$name}-{$type}-{$amount}"]) && array_key_exists("{$name}-{$type}-{$amount}", $QPTA)) {
+                            $speed['has'] = 1;
+                        } else {
+                            $speed['has'] = 0;
+                        }
+                        $result[] = $speed;
+                    }
+                }
+                $datas[$pid] = $result;
+            }
+            if (empty($datas)) {
+                showMessage('暂无相关通道配置', 'index.php?act=provider&op=index');
+            }
+            Tpl::output('form', $formData);
+            Tpl::output('datas', $datas);
+            Tpl::output('providers', $providers);
+            Tpl::showpage('provider.amount.control');
+        }
+    }
+
+    private function speed_key($type, $form)
+    {
+        if ($type == 1) {
+            $rkey = "channel-ctl-oil-{$form}-limit";
+        } elseif ($type == 2) {
+            $rkey = "channel-ctl-phone-{$form}-limit";
+        } else {
+            showMessage('类型有误', "index.php?act=provider&op=index");
+        }
+        Log::record($rkey, Log::DEBUG);
+        return $rkey;
+    }
+
+    private function formData($type, $form)
+    {
+        global $config;
+        $texts = [
+            ["中石油", '中石化'], ['移动', '联通', '电信']
+        ];
+        $type_data = [[1, 2], [4, 5, 6]];
+        $type_text = $texts[$type - 1];
+        $type_data = $type_data[$type - 1];
+        $amounts = [];
+        if ($type == 1) {
+            $amounts = $config['refill_oil_specs'];
+            $cfgs = $config['oil_providers'];
+        }
+        if ($type == 2) {
+            $amounts = $config['refill_phone_specs'];
+            $cfgs = $config['phone_providers'];
+            if ($form == 'fast') {
+                //快充质量,加小面值
+                $amounts = array_merge($config['refill_phone_small_specs'], $amounts);
+            }
+        }
+
+        foreach ($type_text as $key => $value) {
+            foreach ($amounts as $amount) {
+                $data['text'] = $value . '-' . $amount . '元';
+                $data['type'] = $type_data[$key];
+                $data['amount'] = $amount;
+                $amountData[] = $data;
+            }
+        }
+        foreach ($cfgs as $cfg) {
+            $pcfgs[$cfg['name']] = $cfg;
+        }
+        return ['amountData' => $amountData, 'form' => $form, 'amounts' => $amounts, 'types' => $type_data, 'cfgs' => $pcfgs];
+    }
+}

+ 1 - 0
admin/include/menu.php

@@ -97,6 +97,7 @@ $arr = array(
 					array('args'=>'index,refill_evidence,merchant',			'text'=>'充值申请'),
 					array('args'=>'index,refill_evidence,merchant',			'text'=>'充值申请'),
 					array('args'=>'index,refill_order,merchant',			'text'=>'订单列表'),
 					array('args'=>'index,refill_order,merchant',			'text'=>'订单列表'),
 					array('args'=>'index,provider,merchant',				'text'=>'通道列表'),
 					array('args'=>'index,provider,merchant',				'text'=>'通道列表'),
+					array('args'=>'index,provider_ctl&type=2&form=common,merchant',			'text'=>'通道控制'),
 					array('args'=>'index,provider_group,merchant',			'text'=>'通道组管理'),
 					array('args'=>'index,provider_group,merchant',			'text'=>'通道组管理'),
 					array('args'=>'index,ordersendlist,merchant',			'text'=>'订单监控'),
 					array('args'=>'index,ordersendlist,merchant',			'text'=>'订单监控'),
 					array('args'=>'index,orderstats,merchant',				'text'=>'对账管理'),
 					array('args'=>'index,orderstats,merchant',				'text'=>'对账管理'),

+ 5 - 15
admin/templates/default/merchant.edit.php

@@ -161,9 +161,9 @@
         let yi = 0; //亿
         let yi = 0; //亿
         let wan = 0; //万
         let wan = 0; //万
         let qian = 0; //千
         let qian = 0; //千
-        let bai = 0; //百
 
 
-        let bai_s = 100; //百
+
+
         let qian_s = 1000; //千
         let qian_s = 1000; //千
         let wan_s = 10000; //万
         let wan_s = 10000; //万
         let yi_s = 100000000; //亿
         let yi_s = 100000000; //亿
@@ -211,16 +211,7 @@
           }
           }
           return data_json;
           return data_json;
         }
         }
-        // 百
-        function bai_f(data) {
-          bai = qz(data / 100);
-          data = data - (bai * bai_s);
-          let data_json = {
-            data1: bai,
-            data2: data,
-          }
-          return data_json;
-        }
+
     
     
         yi = yi_f(number_data);
         yi = yi_f(number_data);
         number_data = yi.data2;
         number_data = yi.data2;
@@ -230,11 +221,10 @@
         qian = qian_f(number_data);
         qian = qian_f(number_data);
         number_data = qian.data2;
         number_data = qian.data2;
 
 
-        bai = bai_f(number_data);
-        number_data = bai.data2;
+    
         
         
 
 
-        let result = yi.data1 + wan.data1 + qian.data1 + bai.data1 +  + number_data;
+        let result = yi.data1 + wan.data1 + qian.data1  + number_data;
         let resultvalue = result.substr(0, 1)
         let resultvalue = result.substr(0, 1)
 
 
         if (resultvalue == 0) {
         if (resultvalue == 0) {

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

@@ -103,10 +103,10 @@ defined('InShopNC') or exit('Access Invalid!'); ?>
                             <?php echo $v['available_predeposit'];?>
                             <?php echo $v['available_predeposit'];?>
                                 </span>
                                 </span>
                         </td>
                         </td>
-                        <td style="color: #0bb20c" class="align-center"><?php echo $v['credit_bonus']; ?></td>
+                        <td style="" class="align-center"><?php echo $v['credit_bonus']; ?></td>
             <!--  <td>--><?php //echo $v['org_pwd']; ?><!--</td>-->
             <!--  <td>--><?php //echo $v['org_pwd']; ?><!--</td>-->
                         <td class="align-center"><?php echo $v['alarm_amount']; ?></td>
                         <td class="align-center"><?php echo $v['alarm_amount']; ?></td>
-                        <td class="align-center">
+                        <td  class="align-center">
                             <?php if($v['merchant_state'] == 1){?>
                             <?php if($v['merchant_state'] == 1){?>
                                 <span style="color: #0bb20c">
                                 <span style="color: #0bb20c">
                             <?php }?>
                             <?php }?>

+ 5 - 5
admin/templates/default/merchant.ratios.php

@@ -58,27 +58,27 @@
                         <td class="align-center"><?php echo $k;?></td>
                         <td class="align-center"><?php echo $k;?></td>
                         <td class="align-center"><?php echo $v['company_name'];?></td>
                         <td class="align-center"><?php echo $v['company_name'];?></td>
                         <td class="align-center"><?php echo $v['time_out'];?></td>
                         <td class="align-center"><?php echo $v['time_out'];?></td>
-                        <td class="align-center"><?php echo ($v['ratio']['ALL'][900][2] * 100) ?? 0;?>%(<span style="color: #0ee710;"><?php echo ($v['ratio']['ALL'][900][0]) ?? 0;?></span>,<span style="color: red;"><?php echo ($v['ratio']['ALL'][900][1]) ?? 0;?></span> ,<?php echo ($v['ratio']['ALL'][900][0] + $v['ratio']['ALL'][900][1]) ?? 0;?>) <br> <br>
+                        <td class="align-center"><?php echo ($v['ratio']['ALL'][900][2] * 100) ?? 0;?>%(<span style="color: #2d7255; display: inline-block; padding-bottom: 4px;"><?php echo ($v['ratio']['ALL'][900][0]) ?? 0;?></span>,<span style="color: red;"><?php echo ($v['ratio']['ALL'][900][1]) ?? 0;?></span> ,<?php echo ($v['ratio']['ALL'][900][0] + $v['ratio']['ALL'][900][1]) ?? 0;?>) <br>
                             <?php echo ($v['ratio']['YD'][900][2] * 100) ?? 0;?>%(<?php echo ($v['ratio']['YD'][900][0] + $v['ratio']['YD'][900][1]) ?? 0;?>)&emsp;
                             <?php echo ($v['ratio']['YD'][900][2] * 100) ?? 0;?>%(<?php echo ($v['ratio']['YD'][900][0] + $v['ratio']['YD'][900][1]) ?? 0;?>)&emsp;
                             |&emsp;<?php echo ($v['ratio']['LT'][900][2] * 100) ?? 0;?>%(<?php echo ($v['ratio']['LT'][900][0] + $v['ratio']['LT'][900][1]) ?? 0;?>)&emsp;|&emsp;
                             |&emsp;<?php echo ($v['ratio']['LT'][900][2] * 100) ?? 0;?>%(<?php echo ($v['ratio']['LT'][900][0] + $v['ratio']['LT'][900][1]) ?? 0;?>)&emsp;|&emsp;
                             <?php echo ($v['ratio']['DX'][900][2] * 100) ?? 0;?>%(<?php echo ($v['ratio']['DX'][900][0] + $v['ratio']['DX'][900][1]) ?? 0;?>)
                             <?php echo ($v['ratio']['DX'][900][2] * 100) ?? 0;?>%(<?php echo ($v['ratio']['DX'][900][0] + $v['ratio']['DX'][900][1]) ?? 0;?>)
                         </td>
                         </td>
-                        <td class="align-center"><?php echo ($v['ratio']['ALL'][1800][2] * 100) ?? 0;?>%(<span style="color: #0ee710;"><?php echo ($v['ratio']['ALL'][1800][0]) ?? 0;?></span>,<span style="color: red;"><?php echo ($v['ratio']['ALL'][1800][1]) ?? 0;?></span> ,<?php echo ($v['ratio']['ALL'][1800][0] + $v['ratio']['ALL'][1800][1]) ?? 0;?>) <br> <br>
+                        <td class="align-center"><?php echo ($v['ratio']['ALL'][1800][2] * 100) ?? 0;?>%(<span style="color: #2d7255;display: inline-block; padding-bottom: 4px;"><?php echo ($v['ratio']['ALL'][1800][0]) ?? 0;?></span>,<span style="color: red;"><?php echo ($v['ratio']['ALL'][1800][1]) ?? 0;?></span> ,<?php echo ($v['ratio']['ALL'][1800][0] + $v['ratio']['ALL'][1800][1]) ?? 0;?>) <br> 
                             <?php echo ($v['ratio']['YD'][1800][2] * 100) ?? 0;?>%(<?php echo ($v['ratio']['YD'][1800][0] + $v['ratio']['YD'][1800][1]) ?? 0;?>)&emsp;
                             <?php echo ($v['ratio']['YD'][1800][2] * 100) ?? 0;?>%(<?php echo ($v['ratio']['YD'][1800][0] + $v['ratio']['YD'][1800][1]) ?? 0;?>)&emsp;
                             |&emsp;<?php echo ($v['ratio']['LT'][1800][2] * 100) ?? 0;?>%(<?php echo ($v['ratio']['LT'][1800][0] + $v['ratio']['LT'][1800][1]) ?? 0;?>)&emsp;|&emsp;
                             |&emsp;<?php echo ($v['ratio']['LT'][1800][2] * 100) ?? 0;?>%(<?php echo ($v['ratio']['LT'][1800][0] + $v['ratio']['LT'][1800][1]) ?? 0;?>)&emsp;|&emsp;
                             <?php echo ($v['ratio']['DX'][1800][2] * 100) ?? 0;?>%(<?php echo ($v['ratio']['DX'][1800][0] + $v['ratio']['DX'][1800][1]) ?? 0;?>)
                             <?php echo ($v['ratio']['DX'][1800][2] * 100) ?? 0;?>%(<?php echo ($v['ratio']['DX'][1800][0] + $v['ratio']['DX'][1800][1]) ?? 0;?>)
                         </td>
                         </td>
-                        <td class="align-center"><?php echo ($v['ratio']['ALL'][3600][2] * 100) ?? 0;?>%(<span style="color: #0ee710;"><?php echo ($v['ratio']['ALL'][3600][0]) ?? 0;?></span>,<span style="color: red;"><?php echo ($v['ratio']['ALL'][3600][1]) ?? 0;?></span>,<?php echo ($v['ratio']['ALL'][3600][0] + $v['ratio']['ALL'][3600][1]) ?? 0;?>) <br> <br>
+                        <td class="align-center"><?php echo ($v['ratio']['ALL'][3600][2] * 100) ?? 0;?>%(<span style="color: #2d7255;display: inline-block; padding-bottom: 4px;"><?php echo ($v['ratio']['ALL'][3600][0]) ?? 0;?></span>,<span style="color: red;"><?php echo ($v['ratio']['ALL'][3600][1]) ?? 0;?></span>,<?php echo ($v['ratio']['ALL'][3600][0] + $v['ratio']['ALL'][3600][1]) ?? 0;?>) <br> 
                             <?php echo ($v['ratio']['YD'][3600][2] * 100) ?? 0;?>%(<?php echo ($v['ratio']['YD'][3600][0] + $v['ratio']['YD'][3600][1]) ?? 0;?>)&emsp;
                             <?php echo ($v['ratio']['YD'][3600][2] * 100) ?? 0;?>%(<?php echo ($v['ratio']['YD'][3600][0] + $v['ratio']['YD'][3600][1]) ?? 0;?>)&emsp;
                             |&emsp;<?php echo ($v['ratio']['LT'][3600][2] * 100) ?? 0;?>%(<?php echo ($v['ratio']['LT'][3600][0] + $v['ratio']['LT'][3600][1]) ?? 0;?>)&emsp;|&emsp;
                             |&emsp;<?php echo ($v['ratio']['LT'][3600][2] * 100) ?? 0;?>%(<?php echo ($v['ratio']['LT'][3600][0] + $v['ratio']['LT'][3600][1]) ?? 0;?>)&emsp;|&emsp;
                             <?php echo ($v['ratio']['DX'][3600][2] * 100) ?? 0;?>%(<?php echo ($v['ratio']['DX'][3600][0] + $v['ratio']['DX'][3600][1]) ?? 0;?>)
                             <?php echo ($v['ratio']['DX'][3600][2] * 100) ?? 0;?>%(<?php echo ($v['ratio']['DX'][3600][0] + $v['ratio']['DX'][3600][1]) ?? 0;?>)
                         </td>
                         </td>
-                        <td class="align-center"><?php echo ($v['ratio']['ALL'][7200][2] * 100) ?? 0;?>%(<span style="color: #0ee710;"><?php echo ($v['ratio']['ALL'][7200][0]) ?? 0;?></span>,<span style="color: red;"><?php echo ($v['ratio']['ALL'][7200][1]) ?? 0;?></span>,<?php echo ($v['ratio']['ALL'][7200][0] + $v['ratio']['ALL'][7200][1]) ?? 0;?>) <br> <br>
+                        <td class="align-center"><?php echo ($v['ratio']['ALL'][7200][2] * 100) ?? 0;?>%(<span style="color: #2d7255;display: inline-block; padding-bottom: 4px;"><?php echo ($v['ratio']['ALL'][7200][0]) ?? 0;?></span>,<span style="color: red;"><?php echo ($v['ratio']['ALL'][7200][1]) ?? 0;?></span>,<?php echo ($v['ratio']['ALL'][7200][0] + $v['ratio']['ALL'][7200][1]) ?? 0;?>) <br> 
                             <?php echo ($v['ratio']['YD'][7200][2] * 100) ?? 0;?>%(<?php echo ($v['ratio']['YD'][7200][0] + $v['ratio']['YD'][7200][1]) ?? 0;?>)&emsp;
                             <?php echo ($v['ratio']['YD'][7200][2] * 100) ?? 0;?>%(<?php echo ($v['ratio']['YD'][7200][0] + $v['ratio']['YD'][7200][1]) ?? 0;?>)&emsp;
                             |&emsp;<?php echo ($v['ratio']['LT'][7200][2] * 100) ?? 0;?>%(<?php echo ($v['ratio']['LT'][7200][0] + $v['ratio']['LT'][7200][1]) ?? 0;?>)&emsp;|&emsp;
                             |&emsp;<?php echo ($v['ratio']['LT'][7200][2] * 100) ?? 0;?>%(<?php echo ($v['ratio']['LT'][7200][0] + $v['ratio']['LT'][7200][1]) ?? 0;?>)&emsp;|&emsp;
                             <?php echo ($v['ratio']['DX'][7200][2] * 100) ?? 0;?>%(<?php echo ($v['ratio']['DX'][7200][0] + $v['ratio']['DX'][7200][1]) ?? 0;?>)
                             <?php echo ($v['ratio']['DX'][7200][2] * 100) ?? 0;?>%(<?php echo ($v['ratio']['DX'][7200][0] + $v['ratio']['DX'][7200][1]) ?? 0;?>)
                         </td>
                         </td>
-                        <td class="align-center"><?php echo ($v['ratio']['ALL'][86400][2] * 100) ?? 0;?>%(<span style="color: #0ee710;"><?php echo ($v['ratio']['ALL'][86400][0]) ?? 0;?></span>,<span style="color: red;"><?php echo ($v['ratio']['ALL'][86400][1]) ?? 0;?></span>,<?php echo ($v['ratio']['ALL'][86400][0] + $v['ratio']['ALL'][86400][1]) ?? 0;?>) <br> <br>
+                        <td class="align-center"><?php echo ($v['ratio']['ALL'][86400][2] * 100) ?? 0;?>%(<span style="color: #2d7255;display: inline-block; padding-bottom: 4px;"><?php echo ($v['ratio']['ALL'][86400][0]) ?? 0;?></span>,<span style="color: red;"><?php echo ($v['ratio']['ALL'][86400][1]) ?? 0;?></span>,<?php echo ($v['ratio']['ALL'][86400][0] + $v['ratio']['ALL'][86400][1]) ?? 0;?>) <br> 
                             <?php echo ($v['ratio']['YD'][86400][2] * 100) ?? 0;?>%(<?php echo ($v['ratio']['YD'][86400][0] + $v['ratio']['YD'][86400][1]) ?? 0;?>)&emsp;
                             <?php echo ($v['ratio']['YD'][86400][2] * 100) ?? 0;?>%(<?php echo ($v['ratio']['YD'][86400][0] + $v['ratio']['YD'][86400][1]) ?? 0;?>)&emsp;
                             |&emsp;<?php echo ($v['ratio']['LT'][86400][2] * 100) ?? 0;?>%(<?php echo ($v['ratio']['LT'][86400][0] + $v['ratio']['LT'][86400][1]) ?? 0;?>)&emsp;|&emsp;
                             |&emsp;<?php echo ($v['ratio']['LT'][86400][2] * 100) ?? 0;?>%(<?php echo ($v['ratio']['LT'][86400][0] + $v['ratio']['LT'][86400][1]) ?? 0;?>)&emsp;|&emsp;
                             <?php echo ($v['ratio']['DX'][86400][2] * 100) ?? 0;?>%(<?php echo ($v['ratio']['DX'][86400][0] + $v['ratio']['DX'][86400][1]) ?? 0;?>)
                             <?php echo ($v['ratio']['DX'][86400][2] * 100) ?? 0;?>%(<?php echo ($v['ratio']['DX'][86400][0] + $v['ratio']['DX'][86400][1]) ?? 0;?>)

+ 14 - 15
admin/templates/default/provider.amount.control.php

@@ -80,23 +80,22 @@
 <div class="page provider_amount_control">
 <div class="page provider_amount_control">
     <div class="fixed-bar">
     <div class="fixed-bar">
         <div class="item-title">
         <div class="item-title">
-            <h3>通道管理</h3>
+            <h3>通道控制</h3>
             <ul class="tab-base">
             <ul class="tab-base">
-                <li><a href="index.php?act=provider&op=index"><span><?php echo $lang['nc_manage'] ?></span></a></li>
-                <li><a href="index.php?act=merchant&op=provider_amount_control&type=2&form=common" class="classA" data-type="2-common"><span>普通话费单量控制</span></a></li>
-                <li><a href="index.php?act=merchant&op=provider_amount_control&type=2&form=fast" class="classA" data-type="2-fast"><span>快充话费单量控制</span></a></li>
-                <li><a href="index.php?act=merchant&op=provider_amount_control&type=2&form=card" class="classA" data-type="2-card"><span>卡密话费单量控制</span></a></li>
-                <li><a href="index.php?act=merchant&op=provider_amount_control&type=2&form=third" class="classA" data-type="2-third"><span>三方话费单量控制</span></a></li>
-                <li><a href="index.php?act=merchant&op=provider_amount_control&type=2&form=slow" class="classA" data-type="2-slow"><span>慢24话费单量控制</span></a></li>
-                <li><a href="index.php?act=merchant&op=provider_amount_control&type=2&form=slow6" class="classA" data-type="2-slow6"><span>慢6话费单量控制</span></a></li>
-                <li><a href="index.php?act=merchant&op=provider_amount_control&type=2&form=slow2" class="classA" data-type="2-slow2"><span>慢2话费单量控制</span></a></li>
-                <li><a href="index.php?act=merchant&op=provider_amount_control&type=2&form=slow48" class="classA" data-type="2-slow48"><span>慢48话费单量控制</span></a></li>
-                <li><a href="index.php?act=merchant&op=provider_amount_control&type=2&form=slow72" class="classA" data-type="2-slow72"><span>慢72话费单量控制</span></a></li>
+                <li><a href="index.php?act=provider_ctl&op=index&type=2&form=common" class="classA" data-type="2-common"><span>普通话费单量控制</span></a></li>
+                <li><a href="index.php?act=provider_ctl&op=index&type=2&form=fast" class="classA" data-type="2-fast"><span>快充话费单量控制</span></a></li>
+                <li><a href="index.php?act=provider_ctl&op=index&type=2&form=card" class="classA" data-type="2-card"><span>卡密话费单量控制</span></a></li>
+                <li><a href="index.php?act=provider_ctl&op=index&type=2&form=third" class="classA" data-type="2-third"><span>三方话费单量控制</span></a></li>
+                <li><a href="index.php?act=provider_ctl&op=index&type=2&form=slow" class="classA" data-type="2-slow"><span>慢24话费单量控制</span></a></li>
+                <li><a href="index.php?act=provider_ctl&op=index&type=2&form=slow6" class="classA" data-type="2-slow6"><span>慢6话费单量控制</span></a></li>
+                <li><a href="index.php?act=provider_ctl&op=index&type=2&form=slow2" class="classA" data-type="2-slow2"><span>慢2话费单量控制</span></a></li>
+                <li><a href="index.php?act=provider_ctl&op=index&type=2&form=slow48" class="classA" data-type="2-slow48"><span>慢48话费单量控制</span></a></li>
+                <li><a href="index.php?act=provider_ctl&op=index&type=2&form=slow72" class="classA" data-type="2-slow72"><span>慢72话费单量控制</span></a></li>
 
 
-                <li><a href="index.php?act=merchant&op=provider_amount_control&type=1&form=common" class="classA" data-type="1-common"><span>无流水油卡单量控制</span></a></li>
-                <li><a href="index.php?act=merchant&op=provider_amount_control&type=1&form=slow" class="classA" data-type="1-slow"><span>有流水油卡单量控制</span></a></li>
-                <li><a href="index.php?act=merchant&op=provider_amount_control&type=1&form=card" class="classA" data-type="1-card"><span>卡密油卡单量控制</span></a></li>
-                <li><a href="index.php?act=merchant&op=provider_amount_control&type=1&form=fast" class="classA" data-type="1-fast"><span>快充油卡单量控制</span></a></li>
+                <li><a href="index.php?act=provider_ctl&op=index&type=1&form=common" class="classA" data-type="1-common"><span>无流水油卡单量控制</span></a></li>
+                <li><a href="index.php?act=provider_ctl&op=index&type=1&form=slow" class="classA" data-type="1-slow"><span>有流水油卡单量控制</span></a></li>
+                <li><a href="index.php?act=provider_ctl&op=index&type=1&form=card" class="classA" data-type="1-card"><span>卡密油卡单量控制</span></a></li>
+                <li><a href="index.php?act=provider_ctl&op=index&type=1&form=fast" class="classA" data-type="1-fast"><span>快充油卡单量控制</span></a></li>
             </ul>
             </ul>
         </div>
         </div>
     </div>
     </div>

+ 4 - 14
admin/templates/default/provider.index.php

@@ -15,20 +15,6 @@
             <h3>通道管理</h3>
             <h3>通道管理</h3>
             <ul class="tab-base">
             <ul class="tab-base">
                 <li><a href="JavaScript:void(0);" class="current"><span><?php echo $lang['nc_manage'] ?></span></a></li>
                 <li><a href="JavaScript:void(0);" class="current"><span><?php echo $lang['nc_manage'] ?></span></a></li>
-                <li><a href="index.php?act=merchant&op=provider_amount_control&type=2&form=common"><span>普通话费单量控制</span></a></li>
-                <li><a href="index.php?act=merchant&op=provider_amount_control&type=2&form=fast"><span>快充话费单量控制</span></a></li>
-                <li><a href="index.php?act=merchant&op=provider_amount_control&type=2&form=card"><span>卡密话费单量控制</span></a></li>
-                <li><a href="index.php?act=merchant&op=provider_amount_control&type=2&form=third"><span>三方话费单量控制</span></a></li>
-                <li><a href="index.php?act=merchant&op=provider_amount_control&type=2&form=slow"><span>慢24话费单量控制</span></a></li>
-                <li><a href="index.php?act=merchant&op=provider_amount_control&type=2&form=slow6"><span>慢6话费单量控制</span></a></li>
-                <li><a href="index.php?act=merchant&op=provider_amount_control&type=2&form=slow2"><span>慢2话费单量控制</span></a></li>
-                <li><a href="index.php?act=merchant&op=provider_amount_control&type=2&form=slow48"><span>慢48话费单量控制</span></a></li>
-                <li><a href="index.php?act=merchant&op=provider_amount_control&type=2&form=slow72"><span>慢72话费单量控制</span></a></li>
-
-                <li><a href="index.php?act=merchant&op=provider_amount_control&type=1&form=common"><span>无流水油卡单量控制</span></a></li>
-                <li><a href="index.php?act=merchant&op=provider_amount_control&type=1&form=slow"><span>有流水油卡单量控制</span></a></li>
-                <li><a href="index.php?act=merchant&op=provider_amount_control&type=1&form=card"><span>卡密油卡单量控制</span></a></li>
-                <li><a href="index.php?act=merchant&op=provider_amount_control&type=1&form=fast"><span>快充油卡单量控制</span></a></li>
             </ul>
             </ul>
         </div>
         </div>
     </div>
     </div>
@@ -120,6 +106,7 @@
                 <th>店铺ID</th>
                 <th>店铺ID</th>
                 <th>会员ID</th>
                 <th>会员ID</th>
                 <th>通道余额</th>
                 <th>通道余额</th>
+<!--                <th>调款操作</th>-->
                 <th>通道类型</th>
                 <th>通道类型</th>
                 <th class="align-center">通道状态</th>
                 <th class="align-center">通道状态</th>
                 <th>接口余额</th>
                 <th>接口余额</th>
@@ -135,6 +122,9 @@
                         <td><?php echo $v['store_id']; ?></td>
                         <td><?php echo $v['store_id']; ?></td>
                         <td><?php echo $v['account_id']; ?></td>
                         <td><?php echo $v['account_id']; ?></td>
                         <td><?php echo $v['available_predeposit']; ?></td>
                         <td><?php echo $v['available_predeposit']; ?></td>
+<!--                        <td>-->
+<!--                            <a href="index.php?act=provider&op=recharge_manual&type=edit&provider_id=--><?php //echo $v['provider_id'] ?><!--">调款</a>-->
+<!--                        </td>-->
                         <td><?php echo $output['type_text'][$v['type']-1]; ?></td>
                         <td><?php echo $output['type_text'][$v['type']-1]; ?></td>
 
 
                         <td class="align-center">
                         <td class="align-center">

+ 268 - 37
admin/templates/default/provider.price.php

@@ -40,57 +40,288 @@
         <table class="table tb-type2">
         <table class="table tb-type2">
             <thead>
             <thead>
             <tr class="thead">
             <tr class="thead">
-                <th class="align-center w10pre">机构编码</th>
-                <th class="align-center w10pre">机构名称</th>
-                <th class="align-center w10pre">超时时间(秒)</th>
-                <th class="align-center w15pre">15分钟(移 | 联 | 电)</th>
-                <th class="align-center w10pre">30分钟</th>
-                <th class="align-center w15pre">1小时</th>
-                <th class="align-center w10pre">2小时</th>
-                <th class="align-center w10pre">当天</th>
+                <th class="align-center w1pre">通道组ID</th>
+                <th class="align-center w1pre">通道组名称</th>
+                <th class="align-center w1pre">通道组编码</th>
+                <th class="align-center">10元</th>
+                <th class="align-center">20元</th>
+                <th class="align-center">30元</th>
+                <th class="align-center">50元</th>
+                <th class="align-center">100元</th>
+                <th class="align-center">200元</th>
+                <th class="align-center">300元</th>
+                <th class="align-center">500元</th>
+                <th class="align-center">1000元</th>
+                <th class="align-center">2000元</th>
+                <th class="align-center">实时余额</th>
             </thead>
             </thead>
             <tbody>
             <tbody>
-            <?php if (!empty($output['list']) && is_array($output['list'])) { ?>
+            <tr class="trFlex">
+                <td rowspan="3" class="align-center" style="color: red">中国移动</td>
+                        <td class="align-center">11</td>
+                        <td class="align-center">2211</td>
+                        <th class="align-center">10元</th>
+                <td class="align-center">20元</td>
+                <td class="align-center">30元</td>
+                <td class="align-center">50元</td>
+                <td class="align-center">100元</td>
+                <td class="align-center">200元</td>
+                <td class="align-center">300元</td>
+                <td class="align-center">500元</td>
+                <td class="align-center">1000元</td>
+                <td class="align-center">2200元</td>
+                <td class="align-center">2200元</td>
+          
+                    </tr>
+                    
+            <tr class="trFlex">
+                        <td class="align-center">11</td>
+                        <!-- <td class="align-center">中国移动</td> -->
+                        <td class="align-center">2211</td>
+                        <th class="align-center">10元</th>
+                <td class="align-center">20元</td>
+                <td class="align-center">30元</td>
+                <td class="align-center">50元</td>
+                <td class="align-center">100元</td>
+                <td class="align-center">200元</td>
+                <td class="align-center">300元</td>
+                <td class="align-center">500元</td>
+                <td class="align-center">1000元</td>
+                <td class="align-center">2200元</td>
+                <td class="align-center">2200元</td>
+          
+                    </tr>
+                    <tr  class="trFlex"> 
+                    <td class="align-center">11</td>
+                        <!-- <td class="align-center">中国移动</td> -->
+                        <td class="align-center">2211</td>
+                        <th class="align-center">10元</th>
+                <td class="align-center">20元</td>
+                <td class="align-center">30元</td>
+                <td class="align-center">50元</td>
+                <td class="align-center">100元</td>
+                <td class="align-center">200元</td>
+                <td class="align-center">300元</td>
+                <td class="align-center">500元</td>
+                <td class="align-center">1000元</td>
+                <td class="align-center">2200元</td>
+                <td class="align-center">2200元</td>
+          
+                    </tr>
+                    <tr  class="trFlex"> 
+                        <td rowspan="3" class="align-center" style="color: red">中国联通</td>
+                    <td class="align-center">11</td>
+                        <td class="align-center">2211</td>
+                        <th class="align-center">10元</th>
+                <td class="align-center">20元</td>
+                <td class="align-center">30元</td>
+                <td class="align-center">50元</td>
+                <td class="align-center">100元</td>
+                <td class="align-center">200元</td>
+                <td class="align-center">300元</td>
+                <td class="align-center">500元</td>
+                <td class="align-center">1000元</td>
+                <td class="align-center">2200元</td>
+                <td class="align-center">2200元</td>
+          
+                    </tr>
+                    <tr  class="trFlex"> 
+                    <td class="align-center">11</td>
+                        <td class="align-center">2211</td>
+                        <th class="align-center">10元</th>
+                <td class="align-center">20元</td>
+                <td class="align-center">30元</td>
+                <td class="align-center">50元</td>
+                <td class="align-center">100元</td>
+                <td class="align-center">200元</td>
+                <td class="align-center">300元</td>
+                <td class="align-center">500元</td>
+                <td class="align-center">1000元</td>
+                <td class="align-center">2200元</td>
+                <td class="align-center">2200元</td>
+          
+                    </tr>
+                    <tr  class="trFlex"> 
+                    <td class="align-center">11</td>
+                        <td class="align-center">2211</td>
+                        <th class="align-center">10元</th>
+                <td class="align-center">20元</td>
+                <td class="align-center">30元</td>
+                <td class="align-center">50元</td>
+                <td class="align-center">100元</td>
+                <td class="align-center">200元</td>
+                <td class="align-center">300元</td>
+                <td class="align-center">500元</td>
+                <td class="align-center">1000元</td>
+                <td class="align-center">2200元</td>
+                <td class="align-center">2200元</td>
+          
+                    </tr>
+                    
+                    <tr  class="trFlex"> 
+                        <td rowspan="3" class="align-center" style="color: red">中国电信</td>
+                    <td class="align-center">11</td>
+                        <td class="align-center">2211</td>
+                        <th class="align-center">10元</th>
+                <td class="align-center">20元</td>
+                <td class="align-center">30元</td>
+                <td class="align-center">50元</td>
+                <td class="align-center">100元</td>
+                <td class="align-center">200元</td>
+                <td class="align-center">300元</td>
+                <td class="align-center">500元</td>
+                <td class="align-center">1000元</td>
+                <td class="align-center">2200元</td>
+                <td class="align-center">2200元</td>
+          
+                    </tr>
+                    <tr  class="trFlex"> 
+                    <td class="align-center">11</td>
+                        <td class="align-center">2211</td>
+                        <th class="align-center">10元</th>
+                <td class="align-center">20元</td>
+                <td class="align-center">30元</td>
+                <td class="align-center">50元</td>
+                <td class="align-center">100元</td>
+                <td class="align-center">200元</td>
+                <td class="align-center">300元</td>
+                <td class="align-center">500元</td>
+                <td class="align-center">1000元</td>
+                <td class="align-center">2200元</td>
+                <td class="align-center">2200元</td>
+          
+                    </tr>
+                    <tr  class="trFlex"> 
+                    <td class="align-center">11</td>
+                        <td class="align-center">2211</td>
+                        <th class="align-center">10元</th>
+                <td class="align-center">20元</td>
+                <td class="align-center">30元</td>
+                <td class="align-center">50元</td>
+                <td class="align-center">100元</td>
+                <td class="align-center">200元</td>
+                <td class="align-center">300元</td>
+                <td class="align-center">500元</td>
+                <td class="align-center">1000元</td>
+                <td class="align-center">2200元</td>
+                <td class="align-center">2200元</td>
+          
+                    </tr>
+                    
+                    <tr  class="trFlex"> 
+                        <td rowspan="3" class="align-center" style="color: red">石油</td>
+                    <td class="align-center">11</td>
+                        <td class="align-center">2211</td>
+                        <th class="align-center">10元</th>
+                <td class="align-center">20元</td>
+                <td class="align-center">30元</td>
+                <td class="align-center">50元</td>
+                <td class="align-center">100元</td>
+                <td class="align-center">200元</td>
+                <td class="align-center">300元</td>
+                <td class="align-center">500元</td>
+                <td class="align-center">1000元</td>
+                <td class="align-center">2200元</td>
+                <td class="align-center">2200元</td>
+          
+                    </tr>
+                    <tr  class="trFlex"> 
+                    <td class="align-center">11</td>
+                        <td class="align-center">2211</td>
+                        <th class="align-center">10元</th>
+                <td class="align-center">20元</td>
+                <td class="align-center">30元</td>
+                <td class="align-center">50元</td>
+                <td class="align-center">100元</td>
+                <td class="align-center">200元</td>
+                <td class="align-center">300元</td>
+                <td class="align-center">500元</td>
+                <td class="align-center">1000元</td>
+                <td class="align-center">2200元</td>
+                <td class="align-center">2200元</td>
+          
+                    </tr>
+                    <tr  class="trFlex"> 
+                    <td class="align-center">11</td>
+                        <td class="align-center">2211</td>
+                        <th class="align-center">10元</th>
+                <td class="align-center">20元</td>
+                <td class="align-center">30元</td>
+                <td class="align-center">50元</td>
+                <td class="align-center">100元</td>
+                <td class="align-center">200元</td>
+                <td class="align-center">300元</td>
+                <td class="align-center">500元</td>
+                <td class="align-center">1000元</td>
+                <td class="align-center">2200元</td>
+                <td class="align-center">2200元</td>
+          
+                    </tr>
+                    
+                    <tr  class="trFlex"> 
+                        <td rowspan="3" class="align-center" style="color: red">石化</td>
+                    <td class="align-center">11</td>
+                        <td class="align-center">2211</td>
+                        <th class="align-center">10元</th>
+                <td class="align-center">20元</td>
+                <td class="align-center">30元</td>
+                <td class="align-center">50元</td>
+                <td class="align-center">100元</td>
+                <td class="align-center">200元</td>
+                <td class="align-center">300元</td>
+                <td class="align-center">500元</td>
+                <td class="align-center">1000元</td>
+                <td class="align-center">2200元</td>
+                <td class="align-center">2200元</td>
+          
+                    </tr>
+                    <tr  class="trFlex"> 
+                    <td class="align-center">11</td>
+                        <td class="align-center">2211</td>
+                        <th class="align-center">10元</th>
+                <td class="align-center">20元</td>
+                <td class="align-center">30元</td>
+                <td class="align-center">50元</td>
+                <td class="align-center">100元</td>
+                <td class="align-center">200元</td>
+                <td class="align-center">300元</td>
+                <td class="align-center">500元</td>
+                <td class="align-center">1000元</td>
+                <td class="align-center">2200元</td>
+                <td class="align-center">2200元</td>
+          
+                    </tr>
+                    <tr  class="trFlex"> 
+                    <td class="align-center">11</td>
+                        <td class="align-center">2211</td>
+                        <th class="align-center">10元</th>
+                <td class="align-center">20元</td>
+                <td class="align-center">30元</td>
+                <td class="align-center">50元</td>
+                <td class="align-center">100元</td>
+                <td class="align-center">200元</td>
+                <td class="align-center">300元</td>
+                <td class="align-center">500元</td>
+                <td class="align-center">1000元</td>
+                <td class="align-center">2200元</td>
+                <td class="align-center">2200元</td>
+          
+                    </tr>
+            <!-- <?php if (!empty($output['list']) && is_array($output['list'])) { ?>
                 <?php foreach ($output['list'] as $k => $v) { ?>
                 <?php foreach ($output['list'] as $k => $v) { ?>
                     <tr class="trFlex">
                     <tr class="trFlex">
                         <td class="align-center"><?php echo $k; ?></td>
                         <td class="align-center"><?php echo $k; ?></td>
                         <td class="align-center"><?php echo $v['company_name']; ?></td>
                         <td class="align-center"><?php echo $v['company_name']; ?></td>
                         <td class="align-center"><?php echo $v['time_out']; ?></td>
                         <td class="align-center"><?php echo $v['time_out']; ?></td>
                         <td class="align-center"><?php echo ($v['ratio']['ALL'][900] * 100) ?? 0; ?>% <br> <br>
                         <td class="align-center"><?php echo ($v['ratio']['ALL'][900] * 100) ?? 0; ?>% <br> <br>
-                        <?php echo ($v['ratio']['YD'][900] * 100) ?? 0; ?>%
-                        &emsp;|&emsp;<?php echo ($v['ratio']['LT'][1800] * 100) ?? 0; ?>%&emsp;|&emsp;
-                        <?php echo ($v['ratio']['DX'][900] * 100) ?? 0; ?>%
-                    
-                    </td>
-                        <td class="align-center"><?php echo ($v['ratio']['ALL'][1800] * 100) ?? 0; ?>% <br> <br>
-                        <?php echo ($v['ratio']['YD'][1800] * 100) ?? 0; ?>%
-                        &emsp;|&emsp;<?php echo ($v['ratio']['LT'][1800] * 100) ?? 0; ?>%&emsp;|&emsp;
-                        <?php echo ($v['ratio']['DX'][1800] * 100) ?? 0; ?>%
-                    
-                    </td>
-                        <td class="align-center"><?php echo ($v['ratio']['ALL'][3600] * 100) ?? 0; ?>% <br> <br>
-                        <?php echo ($v['ratio']['YD'][3600] * 100) ?? 0; ?>%
-                        &emsp;|&emsp;<?php echo ($v['ratio']['LT'][3600] * 100) ?? 0; ?>%&emsp;|&emsp;
-                        <?php echo ($v['ratio']['DX'][3600] * 100) ?? 0; ?>%
-                    
-                    </td>
-                        <td class="align-center"><?php echo ($v['ratio']['ALL'][7200] * 100) ?? 0; ?>% <br> <br>
-                        <?php echo ($v['ratio']['YD'][7200] * 100) ?? 0; ?>%
-                        &emsp;|&emsp;<?php echo ($v['ratio']['LT'][7200] * 100) ?? 0; ?>%&emsp;|&emsp;
-                        <?php echo ($v['ratio']['DX'][7200] * 100) ?? 0; ?>%
-                    </td>
-                        <td class="align-center"><?php echo ($v['ratio']['ALL'][86400] * 100) ?? 0; ?>% <br> <br>
-                        <?php echo ($v['ratio']['YD'][86400] * 100) ?? 0; ?>%
-                        &emsp;|&emsp;<?php echo ($v['ratio']['LT'][86400] * 100) ?? 0; ?>%&emsp;|&emsp;
-                        <?php echo ($v['ratio']['DX'][86400] * 100) ?? 0; ?>%
-                    </td>
+          
                     </tr>
                     </tr>
                 <?php } ?>
                 <?php } ?>
             <?php } else { ?>
             <?php } else { ?>
                 <tr class="no_data">
                 <tr class="no_data">
                     <td colspan="7"><?php echo $lang['nc_no_record']; ?></td>
                     <td colspan="7"><?php echo $lang['nc_no_record']; ?></td>
                 </tr>
                 </tr>
-            <?php } ?>
+            <?php } ?> -->
             </tbody>
             </tbody>
             <tfoot>
             <tfoot>
             <tr class="tfoot">
             <tr class="tfoot">

+ 180 - 0
admin/templates/default/provider.recharge.php

@@ -0,0 +1,180 @@
+<?php defined('InShopNC') or exit('Access Invalid!'); ?>
+<!--//zmr>v20-->
+<div class="page">
+    <div class="fixed-bar">
+        <div class="item-title">
+            <h3>通道调款</h3>
+            <ul class="tab-base">
+                <li><a href="index.php?act=provider&op=index"><span><?php echo $lang['nc_manage'] ?></span></a></li>
+                <li><a href="JavaScript:void(0);" class="current"><span>调款</span></a></li>
+            </ul>
+        </div>
+    </div>
+    <div class="fixed-empty"></div>
+    <form id="points_form" method="post" name="form1" enctype="multipart/form-data">
+        <input type="hidden" name="form_submit" value="ok"/>
+        <table class="table tb-type2 nobdb">
+            <tbody>
+            <tr class="noborder">
+                <td colspan="2" class="required"><label class="validation">通道名称:</label></td>
+            </tr>
+            <tr class="noborder">
+                <td class="vatop rowform">
+                    <?php echo $output['provider']['name']; ?>
+                <td class="vatop tips"></td>
+            </tr>
+            <tr class="noborder">
+                <td colspan="2" class="required"><label class="validation">操作人姓名:</label></td>
+            </tr>
+            <tr class="noborder">
+                <td class="vatop rowform">
+                    <input type="text" name="operation" id="operation" class="txt" value="">
+                <td class="vatop tips"></td>
+            </tr>
+            <tr class="noborder">
+                <td class="vatop" style="width: 370px">
+                <label class="validation">金额:</label>
+                    <select name="operatetype">
+                        <option value="add">增加</option>
+                        <option value="del">减少</option>
+                    </select>
+                    <input type="text" id="pointsnum" name="pointsnum" class="txt">
+                    <div id="money" style="color:red; display: inline-block"></div>
+                </td>
+                <td class="vatop tips"></td>
+            </tr>
+            </tbody>
+            <tfoot>
+            <tr class="tfoot">
+                <td colspan="2"><a href="JavaScript:void(0);" class="btn"
+                                   onclick="document.form1.submit()"><span><?php echo $lang['nc_submit']; ?></span></a>
+                </td>
+            </tr>
+            </tfoot>
+        </table>
+    </form>
+</div>
+<script type="text/javascript">
+    $(function () {
+        $("#voucher").change(function () {
+            $("#textfield1").val($(this).val());
+        });
+        $('#points_form').validate({
+            rules: {
+                apply_id: {
+                    required: true
+                },
+                pointsnum: {
+                    required: true,
+                }
+            },
+            messages: {
+                apply_id: {
+                    required: '请输入申请编号'
+                },
+                pointsnum: {
+                    required: '请添加预存款'
+                }
+            }
+        });
+        function cnMoneyFormat(money) {
+        var number_data = money;
+        number_data = parseInt(number_data);
+
+        let yi = 0; //亿
+        let wan = 0; //万
+        let qian = 0; //千
+        let bai = 0; //百
+
+        let bai_s = 100; //百
+        let qian_s = 1000; //千
+        let wan_s = 10000; //万
+        let yi_s = 100000000; //亿
+
+        //取整
+        function qz(data) {
+          data = Math.floor(data);
+          return data;
+        }
+        //为0判断输出
+        function data_if(data, amount) {
+          if (data == 0) {
+            return '';
+          } else {
+            return data + amount;
+          }
+        }
+        //亿
+        function yi_f(data) {
+          yi = qz(data / 100000000);
+          data = data - (yi * yi_s);
+          let data_json = {
+            data1: data_if(yi, '亿'),
+            data2: data,
+          }
+          return data_json;
+        }
+        //万
+        function wan_f(data) {
+          wan = qz(data / 10000);
+          data = data - (wan * wan_s);
+          let data_json = {
+            data1: data_if(wan, '万'),
+            data2: data,
+          }
+          return data_json;
+        }
+        //千
+        function qian_f(data) {
+          qian = qz(data / 1000);
+          data = data - (qian * qian_s);
+          let data_json = {
+            data1: data_if(qian, '千'),
+            data2: data,
+          }
+          return data_json;
+        }
+        // 百
+        function bai_f(data) {
+          bai = qz(data / 100);
+          data = data - (bai * bai_s);
+          let data_json = {
+            data1: bai,
+            data2: data,
+          }
+          return data_json;
+        }
+    
+        yi = yi_f(number_data);
+        number_data = yi.data2;
+        wan = wan_f(number_data);
+        number_data = wan.data2;
+
+        qian = qian_f(number_data);
+        number_data = qian.data2;
+
+        bai = bai_f(number_data);
+        number_data = bai.data2;
+        
+      
+        let result = yi.data1 + wan.data1 + qian.data1 + bai.data1 +  + number_data;
+        let resultvalue = result.substr(0, 1)
+
+        if (resultvalue == 0) {
+          result = result.substr(1, result.length)
+        }
+        let resultvali = result.substr(0, 3);
+
+        if(resultvali == 'NaN') {
+        $("#money").text('')
+        }else {
+        $("#money").text(result)
+        }       
+    
+    }
+  $('#pointsnum').change(function () {
+    let val =($(this).val())
+     $('#money').text(cnMoneyFormat(val))
+  })         
+    });
+</script>

+ 0 - 141
admin/templates/default/provider.stats.php

@@ -1,141 +0,0 @@
-<?php defined('InShopNC') or exit('Access Invalid!'); ?>
-
-<div class="page">
-    <div class="fixed-bar">
-        <div class="item-title">
-            <h3>通道管理</h3>
-            <ul class="tab-base">
-                <li><a href="index.php?act=provider&op=index"><span><?php echo $lang['nc_manage'] ?></span></a></li>
-                <li><a href="index.php?act=merchant&op=provider_amount_control&type=2&form=common"><span>普通话费单量控制</span></a></li>
-                <li><a href="index.php?act=merchant&op=provider_amount_control&type=2&form=fast"><span>快充话费单量控制</span></a></li>
-                <li><a href="index.php?act=merchant&op=provider_amount_control&type=1&form=common"><span>普通油卡单量控制</span></a></li>
-                <li><a href="index.php?act=merchant&op=provider_amount_control&type=1&form=fast"><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">
-        <input type="hidden" value="merchant" name="act">
-        <input type="hidden" value="providerStats" name="op">
-        <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="query_start_time" name="query_start_time">
-                    <label for="query_start_time">~</label>
-                    <input class="txt date" type="text" value="<?php echo $_GET['query_end_time']; ?>"
-                           id="query_end_time" name="query_end_time"/></td>
-                <th><label for="name">通道名称</label></th>
-                <td>
-                    <select name="pid" class="querySelect">
-                        <option value=""><?php echo $lang['nc_please_choose']; ?></option>
-                        <?php foreach($output['provider_list'] as $provider){?>
-                        <option value="1"
-                                <?php if ($_GET['pid'] == $provider['provider_id']){ ?>selected<?php } ?>><?php echo $provider['name']?>
-                        </option>
-                        <?php }?>
-                    </select>
-                </td>
-                <td><a href="javascript:void(0);" id="ncsubmit" class="btn-search "
-                       title="<?php echo $lang['nc_query']; ?>">&nbsp;</a>
-                    <?php if ($output['name'] != '') { ?>
-                        <a href="index.php?act=merchant&op=providerStats" 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>--><?php //echo $lang['nc_prompts'];?><!--</h5>-->
-    <!--            <span class="arrow"></span></div></th>-->
-    <!--      </tr>-->
-    <!--      <tr>-->
-    <!--        <td><ul>-->
-    <!--            <li>--><?php //echo $lang['store_help1'];?><!--</li>-->
-    <!--          </ul></td>-->
-    <!--      </tr>-->
-    <!--    </tbody>-->
-    <!--  </table>-->
-    <form method="post" id="merchant_name_form">
-        <input type="hidden" name="form_submit" value="ok"/>
-        <table class="table tb-type2">
-            <thead>
-            <tr class="thead">
-                <th>通道id</th>
-                <th>通道名称</th>
-                <th>通道类型</th>
-                <th class="align-center">排序</th>
-                <th class="align-center">通道状态</th>
-                <th class="align-center">每单间隔秒数</th>
-                <th class="align-center">需要子进程数量</th>
-                <th class="align-center">每日额度</th>
-                <th class="align-center">每日时间段</th>
-                <th class="align-center"><?php echo $lang['operation']; ?></th>
-            </tr>
-            </thead>
-            <tbody>
-            <?php if (!empty($output['provider_list']) && is_array($output['provider_list'])) { ?>
-                <?php foreach ($output['provider_list'] as $k => $v) { ?>
-                    <tr>
-                        <td><?php echo $v['provider_id']; ?></td>
-                        <td><?php echo $v['name']; ?></td>
-                        <td><?php echo $output['type_text'][$v['type']-1]; ?></td>
-                        <td class="align-center"><?php echo $v['sort']; ?></td>
-                        <td class="align-center">
-                            <?php if($v['opened'] == 1){?>
-                            <span style="color: #0bb20c">
-                            <?php }?>
-                                <?php if($v['opened'] == 2){?>
-                                <span style="color: #f30707">
-                            <?php }?>
-                            <?php echo $output['opened_text'][$v['opened']-1]; ?>
-                                </span>
-                        </td>
-                        <td class="align-center"><?php echo $v['interval_sec']?></td>
-                        <td class="align-center"><?php echo $v['process_num']?></td>
-                        <td class="align-center"><?php echo $v['every_amt']?></td>
-                        <td class="align-center"><?php echo $v['period']?></td>
-                        <td class="align-center w200">
-                            <?php if($v['opened'] == 1){?>
-                                <a href="index.php?act=merchant&op=changeProviderState&state=2&id=<?php echo $v['provider_id'] ?>">关闭通道</a>
-                            <?php }?>
-                            <?php if($v['opened'] == 2){?>
-                                <a href="index.php?act=merchant&op=changeProviderState&state=1&id=<?php echo $v['provider_id'] ?>">启用通道</a>
-                            <?php }?>
-                            | <a href="index.php?act=merchant&op=provider_edit&id=<?php echo $v['provider_id'] ?>">编辑通道</a>
-<!--                            | <a href="index.php?act=merchant&op=provider_del&id=--><?php //echo $v['provider_id'] ?><!--">删除通道</a>-->
-                        </td>
-                    </tr>
-                <?php } ?>
-            <?php } else { ?>
-                <tr class="no_data">
-                    <td colspan="15"><?php echo $lang['nc_no_record']; ?></td>
-                </tr>
-            <?php } ?>
-            </tbody>
-            <tfoot>
-            <tr class="tfoot">
-                <td></td>
-                <td colspan="16">
-                    <div class="pagination"><?php echo $output['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>
-    $(function () {
-        $('#ncsubmit').click(function () {
-            $('input[name="op"]').val('provider');
-            $('#formSearch').submit();
-        });
-    });
-</script>

+ 4 - 15
admin/templates/default/recharge.manual.add.php

@@ -143,9 +143,9 @@
         let yi = 0; //亿
         let yi = 0; //亿
         let wan = 0; //万
         let wan = 0; //万
         let qian = 0; //千
         let qian = 0; //千
-        let bai = 0; //百
 
 
-        let bai_s = 100; //百
+
+
         let qian_s = 1000; //千
         let qian_s = 1000; //千
         let wan_s = 10000; //万
         let wan_s = 10000; //万
         let yi_s = 100000000; //亿
         let yi_s = 100000000; //亿
@@ -193,16 +193,7 @@
           }
           }
           return data_json;
           return data_json;
         }
         }
-        // 百
-        function bai_f(data) {
-          bai = qz(data / 100);
-          data = data - (bai * bai_s);
-          let data_json = {
-            data1: bai,
-            data2: data,
-          }
-          return data_json;
-        }
+
     
     
         yi = yi_f(number_data);
         yi = yi_f(number_data);
         number_data = yi.data2;
         number_data = yi.data2;
@@ -212,9 +203,7 @@
         qian = qian_f(number_data);
         qian = qian_f(number_data);
         number_data = qian.data2;
         number_data = qian.data2;
 
 
-        bai = bai_f(number_data);
-        number_data = bai.data2;
-        let result = yi.data1 + wan.data1 + qian.data1 + bai.data1 +  + number_data;
+        let result = yi.data1 + wan.data1 + qian.data1   + number_data;
       
       
         let resultvalue = result.substr(0, 1)
         let resultvalue = result.substr(0, 1)
 
 

+ 3 - 15
admin/templates/default/recharge.manual.edit.php

@@ -116,9 +116,7 @@
         let yi = 0; //亿
         let yi = 0; //亿
         let wan = 0; //万
         let wan = 0; //万
         let qian = 0; //千
         let qian = 0; //千
-        let bai = 0; //百
 
 
-        let bai_s = 100; //百
         let qian_s = 1000; //千
         let qian_s = 1000; //千
         let wan_s = 10000; //万
         let wan_s = 10000; //万
         let yi_s = 100000000; //亿
         let yi_s = 100000000; //亿
@@ -166,16 +164,7 @@
           }
           }
           return data_json;
           return data_json;
         }
         }
-        // 百
-        function bai_f(data) {
-          bai = qz(data / 100);
-          data = data - (bai * bai_s);
-          let data_json = {
-            data1: bai,
-            data2: data,
-          }
-          return data_json;
-        }
+        
     
     
         yi = yi_f(number_data);
         yi = yi_f(number_data);
         number_data = yi.data2;
         number_data = yi.data2;
@@ -185,11 +174,10 @@
         qian = qian_f(number_data);
         qian = qian_f(number_data);
         number_data = qian.data2;
         number_data = qian.data2;
 
 
-        bai = bai_f(number_data);
-        number_data = bai.data2;
+
         
         
       
       
-        let result = yi.data1 + wan.data1 + qian.data1 + bai.data1 +  + number_data;
+        let result = yi.data1 + wan.data1 + qian.data1 + number_data;
         let resultvalue = result.substr(0, 1)
         let resultvalue = result.substr(0, 1)
 
 
         if (resultvalue == 0) {
         if (resultvalue == 0) {

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

@@ -94,7 +94,9 @@
     .db-top {
     .db-top {
         padding: 0 30px;
         padding: 0 30px;
     }
     }
-
+    a:hover, a:visited, a:link, a:active {
+    color: #333;
+}
 </style>
 </style>
 <?php defined('InShopNC') or exit('Access Invalid!'); ?>
 <?php defined('InShopNC') or exit('Access Invalid!'); ?>
 <div class="page">
 <div class="page">

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

@@ -428,7 +428,7 @@
         let str = ''
         let str = ''
         $('#tbody tr').each(function () {
         $('#tbody tr').each(function () {
             let card_no = $(this).find('td').eq(4).text()
             let card_no = $(this).find('td').eq(4).text()
-            let channel_no = $(this).find('td').eq(14).text()
+            let channel_no = $(this).find('td').eq(15).text()
             str += card_no + ' ' + channel_no + '\n'
             str += card_no + ' ' + channel_no + '\n'
         })
         })
         let oInput = document.createElement("textarea");
         let oInput = document.createElement("textarea");

+ 25 - 3
data/config/dev/refill.ini.php

@@ -1490,9 +1490,31 @@ $config['auto_find_channels'] = true;
 $config['cancel_retry_time'] = [10120 => ["9:00",'10:00','11:00']];
 $config['cancel_retry_time'] = [10120 => ["9:00",'10:00','11:00']];
 $config['merchant_retry_times'] = [
 $config['merchant_retry_times'] = [
     1092 => [
     1092 => [
-        'qualities' => [1 => ['secs' => 300, 'times' => 5], 2 => ['secs' => 300, 'times' => 200]],
-        'lower_ratio' => ['ratio' => 0.9,'period' => 3600]
-    ]    
+        'qualities' => [1 => ['secs' => 420, 'times' => 100], 2 => ['secs' => 180, 'times' => 100]],
+        'lower_ratio' => ['ratio' => 0.9, 'period' => 3600], 'profit_ratio' => 0.005
+    ],
+//    10213 => [ //邀友-普充10分 ,昵称 二号
+//        'qualities' => [1 => ['secs' => 1100, 'times' => 100], 2 => ['secs' => 100, 'times' => 5]],
+//        'lower_ratio' => ['ratio' => 0.9,'period' => 3600]
+//    ],
+    10211 => [ //飘逸-混充20分
+        'qualities' => [1 => ['secs' => 1100, 'times' => 100], 2 => ['secs' => 100, 'times' => 5]],
+        'lower_ratio' => ['ratio' => 0.9, 'period' => 3600]
+    ],
+    10216 => [ //飘逸-10分
+        'qualities' => [1 => ['secs' => 530, 'times' => 100], 2 => ['secs' => 70, 'times' => 5]],
+        'lower_ratio' => ['ratio' => 0.4, 'period' => 3600], 'profit_ratio' => 0.005
+    ],
+    10217 => [ //天采-混充10m
+        'qualities' => [1 => ['secs' => 1100, 'times' => 100], 2 => ['secs' => 100, 'times' => 5]],
+        'lower_ratio' => ['ratio' => 0.9, 'period' => 3600]
+    ]
+];
+
+//// "status": 1 //状态 0:空号;1:实号;2:停机;3:库无;4:沉默号;5:风险号
+$config['merchant_intercept'] = [
+    1092 => ['card_states' => [2,4],'is_transfer' => false],
+    10213 => ['card_states' => [],'is_transfer' => true]
 ];
 ];
 
 
 //// "status": 1 //状态 0:空号;1:实号;2:停机;3:库无;4:沉默号;5:风险号
 //// "status": 1 //状态 0:空号;1:实号;2:停机;3:库无;4:沉默号;5:风险号

+ 39 - 26
data/config/win/refill.ini.php

@@ -559,38 +559,38 @@ $xc_phone = ['name' => 'xc', 'store_id' => 34, 'qualitys' => '4',
 $xunyin_phone = ['name' => 'xunyin', 'store_id' => 35,'qualitys' => '2',
 $xunyin_phone = ['name' => 'xunyin', 'store_id' => 35,'qualitys' => '2',
     'amount' => [
     'amount' => [
         10 => [
         10 => [
-            ['goods_id' => 6438, 'price' => 10, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6438, 'price' => 10.05, 'quality' => 2, 'card_type' => 'chinamobile'],
             ['goods_id' => 6438, 'price' => 10.08, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6438, 'price' => 10.08, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6438, 'price' => 10, 'quality' => 2, 'card_type' => 'chinatelecom']
             ['goods_id' => 6438, 'price' => 10, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         ],
         20 => [
         20 => [
-            ['goods_id' => 6439, 'price' => 20, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6439, 'price' => 20.1, 'quality' => 2, 'card_type' => 'chinamobile'],
             ['goods_id' => 6439, 'price' => 20.16, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6439, 'price' => 20.16, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6439, 'price' => 20, 'quality' => 2, 'card_type' => 'chinatelecom']
             ['goods_id' => 6439, 'price' => 20, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         ],
         30 => [
         30 => [
-            ['goods_id' => 6440, 'price' => 30, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6440, 'price' => 30.15, 'quality' => 2, 'card_type' => 'chinamobile'],
             ['goods_id' => 6440, 'price' => 30.24, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6440, 'price' => 30.24, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6440, 'price' => 30, 'quality' => 2, 'card_type' => 'chinatelecom']
             ['goods_id' => 6440, 'price' => 30, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         ],
         50 => [
         50 => [
-            ['goods_id' => 6441, 'price' => 49.75, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6441, 'price' => 50.1, 'quality' => 2, 'card_type' => 'chinamobile'],
             ['goods_id' => 6441, 'price' => 50, 'quality' => 2, 'card_type' => 'chinaunicom,chinatelecom']
             ['goods_id' => 6441, 'price' => 50, 'quality' => 2, 'card_type' => 'chinaunicom,chinatelecom']
         ],
         ],
         100 => [
         100 => [
-            ['goods_id' => 6442, 'price' => 99.5, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6442, 'price' => 100.2, 'quality' => 2, 'card_type' => 'chinamobile'],
             ['goods_id' => 6442, 'price' => 100, 'quality' => 2, 'card_type' => 'chinaunicom,chinatelecom']
             ['goods_id' => 6442, 'price' => 100, 'quality' => 2, 'card_type' => 'chinaunicom,chinatelecom']
         ],
         ],
         200 => [
         200 => [
-            ['goods_id' => 6443, 'price' => 200, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6443, 'price' => 200.4, 'quality' => 2, 'card_type' => 'chinamobile'],
             ['goods_id' => 6443, 'price' => 200, 'quality' => 2, 'card_type' => 'chinaunicom,chinatelecom']
             ['goods_id' => 6443, 'price' => 200, 'quality' => 2, 'card_type' => 'chinaunicom,chinatelecom']
         ],
         ],
         300 => [
         300 => [
-            ['goods_id' => 6444, 'price' => 300, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6444, 'price' => 300.6, 'quality' => 2, 'card_type' => 'chinamobile'],
             ['goods_id' => 6444, 'price' => 300, 'quality' => 2, 'card_type' => 'chinaunicom,chinatelecom']
             ['goods_id' => 6444, 'price' => 300, 'quality' => 2, 'card_type' => 'chinaunicom,chinatelecom']
         ],
         ],
         500 => [
         500 => [
-            ['goods_id' => 6445, 'price' => 500, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6445, 'price' => 501, 'quality' => 2, 'card_type' => 'chinamobile'],
             ['goods_id' => 6445, 'price' => 500, 'quality' => 2, 'card_type' => 'chinaunicom,chinatelecom']
             ['goods_id' => 6445, 'price' => 500, 'quality' => 2, 'card_type' => 'chinaunicom,chinatelecom']
         ]
         ]
     ],
     ],
@@ -2025,35 +2025,43 @@ $xianghongrui_phone = ['name' => 'xianghongrui', 'store_id' => 107,'qualitys' =>
     'amount' => [
     'amount' => [
         10 => [
         10 => [
             ['goods_id' => 6949, 'price' => 9.55, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6949, 'price' => 9.55, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6949, 'price' => 9.5, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
+            ['goods_id' => 6949, 'price' => 9.5, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 6949, 'price' => 9.52, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         ],
         20 => [
         20 => [
             ['goods_id' => 6950, 'price' => 19.1, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6950, 'price' => 19.1, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6950, 'price' => 19, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
+            ['goods_id' => 6950, 'price' => 19, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 6950, 'price' => 19.04, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         ],
         30 => [
         30 => [
             ['goods_id' => 6951, 'price' => 28.65, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6951, 'price' => 28.65, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6951, 'price' => 28.5, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
+            ['goods_id' => 6951, 'price' => 28.5, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 6951, 'price' => 28.56, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         ],
         50 => [
         50 => [
             ['goods_id' => 6952, 'price' => 47.75, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6952, 'price' => 47.75, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6952, 'price' => 47.5, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
+            ['goods_id' => 6952, 'price' => 47.5, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 6952, 'price' => 47.6, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         ],
         100 => [
         100 => [
             ['goods_id' => 6953, 'price' => 95.5, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6953, 'price' => 95.5, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6953, 'price' => 95, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
+            ['goods_id' => 6953, 'price' => 95, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 6953, 'price' => 95.2, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         ],
         200 => [
         200 => [
             ['goods_id' => 6954, 'price' => 191, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6954, 'price' => 191, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6954, 'price' => 190, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
+            ['goods_id' => 6954, 'price' => 190, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 6954, 'price' => 190.4, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         ],
         300 => [
         300 => [
             ['goods_id' => 6955, 'price' => 286.5, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6955, 'price' => 286.5, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6955, 'price' => 285, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
+            ['goods_id' => 6955, 'price' => 285, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 6955, 'price' => 285.6, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         ],
         500 => [
         500 => [
             ['goods_id' => 6956, 'price' => 477.5, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6956, 'price' => 477.5, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6956, 'price' => 475, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
+            ['goods_id' => 6956, 'price' => 475, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 6956, 'price' => 476, 'quality' => 1, 'card_type' => 'chinatelecom']
         ]
         ]
     ],
     ],
     'official_sn' => true, 'refill_type' => 'api'];
     'official_sn' => true, 'refill_type' => 'api'];
@@ -2245,23 +2253,28 @@ $yikatong_phone = ['name' => 'yikatong', 'store_id' => 118, 'qualitys' => '1',
         ],
         ],
         30 => [
         30 => [
             ['goods_id' => 7029, 'price' => 28.5, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 7029, 'price' => 28.5, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 7029, 'price' => 28.35, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
+            ['goods_id' => 7029, 'price' => 28.35, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7029, 'price' => 28.35, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         ],
         50 => [
         50 => [
             ['goods_id' => 7030, 'price' => 47.5, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 7030, 'price' => 47.5, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 7030, 'price' => 47.25, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
+            ['goods_id' => 7030, 'price' => 47.25, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7030, 'price' => 47.25, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         ],
         100 => [
         100 => [
             ['goods_id' => 7031, 'price' => 95, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 7031, 'price' => 95, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 7031, 'price' => 94.5, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
+            ['goods_id' => 7031, 'price' => 94.5, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7031, 'price' => 94.5, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         ],
         200 => [
         200 => [
             ['goods_id' => 7032, 'price' => 190, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 7032, 'price' => 190, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 7032, 'price' => 189, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
+            ['goods_id' => 7032, 'price' => 189, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7032, 'price' => 189, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         ],
         300 => [
         300 => [
             ['goods_id' => 7033, 'price' => 285, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 7033, 'price' => 285, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 7033, 'price' => 283.5, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
+            ['goods_id' => 7033, 'price' => 283.5, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7033, 'price' => 283.5, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         ],
         500 => [
         500 => [
             ['goods_id' => 7034, 'price' => 475, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 7034, 'price' => 475, 'quality' => 1, 'card_type' => 'chinamobile'],
@@ -2896,8 +2909,8 @@ $config['auto_find_channels'] = true;
 $config['cancel_retry_time'] = [10120 => ["9:00",'10:00','11:00']];
 $config['cancel_retry_time'] = [10120 => ["9:00",'10:00','11:00']];
 $config['merchant_retry_times'] = [
 $config['merchant_retry_times'] = [
     1092 => [
     1092 => [
-        'qualities' => [1 => ['secs' => 420, 'times' => 100], 2 => ['secs' => 180, 'times' => 100]],
-        'lower_ratio' => ['ratio' => 0.9,'period' => 3600]
+        'qualities' => [1 => ['secs' => 200, 'times' => 100], 2 => ['secs' => 180, 'times' => 100]],
+        'lower_ratio' => ['ratio' => 0.9, 'period' => 3600], 'profit_ratio' => 0.005
     ],
     ],
 //    10213 => [ //邀友-普充10分 ,昵称 二号
 //    10213 => [ //邀友-普充10分 ,昵称 二号
 //        'qualities' => [1 => ['secs' => 1100, 'times' => 100], 2 => ['secs' => 100, 'times' => 5]],
 //        'qualities' => [1 => ['secs' => 1100, 'times' => 100], 2 => ['secs' => 100, 'times' => 5]],
@@ -2905,15 +2918,15 @@ $config['merchant_retry_times'] = [
 //    ],
 //    ],
     10211 => [ //飘逸-混充20分
     10211 => [ //飘逸-混充20分
         'qualities' => [1 => ['secs' => 1100, 'times' => 100], 2 => ['secs' => 100, 'times' => 5]],
         'qualities' => [1 => ['secs' => 1100, 'times' => 100], 2 => ['secs' => 100, 'times' => 5]],
-        'lower_ratio' => ['ratio' => 0.9,'period' => 3600]
+        'lower_ratio' => ['ratio' => 0.9, 'period' => 3600], 'profit_ratio' => 0.003
     ],
     ],
     10216 => [ //飘逸-10分
     10216 => [ //飘逸-10分
         'qualities' => [1 => ['secs' => 530, 'times' => 100], 2 => ['secs' => 70, 'times' => 5]],
         'qualities' => [1 => ['secs' => 530, 'times' => 100], 2 => ['secs' => 70, 'times' => 5]],
-        'lower_ratio' => ['ratio' => 0.4,'period' => 3600]
+        'lower_ratio' => ['ratio' => 0.4, 'period' => 3600],'profit_ratio' => 0.015
     ],
     ],
     10217 => [ //天采-混充10m
     10217 => [ //天采-混充10m
         'qualities' => [1 => ['secs' => 1100, 'times' => 100], 2 => ['secs' => 100, 'times' => 5]],
         'qualities' => [1 => ['secs' => 1100, 'times' => 100], 2 => ['secs' => 100, 'times' => 5]],
-        'lower_ratio' => ['ratio' => 0.9,'period' => 3600]
+        'lower_ratio' => ['ratio' => 0.9, 'period' => 3600], 'profit_ratio' => 0.003
     ]
     ]
 ];
 ];
 
 

+ 39 - 26
data/config/xyz/refill.ini.php

@@ -559,38 +559,38 @@ $xc_phone = ['name' => 'xc', 'store_id' => 34, 'qualitys' => '4',
 $xunyin_phone = ['name' => 'xunyin', 'store_id' => 35,'qualitys' => '2',
 $xunyin_phone = ['name' => 'xunyin', 'store_id' => 35,'qualitys' => '2',
     'amount' => [
     'amount' => [
         10 => [
         10 => [
-            ['goods_id' => 6438, 'price' => 10, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6438, 'price' => 10.05, 'quality' => 2, 'card_type' => 'chinamobile'],
             ['goods_id' => 6438, 'price' => 10.08, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6438, 'price' => 10.08, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6438, 'price' => 10, 'quality' => 2, 'card_type' => 'chinatelecom']
             ['goods_id' => 6438, 'price' => 10, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         ],
         20 => [
         20 => [
-            ['goods_id' => 6439, 'price' => 20, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6439, 'price' => 20.1, 'quality' => 2, 'card_type' => 'chinamobile'],
             ['goods_id' => 6439, 'price' => 20.16, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6439, 'price' => 20.16, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6439, 'price' => 20, 'quality' => 2, 'card_type' => 'chinatelecom']
             ['goods_id' => 6439, 'price' => 20, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         ],
         30 => [
         30 => [
-            ['goods_id' => 6440, 'price' => 30, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6440, 'price' => 30.15, 'quality' => 2, 'card_type' => 'chinamobile'],
             ['goods_id' => 6440, 'price' => 30.24, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6440, 'price' => 30.24, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6440, 'price' => 30, 'quality' => 2, 'card_type' => 'chinatelecom']
             ['goods_id' => 6440, 'price' => 30, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         ],
         50 => [
         50 => [
-            ['goods_id' => 6441, 'price' => 49.75, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6441, 'price' => 50.1, 'quality' => 2, 'card_type' => 'chinamobile'],
             ['goods_id' => 6441, 'price' => 50, 'quality' => 2, 'card_type' => 'chinaunicom,chinatelecom']
             ['goods_id' => 6441, 'price' => 50, 'quality' => 2, 'card_type' => 'chinaunicom,chinatelecom']
         ],
         ],
         100 => [
         100 => [
-            ['goods_id' => 6442, 'price' => 99.5, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6442, 'price' => 100.2, 'quality' => 2, 'card_type' => 'chinamobile'],
             ['goods_id' => 6442, 'price' => 100, 'quality' => 2, 'card_type' => 'chinaunicom,chinatelecom']
             ['goods_id' => 6442, 'price' => 100, 'quality' => 2, 'card_type' => 'chinaunicom,chinatelecom']
         ],
         ],
         200 => [
         200 => [
-            ['goods_id' => 6443, 'price' => 200, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6443, 'price' => 200.4, 'quality' => 2, 'card_type' => 'chinamobile'],
             ['goods_id' => 6443, 'price' => 200, 'quality' => 2, 'card_type' => 'chinaunicom,chinatelecom']
             ['goods_id' => 6443, 'price' => 200, 'quality' => 2, 'card_type' => 'chinaunicom,chinatelecom']
         ],
         ],
         300 => [
         300 => [
-            ['goods_id' => 6444, 'price' => 300, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6444, 'price' => 300.6, 'quality' => 2, 'card_type' => 'chinamobile'],
             ['goods_id' => 6444, 'price' => 300, 'quality' => 2, 'card_type' => 'chinaunicom,chinatelecom']
             ['goods_id' => 6444, 'price' => 300, 'quality' => 2, 'card_type' => 'chinaunicom,chinatelecom']
         ],
         ],
         500 => [
         500 => [
-            ['goods_id' => 6445, 'price' => 500, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6445, 'price' => 501, 'quality' => 2, 'card_type' => 'chinamobile'],
             ['goods_id' => 6445, 'price' => 500, 'quality' => 2, 'card_type' => 'chinaunicom,chinatelecom']
             ['goods_id' => 6445, 'price' => 500, 'quality' => 2, 'card_type' => 'chinaunicom,chinatelecom']
         ]
         ]
     ],
     ],
@@ -2025,35 +2025,43 @@ $xianghongrui_phone = ['name' => 'xianghongrui', 'store_id' => 107,'qualitys' =>
     'amount' => [
     'amount' => [
         10 => [
         10 => [
             ['goods_id' => 6949, 'price' => 9.55, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6949, 'price' => 9.55, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6949, 'price' => 9.5, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
+            ['goods_id' => 6949, 'price' => 9.5, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 6949, 'price' => 9.52, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         ],
         20 => [
         20 => [
             ['goods_id' => 6950, 'price' => 19.1, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6950, 'price' => 19.1, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6950, 'price' => 19, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
+            ['goods_id' => 6950, 'price' => 19, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 6950, 'price' => 19.04, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         ],
         30 => [
         30 => [
             ['goods_id' => 6951, 'price' => 28.65, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6951, 'price' => 28.65, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6951, 'price' => 28.5, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
+            ['goods_id' => 6951, 'price' => 28.5, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 6951, 'price' => 28.56, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         ],
         50 => [
         50 => [
             ['goods_id' => 6952, 'price' => 47.75, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6952, 'price' => 47.75, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6952, 'price' => 47.5, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
+            ['goods_id' => 6952, 'price' => 47.5, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 6952, 'price' => 47.6, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         ],
         100 => [
         100 => [
             ['goods_id' => 6953, 'price' => 95.5, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6953, 'price' => 95.5, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6953, 'price' => 95, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
+            ['goods_id' => 6953, 'price' => 95, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 6953, 'price' => 95.2, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         ],
         200 => [
         200 => [
             ['goods_id' => 6954, 'price' => 191, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6954, 'price' => 191, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6954, 'price' => 190, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
+            ['goods_id' => 6954, 'price' => 190, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 6954, 'price' => 190.4, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         ],
         300 => [
         300 => [
             ['goods_id' => 6955, 'price' => 286.5, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6955, 'price' => 286.5, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6955, 'price' => 285, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
+            ['goods_id' => 6955, 'price' => 285, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 6955, 'price' => 285.6, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         ],
         500 => [
         500 => [
             ['goods_id' => 6956, 'price' => 477.5, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6956, 'price' => 477.5, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6956, 'price' => 475, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
+            ['goods_id' => 6956, 'price' => 475, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 6956, 'price' => 476, 'quality' => 1, 'card_type' => 'chinatelecom']
         ]
         ]
     ],
     ],
     'official_sn' => true, 'refill_type' => 'api'];
     'official_sn' => true, 'refill_type' => 'api'];
@@ -2245,23 +2253,28 @@ $yikatong_phone = ['name' => 'yikatong', 'store_id' => 118, 'qualitys' => '1',
         ],
         ],
         30 => [
         30 => [
             ['goods_id' => 7029, 'price' => 28.5, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 7029, 'price' => 28.5, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 7029, 'price' => 28.35, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
+            ['goods_id' => 7029, 'price' => 28.35, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7029, 'price' => 28.35, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         ],
         50 => [
         50 => [
             ['goods_id' => 7030, 'price' => 47.5, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 7030, 'price' => 47.5, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 7030, 'price' => 47.25, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
+            ['goods_id' => 7030, 'price' => 47.25, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7030, 'price' => 47.25, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         ],
         100 => [
         100 => [
             ['goods_id' => 7031, 'price' => 95, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 7031, 'price' => 95, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 7031, 'price' => 94.5, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
+            ['goods_id' => 7031, 'price' => 94.5, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7031, 'price' => 94.5, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         ],
         200 => [
         200 => [
             ['goods_id' => 7032, 'price' => 190, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 7032, 'price' => 190, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 7032, 'price' => 189, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
+            ['goods_id' => 7032, 'price' => 189, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7032, 'price' => 189, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         ],
         300 => [
         300 => [
             ['goods_id' => 7033, 'price' => 285, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 7033, 'price' => 285, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 7033, 'price' => 283.5, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
+            ['goods_id' => 7033, 'price' => 283.5, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7033, 'price' => 283.5, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         ],
         500 => [
         500 => [
             ['goods_id' => 7034, 'price' => 475, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 7034, 'price' => 475, 'quality' => 1, 'card_type' => 'chinamobile'],
@@ -2896,8 +2909,8 @@ $config['auto_find_channels'] = true;
 $config['cancel_retry_time'] = [10120 => ["9:00",'10:00','11:00']];
 $config['cancel_retry_time'] = [10120 => ["9:00",'10:00','11:00']];
 $config['merchant_retry_times'] = [
 $config['merchant_retry_times'] = [
     1092 => [
     1092 => [
-        'qualities' => [1 => ['secs' => 420, 'times' => 100], 2 => ['secs' => 180, 'times' => 100]],
-        'lower_ratio' => ['ratio' => 0.9,'period' => 3600]
+        'qualities' => [1 => ['secs' => 200, 'times' => 100], 2 => ['secs' => 180, 'times' => 100]],
+        'lower_ratio' => ['ratio' => 0.9, 'period' => 3600], 'profit_ratio' => 0.005
     ],
     ],
 //    10213 => [ //邀友-普充10分 ,昵称 二号
 //    10213 => [ //邀友-普充10分 ,昵称 二号
 //        'qualities' => [1 => ['secs' => 1100, 'times' => 100], 2 => ['secs' => 100, 'times' => 5]],
 //        'qualities' => [1 => ['secs' => 1100, 'times' => 100], 2 => ['secs' => 100, 'times' => 5]],
@@ -2905,15 +2918,15 @@ $config['merchant_retry_times'] = [
 //    ],
 //    ],
     10211 => [ //飘逸-混充20分
     10211 => [ //飘逸-混充20分
         'qualities' => [1 => ['secs' => 1100, 'times' => 100], 2 => ['secs' => 100, 'times' => 5]],
         'qualities' => [1 => ['secs' => 1100, 'times' => 100], 2 => ['secs' => 100, 'times' => 5]],
-        'lower_ratio' => ['ratio' => 0.9,'period' => 3600]
+        'lower_ratio' => ['ratio' => 0.9, 'period' => 3600], 'profit_ratio' => 0.003
     ],
     ],
     10216 => [ //飘逸-10分
     10216 => [ //飘逸-10分
         'qualities' => [1 => ['secs' => 530, 'times' => 100], 2 => ['secs' => 70, 'times' => 5]],
         'qualities' => [1 => ['secs' => 530, 'times' => 100], 2 => ['secs' => 70, 'times' => 5]],
-        'lower_ratio' => ['ratio' => 0.4,'period' => 3600]
+        'lower_ratio' => ['ratio' => 0.4, 'period' => 3600],'profit_ratio' => 0.015
     ],
     ],
     10217 => [ //天采-混充10m
     10217 => [ //天采-混充10m
         'qualities' => [1 => ['secs' => 1100, 'times' => 100], 2 => ['secs' => 100, 'times' => 5]],
         'qualities' => [1 => ['secs' => 1100, 'times' => 100], 2 => ['secs' => 100, 'times' => 5]],
-        'lower_ratio' => ['ratio' => 0.9,'period' => 3600]
+        'lower_ratio' => ['ratio' => 0.9, 'period' => 3600], 'profit_ratio' => 0.003
     ]
     ]
 ];
 ];
 
 

+ 39 - 26
data/config/xyzadm/refill.ini.php

@@ -559,38 +559,38 @@ $xc_phone = ['name' => 'xc', 'store_id' => 34, 'qualitys' => '4',
 $xunyin_phone = ['name' => 'xunyin', 'store_id' => 35,'qualitys' => '2',
 $xunyin_phone = ['name' => 'xunyin', 'store_id' => 35,'qualitys' => '2',
     'amount' => [
     'amount' => [
         10 => [
         10 => [
-            ['goods_id' => 6438, 'price' => 10, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6438, 'price' => 10.05, 'quality' => 2, 'card_type' => 'chinamobile'],
             ['goods_id' => 6438, 'price' => 10.08, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6438, 'price' => 10.08, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6438, 'price' => 10, 'quality' => 2, 'card_type' => 'chinatelecom']
             ['goods_id' => 6438, 'price' => 10, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         ],
         20 => [
         20 => [
-            ['goods_id' => 6439, 'price' => 20, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6439, 'price' => 20.1, 'quality' => 2, 'card_type' => 'chinamobile'],
             ['goods_id' => 6439, 'price' => 20.16, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6439, 'price' => 20.16, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6439, 'price' => 20, 'quality' => 2, 'card_type' => 'chinatelecom']
             ['goods_id' => 6439, 'price' => 20, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         ],
         30 => [
         30 => [
-            ['goods_id' => 6440, 'price' => 30, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6440, 'price' => 30.15, 'quality' => 2, 'card_type' => 'chinamobile'],
             ['goods_id' => 6440, 'price' => 30.24, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6440, 'price' => 30.24, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6440, 'price' => 30, 'quality' => 2, 'card_type' => 'chinatelecom']
             ['goods_id' => 6440, 'price' => 30, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         ],
         50 => [
         50 => [
-            ['goods_id' => 6441, 'price' => 49.75, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6441, 'price' => 50.1, 'quality' => 2, 'card_type' => 'chinamobile'],
             ['goods_id' => 6441, 'price' => 50, 'quality' => 2, 'card_type' => 'chinaunicom,chinatelecom']
             ['goods_id' => 6441, 'price' => 50, 'quality' => 2, 'card_type' => 'chinaunicom,chinatelecom']
         ],
         ],
         100 => [
         100 => [
-            ['goods_id' => 6442, 'price' => 99.5, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6442, 'price' => 100.2, 'quality' => 2, 'card_type' => 'chinamobile'],
             ['goods_id' => 6442, 'price' => 100, 'quality' => 2, 'card_type' => 'chinaunicom,chinatelecom']
             ['goods_id' => 6442, 'price' => 100, 'quality' => 2, 'card_type' => 'chinaunicom,chinatelecom']
         ],
         ],
         200 => [
         200 => [
-            ['goods_id' => 6443, 'price' => 200, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6443, 'price' => 200.4, 'quality' => 2, 'card_type' => 'chinamobile'],
             ['goods_id' => 6443, 'price' => 200, 'quality' => 2, 'card_type' => 'chinaunicom,chinatelecom']
             ['goods_id' => 6443, 'price' => 200, 'quality' => 2, 'card_type' => 'chinaunicom,chinatelecom']
         ],
         ],
         300 => [
         300 => [
-            ['goods_id' => 6444, 'price' => 300, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6444, 'price' => 300.6, 'quality' => 2, 'card_type' => 'chinamobile'],
             ['goods_id' => 6444, 'price' => 300, 'quality' => 2, 'card_type' => 'chinaunicom,chinatelecom']
             ['goods_id' => 6444, 'price' => 300, 'quality' => 2, 'card_type' => 'chinaunicom,chinatelecom']
         ],
         ],
         500 => [
         500 => [
-            ['goods_id' => 6445, 'price' => 500, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6445, 'price' => 501, 'quality' => 2, 'card_type' => 'chinamobile'],
             ['goods_id' => 6445, 'price' => 500, 'quality' => 2, 'card_type' => 'chinaunicom,chinatelecom']
             ['goods_id' => 6445, 'price' => 500, 'quality' => 2, 'card_type' => 'chinaunicom,chinatelecom']
         ]
         ]
     ],
     ],
@@ -2025,35 +2025,43 @@ $xianghongrui_phone = ['name' => 'xianghongrui', 'store_id' => 107,'qualitys' =>
     'amount' => [
     'amount' => [
         10 => [
         10 => [
             ['goods_id' => 6949, 'price' => 9.55, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6949, 'price' => 9.55, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6949, 'price' => 9.5, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
+            ['goods_id' => 6949, 'price' => 9.5, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 6949, 'price' => 9.52, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         ],
         20 => [
         20 => [
             ['goods_id' => 6950, 'price' => 19.1, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6950, 'price' => 19.1, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6950, 'price' => 19, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
+            ['goods_id' => 6950, 'price' => 19, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 6950, 'price' => 19.04, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         ],
         30 => [
         30 => [
             ['goods_id' => 6951, 'price' => 28.65, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6951, 'price' => 28.65, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6951, 'price' => 28.5, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
+            ['goods_id' => 6951, 'price' => 28.5, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 6951, 'price' => 28.56, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         ],
         50 => [
         50 => [
             ['goods_id' => 6952, 'price' => 47.75, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6952, 'price' => 47.75, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6952, 'price' => 47.5, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
+            ['goods_id' => 6952, 'price' => 47.5, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 6952, 'price' => 47.6, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         ],
         100 => [
         100 => [
             ['goods_id' => 6953, 'price' => 95.5, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6953, 'price' => 95.5, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6953, 'price' => 95, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
+            ['goods_id' => 6953, 'price' => 95, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 6953, 'price' => 95.2, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         ],
         200 => [
         200 => [
             ['goods_id' => 6954, 'price' => 191, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6954, 'price' => 191, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6954, 'price' => 190, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
+            ['goods_id' => 6954, 'price' => 190, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 6954, 'price' => 190.4, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         ],
         300 => [
         300 => [
             ['goods_id' => 6955, 'price' => 286.5, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6955, 'price' => 286.5, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6955, 'price' => 285, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
+            ['goods_id' => 6955, 'price' => 285, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 6955, 'price' => 285.6, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         ],
         500 => [
         500 => [
             ['goods_id' => 6956, 'price' => 477.5, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6956, 'price' => 477.5, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6956, 'price' => 475, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
+            ['goods_id' => 6956, 'price' => 475, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 6956, 'price' => 476, 'quality' => 1, 'card_type' => 'chinatelecom']
         ]
         ]
     ],
     ],
     'official_sn' => true, 'refill_type' => 'api'];
     'official_sn' => true, 'refill_type' => 'api'];
@@ -2245,23 +2253,28 @@ $yikatong_phone = ['name' => 'yikatong', 'store_id' => 118, 'qualitys' => '1',
         ],
         ],
         30 => [
         30 => [
             ['goods_id' => 7029, 'price' => 28.5, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 7029, 'price' => 28.5, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 7029, 'price' => 28.35, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
+            ['goods_id' => 7029, 'price' => 28.35, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7029, 'price' => 28.35, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         ],
         50 => [
         50 => [
             ['goods_id' => 7030, 'price' => 47.5, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 7030, 'price' => 47.5, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 7030, 'price' => 47.25, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
+            ['goods_id' => 7030, 'price' => 47.25, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7030, 'price' => 47.25, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         ],
         100 => [
         100 => [
             ['goods_id' => 7031, 'price' => 95, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 7031, 'price' => 95, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 7031, 'price' => 94.5, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
+            ['goods_id' => 7031, 'price' => 94.5, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7031, 'price' => 94.5, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         ],
         200 => [
         200 => [
             ['goods_id' => 7032, 'price' => 190, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 7032, 'price' => 190, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 7032, 'price' => 189, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
+            ['goods_id' => 7032, 'price' => 189, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7032, 'price' => 189, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         ],
         300 => [
         300 => [
             ['goods_id' => 7033, 'price' => 285, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 7033, 'price' => 285, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 7033, 'price' => 283.5, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
+            ['goods_id' => 7033, 'price' => 283.5, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7033, 'price' => 283.5, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         ],
         500 => [
         500 => [
             ['goods_id' => 7034, 'price' => 475, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 7034, 'price' => 475, 'quality' => 1, 'card_type' => 'chinamobile'],
@@ -2896,8 +2909,8 @@ $config['auto_find_channels'] = true;
 $config['cancel_retry_time'] = [10120 => ["9:00",'10:00','11:00']];
 $config['cancel_retry_time'] = [10120 => ["9:00",'10:00','11:00']];
 $config['merchant_retry_times'] = [
 $config['merchant_retry_times'] = [
     1092 => [
     1092 => [
-        'qualities' => [1 => ['secs' => 420, 'times' => 100], 2 => ['secs' => 180, 'times' => 100]],
-        'lower_ratio' => ['ratio' => 0.9,'period' => 3600]
+        'qualities' => [1 => ['secs' => 200, 'times' => 100], 2 => ['secs' => 180, 'times' => 100]],
+        'lower_ratio' => ['ratio' => 0.9, 'period' => 3600], 'profit_ratio' => 0.005
     ],
     ],
 //    10213 => [ //邀友-普充10分 ,昵称 二号
 //    10213 => [ //邀友-普充10分 ,昵称 二号
 //        'qualities' => [1 => ['secs' => 1100, 'times' => 100], 2 => ['secs' => 100, 'times' => 5]],
 //        'qualities' => [1 => ['secs' => 1100, 'times' => 100], 2 => ['secs' => 100, 'times' => 5]],
@@ -2905,15 +2918,15 @@ $config['merchant_retry_times'] = [
 //    ],
 //    ],
     10211 => [ //飘逸-混充20分
     10211 => [ //飘逸-混充20分
         'qualities' => [1 => ['secs' => 1100, 'times' => 100], 2 => ['secs' => 100, 'times' => 5]],
         'qualities' => [1 => ['secs' => 1100, 'times' => 100], 2 => ['secs' => 100, 'times' => 5]],
-        'lower_ratio' => ['ratio' => 0.9,'period' => 3600]
+        'lower_ratio' => ['ratio' => 0.9, 'period' => 3600], 'profit_ratio' => 0.003
     ],
     ],
     10216 => [ //飘逸-10分
     10216 => [ //飘逸-10分
         'qualities' => [1 => ['secs' => 530, 'times' => 100], 2 => ['secs' => 70, 'times' => 5]],
         'qualities' => [1 => ['secs' => 530, 'times' => 100], 2 => ['secs' => 70, 'times' => 5]],
-        'lower_ratio' => ['ratio' => 0.4,'period' => 3600]
+        'lower_ratio' => ['ratio' => 0.4, 'period' => 3600],'profit_ratio' => 0.015
     ],
     ],
     10217 => [ //天采-混充10m
     10217 => [ //天采-混充10m
         'qualities' => [1 => ['secs' => 1100, 'times' => 100], 2 => ['secs' => 100, 'times' => 5]],
         'qualities' => [1 => ['secs' => 1100, 'times' => 100], 2 => ['secs' => 100, 'times' => 5]],
-        'lower_ratio' => ['ratio' => 0.9,'period' => 3600]
+        'lower_ratio' => ['ratio' => 0.9, 'period' => 3600], 'profit_ratio' => 0.003
     ]
     ]
 ];
 ];
 
 

+ 8 - 1
data/config/xyztest/refill.ini.php

@@ -2013,4 +2013,11 @@ $config['third_providers'] = $third_providers;
 
 
 $config['auto_find_channels'] = true;
 $config['auto_find_channels'] = true;
 
 
-$config['cancel_retry_time'] = [10120 => ["9:00",'10:00','11:00']];
+$config['cancel_retry_time'] = [10120 => ["9:00",'10:00','11:00']];
+
+$config['merchant_retry_times'] = [
+    1092 => [
+        'qualities' => [1 => ['secs' => 420, 'times' => 100], 2 => ['secs' => 180, 'times' => 100]],
+        'lower_ratio' => ['ratio' => 0.9, 'period' => 3600], 'profit_ratio' => 0.005
+    ]
+];

+ 12 - 1
docker/compose/xyz/stat/docker-compose.yml

@@ -66,4 +66,15 @@ services:
       - /mnt/shoplog:/var/www/html/data/log
       - /mnt/shoplog:/var/www/html/data/log
       - /mnt/stdata:/var/www/html/data/stdata
       - /mnt/stdata:/var/www/html/data/stdata
     container_name: "panda-mratios"
     container_name: "panda-mratios"
-    command: ['python','mratios.py','-h', '172.26.105.125', '-p', '6379']
+    command: ['python','mratios.py','-h', '172.26.105.125', '-p', '6379']
+
+  mcounts:
+    image: pycpu:3.7.10
+    volumes:
+      - ../../../../:/var/www/html
+      - ../conf/etc/localtime:/etc/localtime:ro
+      - /nfs/upload:/var/www/html/data/upload
+      - /mnt/shoplog:/var/www/html/data/log
+      - /mnt/stdata:/var/www/html/data/stdata
+    container_name: "panda-mcounts"
+    command: ['python','mcounts.py','-h', '172.26.105.125', '-p', '6379']

+ 12 - 1
docker/compose/xyzt/stat/docker-compose.yml

@@ -55,4 +55,15 @@ services:
       - /mnt/testlog:/var/www/html/data/log
       - /mnt/testlog:/var/www/html/data/log
       - /mnt/stdata:/var/www/html/data/stdata
       - /mnt/stdata:/var/www/html/data/stdata
     container_name: "panda-mratio"
     container_name: "panda-mratio"
-    command: ['python','mratio.py','-h', '172.26.105.127', '-p', '6379']
+    command: ['python','mratio.py','-h', '172.26.105.127', '-p', '6379']
+
+  mcounts:
+    image: pycpu:3.7.10
+    volumes:
+      - ../../../../:/var/www/html
+      - ../conf/etc/localtime:/etc/localtime:ro
+      - /nfs/upload:/var/www/html/data/upload
+      - /mnt/shoplog:/var/www/html/data/log
+      - /mnt/stdata:/var/www/html/data/stdata
+    container_name: "panda-mcounts"
+    command: ['python','mcounts.py','-h', '172.26.105.127', '-p', '6379']

+ 1 - 1
helper/refill/LZRefillFactory.php

@@ -19,7 +19,7 @@ require_once(BASE_HELPER_PATH . '/refill/policy/times_caller.php');
 require_once(BASE_HELPER_PATH . '/refill/policy/quaility.php');
 require_once(BASE_HELPER_PATH . '/refill/policy/quaility.php');
 require_once(BASE_HELPER_PATH . '/refill/policy/merchant_price.php');
 require_once(BASE_HELPER_PATH . '/refill/policy/merchant_price.php');
 require_once(BASE_HELPER_PATH . '/refill/policy/mgroup.php');
 require_once(BASE_HELPER_PATH . '/refill/policy/mgroup.php');
-require_once(BASE_HELPER_PATH . '/refill/policy/lingzh/PolicyUtil.php');
+require_once(BASE_HELPER_PATH . '/refill/policy/PolicyUtil.php');
 require_once(BASE_HELPER_PATH . '/refill/policy/lingzh/quality_ploy.php');
 require_once(BASE_HELPER_PATH . '/refill/policy/lingzh/quality_ploy.php');
 require_once(BASE_HELPER_PATH . '/refill/policy/channel_filter.php');
 require_once(BASE_HELPER_PATH . '/refill/policy/channel_filter.php');
 require_once(BASE_HELPER_PATH . '/refill/policy/mratio_control.php');
 require_once(BASE_HELPER_PATH . '/refill/policy/mratio_control.php');

+ 2 - 2
helper/refill/RefillBase.php

@@ -738,8 +738,8 @@ class RefillBase
     {
     {
         $this->mPolicy->update_ratios($ratios);
         $this->mPolicy->update_ratios($ratios);
     }
     }
-    public function UpdatMchRatios($ratios)
+    public function UpdatMchRatios($gross,$detail)
     {
     {
-        $this->mPolicy->update_mchratios($ratios);
+        $this->mPolicy->update_mchratios($gross,$detail);
     }
     }
 }
 }

+ 2 - 1
helper/refill/XYZRefillFactory.php

@@ -22,11 +22,12 @@ require_once(BASE_HELPER_PATH . '/refill/policy/quaility.php');
 require_once(BASE_HELPER_PATH . '/refill/policy/merchant_price.php');
 require_once(BASE_HELPER_PATH . '/refill/policy/merchant_price.php');
 require_once(BASE_HELPER_PATH . '/refill/policy/rlock.php');
 require_once(BASE_HELPER_PATH . '/refill/policy/rlock.php');
 require_once(BASE_HELPER_PATH . '/refill/policy/rstorage.php');
 require_once(BASE_HELPER_PATH . '/refill/policy/rstorage.php');
-require_once(BASE_HELPER_PATH . '/refill/policy/lingzh/PolicyUtil.php');
+require_once(BASE_HELPER_PATH . '/refill/policy/PolicyUtil.php');
 require_once(BASE_HELPER_PATH . '/refill/policy/xyz/quality_ploy.php');
 require_once(BASE_HELPER_PATH . '/refill/policy/xyz/quality_ploy.php');
 require_once(BASE_HELPER_PATH . '/refill/policy/mgroup.php');
 require_once(BASE_HELPER_PATH . '/refill/policy/mgroup.php');
 require_once(BASE_HELPER_PATH . '/refill/policy/channel_filter.php');
 require_once(BASE_HELPER_PATH . '/refill/policy/channel_filter.php');
 require_once(BASE_HELPER_PATH . '/refill/policy/mratio_control.php');
 require_once(BASE_HELPER_PATH . '/refill/policy/mratio_control.php');
+require_once(BASE_HELPER_PATH . '/refill/policy/mavg_price.php');
 
 
 
 
 
 

二进制
helper/refill/api/xyz/guochuang/20210929移动调价.png


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

@@ -65,8 +65,8 @@ class config
         //移动
         //移动
         "4-10-2" => 9.94, "4-20-2" => 19.88, "4-30-2" => 29.82, "4-50-2" => 49.7, "4-100-2" => 99.4, "4-200-2" => 198.8, "4-300-2" => 298.2, "4-500-2" => 497,//天津 2
         "4-10-2" => 9.94, "4-20-2" => 19.88, "4-30-2" => 29.82, "4-50-2" => 49.7, "4-100-2" => 99.4, "4-200-2" => 198.8, "4-300-2" => 298.2, "4-500-2" => 497,//天津 2
         "4-10-6" => 9.718, "4-20-6" => 19.436, "4-30-6" => 29.154, "4-50-6" => 48.59, "4-100-6" => 97.18, "4-200-6" => 194.36, "4-300-6" => 291.54, "4-500-6" => 485.9,//辽宁 6
         "4-10-6" => 9.718, "4-20-6" => 19.436, "4-30-6" => 29.154, "4-50-6" => 48.59, "4-100-6" => 97.18, "4-200-6" => 194.36, "4-300-6" => 291.54, "4-500-6" => 485.9,//辽宁 6
-        "4-10-9" => 9.9, "4-20-9" => 19.8, "4-30-9" => 29.7, "4-50-9" => 49.5, "4-100-9" => 99,//上海 9
-        "4-10-8" => 9.95, "4-20-8" => 19.9, "4-30-8" => 29.85, "4-50-8" => 49.75, "4-100-8" => 99.5, "4-200-8" => 199, "4-300-8" => 298.5, "4-500-8" => 497.5,//黑龙江 8
+        "4-10-9" => 9.93, "4-20-9" => 19.86, "4-30-9" => 29.79, "4-50-9" => 49.65, "4-100-9" => 99.3,//上海 9
+        "4-10-8" => 9.995, "4-20-8" => 19.99, "4-30-8" => 29.985, "4-50-8" => 49.975, "4-100-8" => 99.95, "4-200-8" => 199.9, "4-300-8" => 299.85, "4-500-8" => 499.75,//黑龙江 8
         "4-10-29" => 9.82, "4-20-29" => 19.64, "4-30-29" => 29.46, "4-50-29" => 49.1, "4-100-29" => 98.2, "4-200-29" => 196.4, "4-300-29" => 294.6, "4-500-29" => 491,//青海 29
         "4-10-29" => 9.82, "4-20-29" => 19.64, "4-30-29" => 29.46, "4-50-29" => 49.1, "4-100-29" => 98.2, "4-200-29" => 196.4, "4-300-29" => 294.6, "4-500-29" => 491,//青海 29
         "4-10-28" => 9.925, "4-20-28" => 19.85, "4-30-28" => 29.775, "4-50-28" => 49.625, "4-100-28" => 99.25, "4-200-28" => 198.5, "4-300-28" => 297.75, "4-500-28" => 496.25,//甘肃 28
         "4-10-28" => 9.925, "4-20-28" => 19.85, "4-30-28" => 29.775, "4-50-28" => 49.625, "4-100-28" => 99.25, "4-200-28" => 198.5, "4-300-28" => 297.75, "4-500-28" => 496.25,//甘肃 28
         "4-10-13" => 10.02, "4-20-13" => 20.04, "4-30-13" => 30.06, "4-50-13" => 51, "4-100-13" => 100.2, "4-200-13" => 200.4, "4-300-13" => 300.6, "4-500-13" => 501,//福建 13
         "4-10-13" => 10.02, "4-20-13" => 20.04, "4-30-13" => 30.06, "4-50-13" => 51, "4-100-13" => 100.2, "4-200-13" => 200.4, "4-300-13" => 300.6, "4-500-13" => 501,//福建 13

+ 1 - 1
helper/refill/policy/IPolicy.php

@@ -13,5 +13,5 @@ interface IPolicy
     public function notify($order_info, $refill_info): bool;
     public function notify($order_info, $refill_info): bool;
     public function price($mchid, $spec, $card_type, $quality, $pcode);
     public function price($mchid, $spec, $card_type, $quality, $pcode);
     public function update_ratios($ratios);
     public function update_ratios($ratios);
-    public function update_mchratios($ratios);
+    public function update_mchratios($all,$detail);
 }
 }

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

@@ -0,0 +1,32 @@
+<?php
+
+namespace refill;
+
+class PolicyUtil
+{
+    private const MixedQuality = [Quality::DefSuccess, Quality::NormalQuick];
+    public static function mixed_quality($quality) : bool
+    {
+        if(in_array($quality,PolicyUtil::MixedQuality)) {
+            return true;
+        } else {
+            return false;
+        }
+    }
+
+    public static function mixed_qualities()
+    {
+        return PolicyUtil::MixedQuality;
+    }
+
+    public static function mixed_ratio()
+    {
+        $mixed = [Quality::DefSuccess];
+        return $mixed;
+    }
+
+    public static function isMixedQuality($org_quality)
+    {
+        return in_array($org_quality,[Quality::NormalQuick]);
+    }
+}

+ 0 - 15
helper/refill/policy/lingzh/PolicyUtil.php

@@ -1,15 +0,0 @@
-<?php
-
-namespace refill;
-
-class PolicyUtil
-{
-    public static function mixed_quality($quality) : bool
-    {
-        if($quality == Quality::DefSuccess || $quality == Quality::NormalQuick) {
-            return true;
-        } else {
-            return false;
-        }
-    }
-}

+ 128 - 5
helper/refill/policy/lingzh/policy.php

@@ -12,6 +12,8 @@ class policy extends ProviderManager implements IPolicy
     protected $mQuality;
     protected $mQuality;
     protected $mPrices;
     protected $mPrices;
     protected $mGroupCtl;
     protected $mGroupCtl;
+    protected $mAvgPrice;
+    protected $mRatioCtl;
 
 
     public function __construct()
     public function __construct()
     {
     {
@@ -20,6 +22,10 @@ class policy extends ProviderManager implements IPolicy
         $this->mQuality = new quality_ploy();
         $this->mQuality = new quality_ploy();
         $this->mPrices = new merchant_price();
         $this->mPrices = new merchant_price();
         $this->mGroupCtl = new rgroup_ctl();
         $this->mGroupCtl = new rgroup_ctl();
+        $this->mAvgPrice = new mavg_price();
+        $this->mRatioCtl = new mratio_control();
+
+        $this->mQuality->setRatioCtl($this->mRatioCtl);
     }
     }
 
 
     public function load()
     public function load()
@@ -38,7 +44,123 @@ class policy extends ProviderManager implements IPolicy
 
 
         $turn_name = 'oil_amount_lock_turn';
         $turn_name = 'oil_amount_lock_turn';
         $this->mAmountLockTurn = rkcache($turn_name);
         $this->mAmountLockTurn = rkcache($turn_name);
+        Log::record("AmountLockTurn = {$this->mAmountLockTurn}",Log::DEBUG);
+
+        $this->mStorageLocker->load();
         $this->mGroupCtl->load($opened_names,$opened_merchants);
         $this->mGroupCtl->load($opened_names,$opened_merchants);
+        $this->mRatioCtl->load();
+
+        $this->init_mavg_price();
+    }
+
+    private function init_mavg_price()
+    {
+        $specs_merger = function ($qspecs)
+        {
+            $q_keys = [];
+            foreach ($qspecs as $quality => $specs)
+            {
+                foreach ($specs as $item)
+                {
+                    [$card_type, $spec] = $item;
+                    $q_keys[$quality][] = "{$card_type}-{$spec}";
+                }
+            }
+
+            $sspecs = [];
+            $first = true;
+            foreach ($q_keys as $quality => $specs)
+            {
+                if($first) {
+                    $sspecs = $specs;
+                    $first = false;
+                }
+                else {
+                    $sspecs = array_intersect($sspecs,$specs);
+                }
+            }
+
+            $result = [];
+            foreach ($sspecs as $item) {
+                [$card_type, $spec] = explode('-',$item);
+                $result[] = [intval($card_type), intval($spec)];
+            }
+
+            return $result;
+        };
+
+        $pQuality = $this->mQuality;
+        $mixed_quality = Quality::NormalQuick;
+        $mchids = $pQuality->mechants_quality($mixed_quality);
+        foreach ($mchids as $mchid)
+        {
+            $qualities = $pQuality->qualities($mixed_quality);
+            $specs = [];
+            foreach ($qualities as $quality)
+            {
+                $item = $this->mPrices->merchant_specs($mchid, $quality);
+                if(empty($item)) continue;
+                $specs[$quality] = $item;
+            }
+
+            $specs = $specs_merger($specs);
+            foreach ($specs as $item)
+            {
+                [$card_type, $spec] = $item;
+                if (!in_array($card_type, [4, 5, 6])) continue;
+
+                $sale_price = $this->mPrices->price($mchid,$card_type,$spec,$mixed_quality,'');
+                $low_price  = $this->calc_avgprice($mchid, $qualities[0], $card_type, $spec);
+                $high_price = $this->calc_avgprice($mchid, $qualities[1], $card_type, $spec);
+
+                $this->mRatioCtl->setMixedPrice($mchid, $mixed_quality, $card_type, $spec, $sale_price, [$qualities[0] => $low_price, $qualities[1] => $high_price]);
+            }
+        }
+    }
+
+    protected function calc_avgprice($mchid,$quality,$card_type,$spec)
+    {
+        $providers = parent::get_providers($mchid,$spec,$card_type,$quality,-1);
+        $names = [];
+        foreach ($providers as $provider) {
+            $names[] = $provider->name();
+        }
+
+        [$hasGroup,$can_others,$channels] = $this->mGroupCtl->find_providers($mchid, $spec, $card_type, $quality);
+        if($hasGroup)
+        {
+            if(empty($channels))
+            {
+                if(!$can_others) {
+                    return false;
+                }
+            }
+            else
+            {
+                $ret = array_intersect($names, $channels);
+                if (empty($ret)) {
+                    return false;
+                }
+                else {
+                    $names = $ret;
+                }
+            }
+        }
+
+        $name_provider = [];
+        foreach ($providers as $provider) {
+            $name = $provider->name();
+            $name_provider[$name] = $provider;
+        }
+
+        $total = 0.0;
+        foreach ($names as $name) {
+            $provider = $name_provider[$name];
+            [$goods_id, $price] = $provider->goods($quality, $spec, $card_type, -1, []);
+            $total += $price;
+        }
+
+        return $total / count($names);
     }
     }
 
 
     private function opened_merchants()
     private function opened_merchants()
@@ -89,6 +211,7 @@ class policy extends ProviderManager implements IPolicy
 
 
         Log::record("ProviderManager::get_providers result=" . implode(',',$names),Log::DEBUG);
         Log::record("ProviderManager::get_providers result=" . implode(',',$names),Log::DEBUG);
         [$hasGroup,$can_others,$channels] = $this->mGroupCtl->find_providers($mchid, $spec, $card_type, $cur_quality);
         [$hasGroup,$can_others,$channels] = $this->mGroupCtl->find_providers($mchid, $spec, $card_type, $cur_quality);
+        Log::record("GroupControl mchid={$mchid} spec={$spec} quality={$cur_quality} card_type={$card_type} first result=" . implode(',',$channels),Log::DEBUG);
         if($hasGroup)
         if($hasGroup)
         {
         {
             if(empty($channels))
             if(empty($channels))
@@ -108,7 +231,7 @@ class policy extends ProviderManager implements IPolicy
                 }
                 }
             }
             }
         }
         }
-        Log::record("GroupControl result=" . implode(',',$names),Log::DEBUG);
+        Log::record("GroupControl second result=" . implode(',',$names),Log::DEBUG);
 
 
         if(PolicyUtil::mixed_quality($org_quality)) {
         if(PolicyUtil::mixed_quality($org_quality)) {
             $fQuality = $org_quality;
             $fQuality = $org_quality;
@@ -127,7 +250,7 @@ class policy extends ProviderManager implements IPolicy
         global $config;
         global $config;
         $auto_find = $config['auto_find_channels'];
         $auto_find = $config['auto_find_channels'];
 
 
-        $mobile_types = [mtopcard\ChinaMobileCard,mtopcard\ChinaUnicomCard,mtopcard\ChinaTelecomCard];
+        $mobile_types = [mtopcard\ChinaMobileCard, mtopcard\ChinaUnicomCard, mtopcard\ChinaTelecomCard];
         $qualities = [Quality::Normal];
         $qualities = [Quality::Normal];
         if($auto_find && in_array($card_type,$mobile_types) && in_array($cur_quality,$qualities))
         if($auto_find && in_array($card_type,$mobile_types) && in_array($cur_quality,$qualities))
         {
         {
@@ -199,7 +322,7 @@ class policy extends ProviderManager implements IPolicy
             $caller = null;
             $caller = null;
         }
         }
 
 
-        [$org_quality,$qualities] = $this->mQuality->find_quality($mchid,$card_type,$org_quality,$cur_quality,$commit_times,$elapse_secs,$caller);
+        [$org_quality, $qualities] = $this->mQuality->find_quality($mchid, $card_type, $spec, $org_quality, $cur_quality, $commit_times, $elapse_secs, $caller);
         if(empty($qualities)) {
         if(empty($qualities)) {
             return [$org_quality,0];
             return [$org_quality,0];
         }
         }
@@ -314,8 +437,8 @@ class policy extends ProviderManager implements IPolicy
         $this->mChannelControl->update_ratios($ratios);
         $this->mChannelControl->update_ratios($ratios);
     }
     }
 
 
-    public function update_mchratios($ratios)
+    public function update_mchratios($all,$detail)
     {
     {
-        $this->mQuality->update_mchratios($ratios);
+        $this->mQuality->update_mchratios($all,$detail);
     }
     }
 }
 }

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

@@ -0,0 +1,32 @@
+<?php
+
+namespace refill;
+
+class mavg_price
+{
+    private $mMchidPrices;
+    public function __construct()
+    {
+        $this->mMchidPrices = [];
+    }
+
+    public function setPrice($mchid,$quality,$card_type,$spec,$avg_price)
+    {
+        $key = "{$mchid}-{$quality}-{$card_type}-{$spec}";
+        if(array_key_exists($key,$this->mMchidPrices)) {
+            return $this->mMchidPrices[$key];
+        } else {
+            $this->mMchidPrices[$key] = $avg_price;
+        }
+    }
+
+    public function getPrice($mchid,$quality,$card_type,$spec)
+    {
+        $key = "{$mchid}-{$quality}-{$card_type}-{$spec}";
+        if(array_key_exists($key,$this->mMchidPrices)) {
+            return $this->mMchidPrices[$key];
+        } else {
+            return false;
+        }
+    }
+}

+ 22 - 6
helper/refill/policy/mchctl.php

@@ -27,18 +27,21 @@ class mchctl
         $mod_merchant = Model('merchant');
         $mod_merchant = Model('merchant');
         $merchants = $mod_merchant->getMerchantList(['merchant.mchid' => ['gt', 0]]);
         $merchants = $mod_merchant->getMerchantList(['merchant.mchid' => ['gt', 0]]);
 
 
-        foreach ($merchants as $item) {
+        foreach ($merchants as $item)
+        {
             $mchid = $item['mchid'];
             $mchid = $item['mchid'];
             $quality = intval($item['quality']);
             $quality = intval($item['quality']);
             $time_out = $item['time_out'];
             $time_out = $item['time_out'];
 
 
-            if($quality == Quality::SlowNormal || $quality == Quality::ThirdNormal || $quality == Quality::DefSuccess || $quality == Quality::NormalQuick || $quality == Quality::SlowSixNormal) {
+            if ($quality == Quality::SlowNormal ||
+                $quality == Quality::ThirdNormal ||
+                $quality == Quality::DefSuccess ||
+                $quality == Quality::NormalQuick ||
+                $quality == Quality::SlowSixNormal) {
 
 
-            }
-            elseif ($quality >= Quality::LowestQuality && $quality <= Quality::HighestQuality) {
+            } elseif ($quality >= Quality::LowestQuality && $quality <= Quality::HighestQuality) {
 
 
-            }
-            else {
+            } else {
                 $quality = Quality::ThirdNormal;
                 $quality = Quality::ThirdNormal;
             }
             }
 
 
@@ -58,4 +61,17 @@ class mchctl
             return [false,0,0];
             return [false,0,0];
         }
         }
     }
     }
+
+    public function mechants_quality()
+    {
+        $result = [];
+        foreach ($this->mMchidMapCtls as $mchid => $item)
+        {
+            $quality = intval($item['quality']);
+            if(PolicyUtil::mixed_quality($quality)) {
+                $result[$mchid] = $quality;
+            }
+        }
+        return $result;
+    }
 }
 }

+ 12 - 5
helper/refill/policy/mchoilctl.php

@@ -27,11 +27,19 @@ class mchoilctl
             $quality = intval($item['oil_quality']);
             $quality = intval($item['oil_quality']);
             $time_out = $item['time_out'];
             $time_out = $item['time_out'];
 
 
-            if ($quality == Quality::OilWithoutSN || $quality == Quality::OilQuick || $quality == Quality::OilCardKey || $quality == Quality::OilWithSN) {
+            if ($quality == Quality::OilWithoutSN ||
+                $quality == Quality::OilQuick ||
+                $quality == Quality::OilCardKey ||
+                $quality == Quality::OilWithSN) {
 
 
-            } elseif ($quality == Quality::OilSN_NONE_HAS || $quality == Quality::OilSN_HAS_NONE) {
+            } elseif ($quality == Quality::OilSN_NONE_HAS ||
+                $quality == Quality::OilSN_HAS_NONE) {
 
 
-            } elseif ($quality == Quality::OIL_SN_CARDKEY || $quality == Quality::OIL_SNNONE_CARDKEY || $quality == Quality::OIL_SN_SNNONE_CARDKEY || $quality == Quality::OIL_SNNONE_SN_CARDKEY || $quality == Quality::OIL_SNNONE_SN_CARDKEY_QUICK) {
+            } elseif ($quality == Quality::OIL_SN_CARDKEY ||
+                $quality == Quality::OIL_SNNONE_CARDKEY ||
+                $quality == Quality::OIL_SN_SNNONE_CARDKEY ||
+                $quality == Quality::OIL_SNNONE_SN_CARDKEY ||
+                $quality == Quality::OIL_SNNONE_SN_CARDKEY_QUICK) {
 
 
             } else {
             } else {
                 $quality = Quality::OilSN_NONE_HAS;
                 $quality = Quality::OilSN_NONE_HAS;
@@ -45,12 +53,11 @@ class mchoilctl
     {
     {
         if(array_key_exists($mchid,$this->mMchidMapCtls)) {
         if(array_key_exists($mchid,$this->mMchidMapCtls)) {
             $quality = $this->mMchidMapCtls[$mchid]['quality'];
             $quality = $this->mMchidMapCtls[$mchid]['quality'];
-//            $time_out = $this->mMchidMapCtls[$mchid]['time_out'];
-
             return [true,$quality];
             return [true,$quality];
         }
         }
         else {
         else {
             return [false,0,0];
             return [false,0,0];
         }
         }
     }
     }
+
 }
 }

+ 13 - 0
helper/refill/policy/merchant_price.php

@@ -76,6 +76,19 @@ class merchant_price
         }
         }
     }
     }
 
 
+    public function merchant_specs($mchid,$quality)
+    {
+        $result = [];
+        foreach ($this->mPrices as $key => $price) {
+            [$_mchid,$_quality,$card_type,$spec] = explode('-',$key);
+            if($_mchid == $mchid && $_quality == $quality) {
+                $result[] = [intval($card_type),intval($spec)];
+            }
+        }
+
+        return $result;
+    }
+
     public function extra_price($mchid,$card_type,$spec,$quality,$pcode)
     public function extra_price($mchid,$card_type,$spec,$quality,$pcode)
     {
     {
         $card_type = intval($card_type);
         $card_type = intval($card_type);

+ 133 - 33
helper/refill/policy/mratio_control.php

@@ -1,17 +1,22 @@
 <?php
 <?php
 
 
 namespace refill;
 namespace refill;
+
 use Log;
 use Log;
 
 
 class mratio_control
 class mratio_control
 {
 {
-    private $mTimesConfig;
-    private $mCurRatios;
+    private $mTimesConfig; //对应refill.ini 配置文件数据
+    private $mGrossRatios;
+    private $mDetailRatios;
+    private $mMixedPrices;
 
 
     public function __construct()
     public function __construct()
     {
     {
         $this->mTimesConfig = [];
         $this->mTimesConfig = [];
-        $this->mCurRatios = [];
+        $this->mGrossRatios = [];
+        $this->mDetailRatios = [];
+        $this->mMixedPrices = [];
     }
     }
 
 
     public function load()
     public function load()
@@ -20,10 +25,45 @@ class mratio_control
         $this->mTimesConfig = $config['merchant_retry_times'] ?? [];
         $this->mTimesConfig = $config['merchant_retry_times'] ?? [];
     }
     }
 
 
-    public function total($mchid)
+    public function update($gross_ratios, $detail_ratios)
+    {
+        if (!empty($gross_ratios)) {
+            $this->mGrossRatios = $gross_ratios;
+        }
+        if (!empty($detail_ratios)) {
+            $this->mDetailRatios = $detail_ratios;
+        }
+    }
+
+    public function setMixedPrice($mchid, $mixed_quality, $card_type, $spec, $prices)
     {
     {
-        if(array_key_exists($mchid,$this->mTimesConfig))
+        $key = "{$card_type}-{$spec}";
+        $this->mMixedPrices[$mchid][$mixed_quality][$key] = $prices;
+    }
+
+    //获取售价和进价
+    private function getPrice($mchid, $mixed_quality, $card_type, $spec)
+    {
+        $key = "{$card_type}-{$spec}";
+        if (array_key_exists($mchid, $this->mMixedPrices))
         {
         {
+            $prices = $this->mMixedPrices[$mchid];
+            if (array_key_exists($mixed_quality, $prices))
+            {
+                $qprices = $prices[$mixed_quality];
+                if (array_key_exists($key, $qprices)) {
+                    $price = $qprices[$key];
+                    return $price;
+                }
+            }
+        }
+
+        return false;
+    }
+
+    public function total($mchid)
+    {
+        if (array_key_exists($mchid, $this->mTimesConfig)) {
             $items = $this->mTimesConfig[$mchid]['qualities'];
             $items = $this->mTimesConfig[$mchid]['qualities'];
 
 
             $times = 0;
             $times = 0;
@@ -32,18 +72,17 @@ class mratio_control
                 $times += $val['times'] ?? 1;
                 $times += $val['times'] ?? 1;
                 $secs += $val['secs'] ?? 180;
                 $secs += $val['secs'] ?? 180;
             }
             }
-            return [true,$times,$secs];
+            return [true, $times, $secs];
         } else {
         } else {
-            return [false,0,0];
+            return [false, 0, 0];
         }
         }
     }
     }
 
 
-    public function times($mchid,$quality)
+    public function times($mchid, $quality)
     {
     {
-        if(array_key_exists($mchid,$this->mTimesConfig))
-        {
+        if (array_key_exists($mchid, $this->mTimesConfig)) {
             $items = $this->mTimesConfig[$mchid]['qualities'] ?? [];
             $items = $this->mTimesConfig[$mchid]['qualities'] ?? [];
-            if(array_key_exists($quality,$items)) {
+            if (array_key_exists($quality, $items)) {
                 return $items[$quality]['times'];
                 return $items[$quality]['times'];
             }
             }
         }
         }
@@ -51,12 +90,11 @@ class mratio_control
         return false;
         return false;
     }
     }
 
 
-    public function seconds($mchid,$quality)
+    public function seconds($mchid, $quality)
     {
     {
-        if(array_key_exists($mchid,$this->mTimesConfig))
-        {
+        if (array_key_exists($mchid, $this->mTimesConfig)) {
             $items = $this->mTimesConfig[$mchid]['qualities'] ?? [];
             $items = $this->mTimesConfig[$mchid]['qualities'] ?? [];
-            if(array_key_exists($quality,$items)) {
+            if (array_key_exists($quality, $items)) {
                 return $items[$quality]['secs'];
                 return $items[$quality]['secs'];
             }
             }
         }
         }
@@ -73,38 +111,100 @@ class mratio_control
         }
         }
     }
     }
 
 
-    public function update($ratios)
-    {
-        if(!empty($ratios)) {
-            $this->mCurRatios = $ratios;
-        }
-    }
-
     private function lower_ratio($mchid)
     private function lower_ratio($mchid)
     {
     {
         $lower_ratio = $this->mTimesConfig[$mchid]['lower_ratio'] ?? [];
         $lower_ratio = $this->mTimesConfig[$mchid]['lower_ratio'] ?? [];
-        return [$lower_ratio['ratio'],$lower_ratio['period']];
+        return [$lower_ratio['ratio'], $lower_ratio['period']];
     }
     }
 
 
-    private function cur_ratio($mchid,$period)
+    private function profit_ratio($mchid) {
+        $profit_ratio = $this->mTimesConfig[$mchid]['profit_ratio'] ?? 0.0;
+        return $profit_ratio;
+    }
+
+    private function gross_ratio($mchid, $period)
     {
     {
-        $mratios = $this->mCurRatios;
-        if(array_key_exists($mchid,$mratios)) {
+        $mratios = $this->mGrossRatios;
+        if (array_key_exists($mchid, $mratios)) {
             $mratios = $mratios[$mchid];
             $mratios = $mratios[$mchid];
-            if(array_key_exists($period,$mratios)) {
+            if (array_key_exists($period, $mratios)) {
                 return $mratios[$period];
                 return $mratios[$period];
             }
             }
         }
         }
 
 
-        return 1.0;
+        return [0, 0, 1.0];
+    }
+    private function detail_ratio($mchid, $quality, $card_type, $spec, $period)
+    {
+        $key = "{$mchid}-{$quality}-{$card_type}-{$spec}";
+        if(array_key_exists($key,$this->mDetailRatios)) {
+            $ratios = $this->mDetailRatios[$key];
+            if(array_key_exists($period,$ratios)) {
+                return $ratios[$period];
+            }
+        }
+        return [0, 0, 1.0];
+    }
+
+    private function detail_ratios($mchid,$qualities,$card_type, $spec,$period)
+    {
+        $result = [];
+        foreach ($qualities as $quality) {
+            $ret = $this->detail_ratio($mchid,$quality,$card_type,$spec,$period);
+            $result[$quality] = $ret;
+        }
+
+        return $result;
     }
     }
 
 
-    public function ratio_match($mchid)
+    public function ratio_match($mchid, $org_quality, $cur_quality, $card_type, $spec,$qualities)
     {
     {
-        [$ratio,$period] = $this->lower_ratio($mchid);
-        $cur_ratio = $this->cur_ratio($mchid,$period);
-        Log::record("ratio_match mchid={$mchid} cur_ratio={$cur_ratio}",Log::DEBUG);
+        $header = __METHOD__ . " mchid={$mchid} card_type={$card_type} spec={$spec}";
+        [$ratio, $period] = $this->lower_ratio($mchid);
+        [$_succ, $_fail, $gross_ratio] = $this->gross_ratio($mchid, $period);
+        Log::record("{$header} gross_ratio = {$gross_ratio},lower_ratio={$ratio}",Log::DEBUG);
+
+        if($gross_ratio >= $ratio) return true;
+        [$_succ, $_fail, $cur_ratio] = $this->detail_ratio($mchid, $cur_quality, $card_type, $spec, $period);
+        Log::record("{$header} cur_ratio = {$cur_ratio},lower_ratio={$ratio}",Log::DEBUG);
+
+        if($cur_ratio >= $ratio) return true;
+
+        if (!PolicyUtil::mixed_quality($org_quality)) {
+            return false;
+        }
+
+        $prices = $this->getPrice($mchid, $org_quality, $card_type, $spec);
+        if ($prices === false) {
+            return false;
+        }
+
+        $dratios = $this->detail_ratios($mchid, $qualities,$card_type, $spec, $period);
+        $profit_ratio = $this->profit_ratio($mchid);
+
+        $profit_judger = function ($org_quality,$qualities,$prices,$dratios,$profit_ratio) use ($header)
+        {
+            $sale = $prices[$org_quality];
+
+            $profit = 0;
+            $amount = 0;
+            foreach ($qualities as $quality) {
+                $inprice = $prices[$quality] ?? false;
+                if ($inprice === false) continue;
+
+                [$succ, $fail, $ratio] = $dratios[$quality];
+                $profit += $succ * ($sale - $inprice);
+                $amount += $succ * $sale;
+            }
+
+            $cur_pratio = round(($profit + 0.00001) / ($amount + 0.00001),4);
+            $profit_ratio = round($profit_ratio,4);
+
+            Log::record("{$header} cur_pratio = {$cur_pratio},profit_ratio={$profit_ratio}",Log::DEBUG);
+            return $cur_pratio > $profit_ratio;
+        };
 
 
-        return $cur_ratio >= $ratio;
+        $can_next = $profit_judger($org_quality,$qualities,$prices,$dratios,$profit_ratio);
+        return !$can_next;
     }
     }
 }
 }

+ 32 - 22
helper/refill/policy/quaility.php

@@ -43,6 +43,7 @@ class Quality
     protected $mSpeeds;
     protected $mSpeeds;
     protected $mQualities;
     protected $mQualities;
     protected $mTryAdjuster;
     protected $mTryAdjuster;
+
     protected $mRatioCtl;
     protected $mRatioCtl;
 
 
     public function __construct()
     public function __construct()
@@ -50,7 +51,7 @@ class Quality
         $this->mMchPhonectl = new mchctl();
         $this->mMchPhonectl = new mchctl();
         $this->mMchoilctl = new mchoilctl();
         $this->mMchoilctl = new mchoilctl();
         $this->mTryAdjuster = new try_judge();
         $this->mTryAdjuster = new try_judge();
-        $this->mRatioCtl = new mratio_control();
+        $this->mRatioCtl = null;
     }
     }
 
 
     public function load()
     public function load()
@@ -58,13 +59,29 @@ class Quality
         $this->mMchPhonectl->load();
         $this->mMchPhonectl->load();
         $this->mMchoilctl->load();
         $this->mMchoilctl->load();
         $this->mTryAdjuster->load();
         $this->mTryAdjuster->load();
-        $this->mRatioCtl->load();
     }
     }
 
 
-    public function find_quality($mchid, $card_type, $org_quality, $cur_quality, $times, $used_time, $caller): array
+    public function setRatioCtl($ratio_ctl) {
+        $this->mRatioCtl = $ratio_ctl;
+    }
+
+    public function qualities($quality)
+    {
+        if (array_key_exists($quality, $this->mQualities)) {
+            return $this->mQualities[$quality];
+        } else {
+            return [];
+        }
+    }
+
+    public function mechants_quality() {
+        return $this->mMchPhonectl->mechants_quality();
+    }
+
+    public function find_quality($mchid, $card_type, $spec, $org_quality, $cur_quality, $times, $used_time, $caller): array
     {
     {
         if($card_type == mtopcard\ChinaMobileCard || $card_type == mtopcard\ChinaUnicomCard || $card_type == mtopcard\ChinaTelecomCard) {
         if($card_type == mtopcard\ChinaMobileCard || $card_type == mtopcard\ChinaUnicomCard || $card_type == mtopcard\ChinaTelecomCard) {
-            return $this->mobile_quality($mchid, $org_quality, $cur_quality, $times, $used_time);
+            return $this->mobile_quality($mchid, $card_type, $spec, $org_quality, $cur_quality, $times, $used_time);
         }
         }
         elseif($card_type == mtopcard\PetroChinaCard || $card_type == mtopcard\SinopecCard) {
         elseif($card_type == mtopcard\PetroChinaCard || $card_type == mtopcard\SinopecCard) {
             return $this->oil_quality($mchid, $org_quality, $times,$used_time,$caller);
             return $this->oil_quality($mchid, $org_quality, $times,$used_time,$caller);
@@ -136,7 +153,7 @@ class Quality
     }
     }
 
 
 
 
-    private function mobile_quality($mchid, $org_quality, $cur_quality, $times, $used_time): array
+    private function mobile_quality($mchid, $card_type, $spec, $org_quality, $cur_quality, $times, $used_time): array
     {
     {
         if($org_quality == 0)
         if($org_quality == 0)
         {
         {
@@ -145,21 +162,17 @@ class Quality
             {
             {
                 if(array_key_exists($setting_quality,$this->mQualities)) {
                 if(array_key_exists($setting_quality,$this->mQualities)) {
                     $org_quality = $setting_quality;
                     $org_quality = $setting_quality;
-                    $qualities = $this->mQualities[$setting_quality];
                 }
                 }
                 else {
                 else {
                     $org_quality = $setting_quality;
                     $org_quality = $setting_quality;
-                    $qualities = [$setting_quality];
                 }
                 }
             }
             }
             else {
             else {
                 $org_quality = self::Normal; //如果没设置质量,默认为普通
                 $org_quality = self::Normal; //如果没设置质量,默认为普通
-                $qualities = $this->mQualities[$org_quality];
                 $time_out = $this->mSpeeds[$org_quality]['retry_timeout'];
                 $time_out = $this->mSpeeds[$org_quality]['retry_timeout'];
             }
             }
         }
         }
         elseif(array_key_exists($org_quality,$this->mQualities)) {
         elseif(array_key_exists($org_quality,$this->mQualities)) {
-            $qualities = $this->mQualities[$org_quality];
             [$success, $setting_quality, $time_out] = $this->mMchPhonectl->getCtls($mchid);
             [$success, $setting_quality, $time_out] = $this->mMchPhonectl->getCtls($mchid);
         }
         }
         else {
         else {
@@ -171,20 +184,20 @@ class Quality
             $time_out = $this->mSpeeds[$org_quality]['retry_timeout'];
             $time_out = $this->mSpeeds[$org_quality]['retry_timeout'];
         }
         }
 
 
+        $qualities = $this->qualities($org_quality);
         $max_times = $this->max_times($mchid,$org_quality);
         $max_times = $this->max_times($mchid,$org_quality);
-        if($this->mRatioCtl->exist($mchid))
-        {
-            $qualities = $this->ratio_phone_quality($qualities,$cur_quality,$times,$used_time,$mchid);
-            return [$org_quality,$qualities];
-        }
-        else {
+        if ($this->mRatioCtl->exist($mchid)) {
+            Log::record("ratio_phone_quality exist=true",Log::DEBUG);
+            $qualities = $this->ratio_phone_quality($org_quality, $qualities, $cur_quality, $times, $used_time, $mchid, $card_type, $spec);
+            return [$org_quality, $qualities];
+        } else {
             $fMixed = PolicyUtil::mixed_quality($org_quality);
             $fMixed = PolicyUtil::mixed_quality($org_quality);
-            $qualities = $this->calc_phone_quality($qualities,$fMixed,$cur_quality,$times,$used_time,$time_out,$max_times,$mchid);
-            return [$org_quality,$qualities];
+            $qualities = $this->calc_phone_quality($qualities, $fMixed, $cur_quality, $times, $used_time, $time_out, $max_times, $mchid);
+            return [$org_quality, $qualities];
         }
         }
     }
     }
 
 
-    private function ratio_phone_quality($qualities,$cur_quality,$times,$used_time,$mchid)
+    private function ratio_phone_quality($org_quality,$qualities, $cur_quality, $times, $used_time, $mchid, $card_type, $spec)
     {
     {
         [$succ,$max_times,$time_out] = $this->mRatioCtl->total($mchid);
         [$succ,$max_times,$time_out] = $this->mRatioCtl->total($mchid);
 
 
@@ -193,7 +206,7 @@ class Quality
             return [];
             return [];
         }
         }
 
 
-        $match_ratio = $this->mRatioCtl->ratio_match($mchid);
+        $match_ratio = $this->mRatioCtl->ratio_match($mchid, $org_quality, $cur_quality, $card_type, $spec, $qualities);
 
 
         Log::record("ratio_phone_quality begin qualities= " . implode(',',$qualities),Log::DEBUG);
         Log::record("ratio_phone_quality begin qualities= " . implode(',',$qualities),Log::DEBUG);
         $times_checker = function ($qualities, $times) use ($match_ratio, $cur_quality, $max_times, $mchid)
         $times_checker = function ($qualities, $times) use ($match_ratio, $cur_quality, $max_times, $mchid)
@@ -417,7 +430,4 @@ class Quality
 
 
         return $qualities;
         return $qualities;
     }
     }
-    public function update_mchratios($ratios) {
-        $this->mRatioCtl->update($ratios);
-    }
 }
 }

+ 0 - 15
helper/refill/policy/xyz/PolicyUtil.php

@@ -1,15 +0,0 @@
-<?php
-
-namespace refill;
-
-class PolicyUtil
-{
-    public static function mixed_quality($quality) : bool
-    {
-        if($quality == Quality::DefSuccess || $quality == Quality::NormalQuick) {
-            return true;
-        } else {
-            return false;
-        }
-    }
-}

+ 168 - 7
helper/refill/policy/xyz/policy.php

@@ -16,6 +16,7 @@ class policy extends ProviderManager implements IPolicy
     protected $mAmountLockTurn;
     protected $mAmountLockTurn;
     protected $mStorageLocker;
     protected $mStorageLocker;
     protected $mGroupCtl;
     protected $mGroupCtl;
+    protected $mRatioCtl;
 
 
     public function __construct()
     public function __construct()
     {
     {
@@ -25,6 +26,9 @@ class policy extends ProviderManager implements IPolicy
         $this->mPrices = new merchant_price();
         $this->mPrices = new merchant_price();
         $this->mStorageLocker = new rstorage();
         $this->mStorageLocker = new rstorage();
         $this->mGroupCtl = new rgroup_ctl();
         $this->mGroupCtl = new rgroup_ctl();
+
+        $this->mRatioCtl = new mratio_control();
+        $this->mQuality->setRatioCtl($this->mRatioCtl);
     }
     }
 
 
     public function load()
     public function load()
@@ -47,6 +51,165 @@ class policy extends ProviderManager implements IPolicy
 
 
         $this->mStorageLocker->load();
         $this->mStorageLocker->load();
         $this->mGroupCtl->load($opened_names,$opened_merchants);
         $this->mGroupCtl->load($opened_names,$opened_merchants);
+        $this->mRatioCtl->load();
+
+        $this->init_mavg_price();
+    }
+
+    private function init_mavg_price()
+    {
+        $specs_merger = function ($qspecs)
+        {
+            $q_keys = [];
+            foreach ($qspecs as $quality => $specs)
+            {
+                foreach ($specs as $item) {
+                    [$card_type, $spec] = $item;
+                    $q_keys[$quality][] = "{$card_type}-{$spec}";
+                }
+            }
+
+            $sspecs = [];
+            $first = true;
+            foreach ($q_keys as $quality => $specs)
+            {
+                if ($first) {
+                    $sspecs = $specs;
+                    $first = false;
+                } else {
+                    $sspecs = array_intersect($sspecs, $specs);
+                }
+            }
+
+            $result = [];
+            foreach ($sspecs as $item) {
+                [$card_type, $spec] = explode('-',$item);
+                $result[] = [intval($card_type), intval($spec)];
+            }
+
+            return $result;
+        };
+
+        $pQuality = $this->mQuality;
+        $mchids = $pQuality->mechants_quality();
+        foreach ($mchids as $mchid => $mixed_quality)
+        {
+            $qualities = $pQuality->qualities($mixed_quality);
+            $specs = [];
+            foreach ($qualities as $quality) {
+                $item = $this->mPrices->merchant_specs($mchid, $quality);
+                if (empty($item)) continue;
+                $specs[$quality] = $item;
+            }
+
+            $specs = $specs_merger($specs);
+            foreach ($specs as $item)
+            {
+                [$card_type, $spec] = $item;
+                if (!in_array($card_type, [4, 5, 6])) continue;
+
+                $prices = [];
+                $sale_price = $this->mPrices->price($mchid,$card_type,$spec,$mixed_quality,'');
+                $prices[$mixed_quality] = round($sale_price,4);
+
+                foreach ($qualities as $quality) {
+                    $inprice  = $this->calc_maxprice($mchid, $quality, $card_type, $spec);
+                    $prices[$quality] = round($inprice,4);
+                }
+
+                $this->mRatioCtl->setMixedPrice($mchid, $mixed_quality, $card_type, $spec, $prices);
+            }
+        }
+    }
+
+    protected function calc_avgprice($mchid,$quality,$card_type,$spec)
+    {
+        $providers = parent::get_providers($mchid,$spec,$card_type,$quality,-1);
+        $names = [];
+        foreach ($providers as $provider) {
+            $names[] = $provider->name();
+        }
+
+        [$hasGroup,$can_others,$channels] = $this->mGroupCtl->find_providers($mchid, $spec, $card_type, $quality);
+        if($hasGroup)
+        {
+            if(empty($channels))
+            {
+                if(!$can_others) {
+                    return false;
+                }
+            }
+            else
+            {
+                $ret = array_intersect($names, $channels);
+                if (empty($ret)) {
+                    return false;
+                }
+                else {
+                    $names = $ret;
+                }
+            }
+        }
+
+        $name_provider = [];
+        foreach ($providers as $provider) {
+            $name = $provider->name();
+            $name_provider[$name] = $provider;
+        }
+
+        $total = 0.0;
+        foreach ($names as $name) {
+            $provider = $name_provider[$name];
+            [$goods_id, $price] = $provider->goods($quality, $spec, $card_type, -1, []);
+            $total += $price;
+        }
+
+        return $total / count($names);
+    }
+
+    protected function calc_maxprice($mchid,$quality,$card_type,$spec)
+    {
+        $providers = parent::get_providers($mchid,$spec,$card_type,$quality,-1);
+        $names = [];
+        foreach ($providers as $provider) {
+            $names[] = $provider->name();
+        }
+
+        [$hasGroup,$can_others,$channels] = $this->mGroupCtl->find_providers($mchid, $spec, $card_type, $quality);
+        if($hasGroup)
+        {
+            if(empty($channels))
+            {
+                if(!$can_others) {
+                    return false;
+                }
+            }
+            else
+            {
+                $ret = array_intersect($names, $channels);
+                if (empty($ret)) {
+                    return false;
+                }
+                else {
+                    $names = $ret;
+                }
+            }
+        }
+
+        $name_provider = [];
+        foreach ($providers as $provider) {
+            $name = $provider->name();
+            $name_provider[$name] = $provider;
+        }
+
+        $max_price = 0.0;
+        foreach ($names as $name) {
+            $provider = $name_provider[$name];
+            [$goods_id, $price] = $provider->goods($quality, $spec, $card_type, -1, []);
+            if($price > $max_price) $max_price = $price;
+        }
+
+        return $max_price;
     }
     }
 
 
     private function opened_merchants()
     private function opened_merchants()
@@ -80,8 +243,6 @@ class policy extends ProviderManager implements IPolicy
         $card_type = $order->card_type();
         $card_type = $order->card_type();
         $org_quality = $order->org_quality();
         $org_quality = $order->org_quality();
         $cur_quality = $order->cur_quality();
         $cur_quality = $order->cur_quality();
-        $commit_times = $order->commit_times();
-        $elapse_secs = $order->elapse_secs();
         $pcode = $order->pcode();
         $pcode = $order->pcode();
         $regin_no = $order->region_no();
         $regin_no = $order->region_no();
         $order_time = $order->order_time();
         $order_time = $order->order_time();
@@ -163,7 +324,7 @@ class policy extends ProviderManager implements IPolicy
         }
         }
         else
         else
         {
         {
-            $name_overloads = $this->mChannelControl->match($names,$spec,$card_type,$cur_quality);
+            $name_overloads = $this->mChannelControl->match($names, $spec, $card_type, $cur_quality);
             Log::record("policy::find_providers ChannelControl match result=" . implode(',',array_keys($name_overloads)),Log::DEBUG);
             Log::record("policy::find_providers ChannelControl match result=" . implode(',',array_keys($name_overloads)),Log::DEBUG);
 
 
             $result = [];
             $result = [];
@@ -210,7 +371,7 @@ class policy extends ProviderManager implements IPolicy
             $caller = null;
             $caller = null;
         }
         }
 
 
-        [$org_quality,$qualities] = $this->mQuality->find_quality($mchid,$card_type,$org_quality,$cur_quality,$commit_times,$elapse_secs,$caller);
+        [$org_quality, $qualities] = $this->mQuality->find_quality($mchid, $card_type, $spec, $org_quality, $cur_quality, $commit_times, $elapse_secs, $caller);
         if(empty($qualities)) {
         if(empty($qualities)) {
             return [$org_quality,0];
             return [$org_quality,0];
         }
         }
@@ -329,7 +490,7 @@ class policy extends ProviderManager implements IPolicy
         $params = [
         $params = [
             "mchid" => $refill_info['mchid'],
             "mchid" => $refill_info['mchid'],
             "order_sn" => $refill_info['mch_order'],
             "order_sn" => $refill_info['mch_order'],
-            "amount" => $refill_info['refill_amount'],//intval($refill_info['refill_amount'] + 0.05),
+            "amount" => $refill_info['refill_amount'],
             "cardno" => $refill_info['card_no'],
             "cardno" => $refill_info['card_no'],
             "trade_no" => $refill_info['order_sn'],
             "trade_no" => $refill_info['order_sn'],
             "idcard" => $refill_info['idcard'] ?? "",
             "idcard" => $refill_info['idcard'] ?? "",
@@ -420,8 +581,8 @@ class policy extends ProviderManager implements IPolicy
         $this->mChannelControl->update_ratios($ratios);
         $this->mChannelControl->update_ratios($ratios);
     }
     }
 
 
-    public function update_mchratios($ratios)
+    public function update_mchratios($gross,$detail)
     {
     {
-        $this->mQuality->update_mchratios($ratios);
+        $this->mRatioCtl->update($gross,$detail);
     }
     }
 }
 }

+ 2 - 2
helper/refill/util.php

@@ -634,7 +634,7 @@ class util
         }
         }
         $url = BASE_SITE_URL . "/mobile/callback/refill_baidu.php";
         $url = BASE_SITE_URL . "/mobile/callback/refill_baidu.php";
         go(function () use ($url, $status,$order_sn) {
         go(function () use ($url, $status,$order_sn) {
-            sleep(1);
+            sleep(30);
             while (true)
             while (true)
             {
             {
                 $resp = http_request($url,['status' => $status,'order_sn' => $order_sn],'GET', false, [], $net_errno);
                 $resp = http_request($url,['status' => $status,'order_sn' => $order_sn],'GET', false, [], $net_errno);
@@ -658,7 +658,7 @@ class util
 
 
         $url = BASE_SITE_URL . "/mobile/callback/refill_baidu.php";
         $url = BASE_SITE_URL . "/mobile/callback/refill_baidu.php";
         go(function () use ($url, $status,$order_sn) {
         go(function () use ($url, $status,$order_sn) {
-            sleep(1);
+            sleep(30);
             while (true)
             while (true)
             {
             {
                 $resp = http_request($url,['status' => $status,'order_sn' => $order_sn],'GET', false, [], $net_errno);
                 $resp = http_request($url,['status' => $status,'order_sn' => $order_sn],'GET', false, [], $net_errno);

+ 122 - 1
plot/MchDataCenter.py

@@ -500,7 +500,7 @@ class MchDataCenter(object):
         for mchid, paths in mchid_paths.items():
         for mchid, paths in mchid_paths.items():
             mch_ratios = {}
             mch_ratios = {}
             for card_type, name in card_types.items():
             for card_type, name in card_types.items():
-                print('card_type=',card_type,'name=',name)
+                print('card_type=', card_type, 'name=', name)
                 if card_type is None:
                 if card_type is None:
                     cur_paths = paths
                     cur_paths = paths
                 else:
                 else:
@@ -540,4 +540,125 @@ class MchDataCenter(object):
             finally:
             finally:
                 stime.sleep(2)
                 stime.sleep(2)
 
 
+    ####################################################################################################################
+    ####
+    def _calc_mcount(self,data,startes,end):
+        succ = data[1]
+        fail = data[2]
+        x = np.arange(0, 86400, 1)
+
+        result = {}
+        for start in startes:
+            if end - start < 0:
+                start_pos = 0
+            else:
+                start_pos = end - start
+
+            pos = np.where(x >= start_pos)
+            t = x[pos]
+            _succ = succ[pos]
+            _fail = fail[pos]
+
+            pos = np.where(t < end)
+            _succ = _succ[pos]
+            _fail = _fail[pos]
+
+            succs = int(np.sum(_succ))
+            fails = int(np.sum(_fail))
+            ratio = round((succs + 0.00001) / (succs + fails + 0.00001), 4)
+            result[start] = [succs, fails, ratio]
+        return result
+
+    def merchant_rmobile_path(self, paths):
+        result = {}
+        for path in paths:
+            items = re.split(r'/', path)
+            if len(items) != 6:
+                continue
+            (_, _sday, _mchid, _quality, _card_type, _amount) = items
+
+            _card_type = int(_card_type)
+            if _card_type not in [4, 5, 6]:
+                continue
+
+            _mchid = int(_mchid)
+            if _mchid not in result:
+                result[_mchid] = []
+            result[_mchid].append(path)
+        return result
+
+    def rmobile_path(self, paths):
+        result = []
+        for path in paths:
+            items = re.split(r'/', path)
+            if len(items) != 6:
+                continue
+            (_, _sday, _mchid, _quality, _card_type, _amount) = items
+
+            _card_type = int(_card_type)
+            if _card_type not in [4, 5, 6]:
+                continue
+            result.append(path)
+        return result
+
+    def mch_count(self, paths, presecs,time_stamp):
+        hfive = h5py.File(self._file_name, 'r')
+        mdata = self._merge_data(hfive,paths)
+        day_stamp = self.day_stamp(time_stamp)
+        result = self._calc_mcount(mdata,presecs,time_stamp - day_stamp)
+        hfive.close()
+
+        return result
+
+    def mch_detail_count(self, paths, presecs,time_stamp):
+        hfive = h5py.File(self._file_name, 'r')
+
+        result = {}
+        for path in paths:
+            items = re.split(r'/', path)
+            if len(items) != 6:
+                continue
+            (_, _sday, _mchid, _quality, _card_type, _amount) = items
+            key = f"{_mchid}-{_quality}-{_card_type}-{_amount}"
+            mdata = hfive[path]
+            day_stamp = self.day_stamp(time_stamp)
+            result[key] = self._calc_mcount(mdata,presecs,time_stamp - day_stamp)
+        hfive.close()
+        return result
+
+    def mch_counts(self):
+        import json
+
+        r = None
+        try:
+            pool = redis.ConnectionPool(host=self._mRHost, port=self._mRPort, db=0)
+            r = redis.Redis(connection_pool=pool)
+        except Exception as ex:
+            print(ex)
+
+        while True:
+            try:
+                time_stamp = int(stime.time())
+                presecs = [900, 1800, 3600, 7200, 86400]
+                all_paths = self.paths(time_stamp)
+                mchid_paths = self.merchant_rmobile_path(all_paths)
+
+                gross = {}
+                for mchid, paths in mchid_paths.items():
+                    counts = self.mch_count(paths, presecs, time_stamp)
+                    gross[mchid] = counts
+
+                paths = self.rmobile_path(all_paths)
+                detail = self.mch_detail_count(paths, presecs, time_stamp)
+
+                result = {'gross': gross, 'detail': detail}
+                if len(result) != 0:
+                    r.set(f"nc_merchant_refill_counts", json.dumps(result))
+                    r.publish('refill',json.dumps({'type':'mch_counts','value':0}))
+                    print('push msg=', result)
+            except Exception as ex:
+                print(ex)
+            finally:
+                stime.sleep(2)
+
 mchDataCenter = MchDataCenter()
 mchDataCenter = MchDataCenter()

+ 23 - 0
plot/mcounts.py

@@ -0,0 +1,23 @@
+from MchDataCenter import mchDataCenter
+import signal as sig
+import sys,getopt
+
+if __name__ == '__main__':
+    try:
+        opts, args = getopt.getopt(sys.argv[1:],"h:p:",["host=",'port='])
+    except Exception as ex:
+        print(ex)
+        sys.exit(2)
+
+    rhost = ''
+    rport=6379
+    for o, val in opts:
+        if o in ("-h", "--host"):
+            rhost = val
+        elif o in ('-p', "--port"):
+            rport = int(val)
+        else:
+            print("Err argv")
+    mchDataCenter.set_redis(rhost,rport)
+    sig.signal(sig.SIGINT, lambda: mchDataCenter.stop())
+    mchDataCenter.mch_counts()

+ 4 - 0
plot/thdf5.py

@@ -144,6 +144,10 @@ class DataTest(unittest.TestCase):
         mchDataCenter.set_redis('192.168.1.220','6379')
         mchDataCenter.set_redis('192.168.1.220','6379')
         mchDataCenter.calc_ratios()
         mchDataCenter.calc_ratios()
 
 
+    def test_mechcounts(self):
+        mchDataCenter.set_redis('192.168.1.220','6379')
+        mchDataCenter.mch_counts()
+
     def test_pubRatio(self):
     def test_pubRatio(self):
         dataCenter.set_redis('192.168.1.220','6379')
         dataCenter.set_redis('192.168.1.220','6379')
         dataCenter.pub_ratio()
         dataCenter.pub_ratio()

+ 10 - 7
rdispatcher/codispatcher.php

@@ -91,18 +91,21 @@ function subscribe_message(&$quit, &$redis, $channels)
 
 
                         refill\RefillFactory::instance()->UpdateRatio($ratios);
                         refill\RefillFactory::instance()->UpdateRatio($ratios);
                     }
                     }
-                    elseif($type == 'mch_ratio') {
+                    elseif($type == 'mch_counts') {
                         $ins = Cache::getInstance('cacheredis');
                         $ins = Cache::getInstance('cacheredis');
-                        $val = $ins->get_org('merchant_ratios');
+                        $content = $ins->get_org('merchant_refill_counts');
 
 
-                        if(empty($val)) continue;
-                        $mch_ratios = json_decode($val,true);
-                        if(empty($mch_ratios)) continue;
+                        if(empty($content)) continue;
+                        $counts = json_decode($content,true);
+                        if(empty($counts)) continue;
+
+                        $gross = $counts['gross'];
+                        $detail = $counts['detail'];
 
 
-                        refill\RefillFactory::instance()->UpdatMchRatios($mch_ratios);
+                        refill\RefillFactory::instance()->UpdatMchRatios($gross,$detail);
                     }
                     }
                     else {
                     else {
-                        Log::record("subscribe_message dont not handle mgs:{$sub_type}-{$channel}-{$type}",Log::DEBUG);
+                        //Log::record("subscribe_message dont not handle mgs:{$sub_type}-{$channel}-{$type}",Log::DEBUG);
                     }
                     }
                 }
                 }
             }
             }

文件差异内容过多而无法显示
+ 17 - 0
test/TestBigData.php


+ 33 - 1
test/TestRefillThird.php

@@ -116,6 +116,38 @@ class TestRefillThird extends TestCase
         //docker-compose run phpcli php /var/www/html/phpunit-9.2.5.phar --filter "/(TestRefillThird::testLittlePushPhones)( .*)?$/" --test-suffix TestRefillThird.php /var/www/html/test
         //docker-compose run phpcli php /var/www/html/phpunit-9.2.5.phar --filter "/(TestRefillThird::testLittlePushPhones)( .*)?$/" --test-suffix TestRefillThird.php /var/www/html/test
     }
     }
 
 
+    public function testSlowPushPhones()
+    {
+        $sender = function ()
+        {
+            $time = time();
+            for ($i = 0; $i < 100; $i++)
+            {
+                $params = [ 'mchid' => 1092,
+                    'buyer_id' => 60221,
+                    'amount' => 30,
+                    'mch_order' => "{$time}" . sprintf("%'010d",$i),
+                    'card_no' => '13911129867',
+                    'card_type' => 5,
+                    'regin_no' => 1,
+                    'cardno_state' => 1,
+                    'is_validate' => 1,
+                    'is_transfer' => 1
+                ];
+
+                $ret = refill\util::push_add($params);
+                Log::record("push message",Log::DEBUG);
+            }
+        };
+
+        for ($i = 0;$i < 100; $i++) {
+            $sender();
+            sleep(2);
+        }
+
+        //docker-compose run phpcli php /var/www/html/phpunit-9.2.5.phar --filter "/(TestRefillThird::testSlowPushPhones)( .*)?$/" --test-suffix TestRefillThird.php /var/www/html/test
+    }
+
     public function testPushPhones()
     public function testPushPhones()
     {
     {
         $time = time();
         $time = time();
@@ -391,6 +423,6 @@ class TestRefillThird extends TestCase
 
 
     public function testLoad()
     public function testLoad()
     {
     {
-        refill\RefillFactory::instance()->load();
+        refill\RefillFactory::instance();
     }
     }
 }
 }