stanley-king 3 tahun lalu
induk
melakukan
30ed4bf283
44 mengubah file dengan 1320 tambahan dan 1105 penghapusan
  1. 1 1
      admin/control/control.php
  2. 77 65
      admin/control/merchant.php
  3. 1 0
      admin/control/ordersendlist.php
  4. 2 2
      admin/control/orderstats.php
  5. 2 3
      admin/control/provider_ctl.php
  6. 18 1
      admin/control/refill_successful.php
  7. 424 0
      admin/templates/default/merchant.ctl.php
  8. 0 40
      admin/templates/default/merchant.edit.php
  9. 11 8
      admin/templates/default/merchant.index.php
  10. 0 66
      admin/templates/default/merchant.intercept.php
  11. 12 11
      admin/templates/default/merchant.order.stats.php
  12. 84 84
      admin/templates/default/merchant.ratios.php
  13. 0 152
      admin/templates/default/merchant.retry.times.php
  14. 7 18
      admin/templates/default/provider.order.stats.php
  15. 0 280
      admin/templates/default/refill.task.add.php
  16. 6 15
      admin/templates/default/system.order.stats.php
  17. 2 0
      crontab/control/minutes.php
  18. 0 5
      data/config/dev/refill.ini.php
  19. 77 51
      data/config/win/refill.ini.php
  20. 77 51
      data/config/xyz/refill.ini.php
  21. 77 51
      data/config/xyzadm/refill.ini.php
  22. 1 1
      helper/bonus/BonusAmount.php
  23. 6 1
      helper/mtopcard/mtopcard.php
  24. 4 4
      helper/refill/CalcMerchantPrice.php
  25. 2 0
      helper/refill/LZRefillFactory.php
  26. 5 0
      helper/refill/RefillBase.php
  27. 2 0
      helper/refill/XYZRefillFactory.php
  28. TEMPAT SAMPAH
      helper/refill/api/xyz/guochuang/20211022黑龙江移动.png
  29. TEMPAT SAMPAH
      helper/refill/api/xyz/guochuang/20211025辽宁移动.png
  30. 2 2
      helper/refill/api/xyz/guochuang/config.php
  31. 3 0
      helper/refill/policy/IPolicy.php
  32. 40 17
      helper/refill/policy/chctl.php
  33. 97 51
      helper/refill/policy/lingzh/policy.php
  34. 31 3
      helper/refill/policy/merchant_price.php
  35. 131 8
      helper/refill/policy/mratio_control.php
  36. 4 4
      helper/refill/policy/quaility.php
  37. 28 8
      helper/refill/policy/xyz/policy.php
  38. 4 4
      helper/refill/util.php
  39. 49 63
      helper/statistics/stat_refill.php
  40. 20 16
      rdispatcher/proxy.php
  41. 3 2
      test/TestExportOrder.php
  42. 8 9
      test/TestRefill.php
  43. 0 6
      test/TestRefillStats.php
  44. 2 2
      test/TestRefillThird.php

+ 1 - 1
admin/control/control.php

@@ -363,7 +363,7 @@ class SystemControl
     protected function elapse_time($seconds)
     protected function elapse_time($seconds)
     {
     {
         $minutes = intval($seconds / 60);
         $minutes = intval($seconds / 60);
-        $second = $seconds % 60;
+        $second = intval($seconds % 60);
         if ($minutes >= 60) {
         if ($minutes >= 60) {
             $minute = $minutes % 60;
             $minute = $minutes % 60;
             $hours = intval($minutes / 60);
             $hours = intval($minutes / 60);

+ 77 - 65
admin/control/merchant.php

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

+ 1 - 0
admin/control/ordersendlist.php

@@ -22,6 +22,7 @@ class ordersendlistControl extends SystemControl
         //提前20s
         //提前20s
         $time = time() + 20;
         $time = time() + 20;
         $condition['refill_order.order_time'] = ['exp', "refill_order.order_time < ({$time} - merchant.time_out)"];
         $condition['refill_order.order_time'] = ['exp', "refill_order.order_time < ({$time} - merchant.time_out)"];
+        $condition['vr_order.add_time'] = ['egt', strtotime("-5 days")];
 //        $condition['refill_order.order_time'] = ['lt',time()-300];
 //        $condition['refill_order.order_time'] = ['lt',time()-300];
         if (!empty($_GET['mchid'])) {
         if (!empty($_GET['mchid'])) {
             $condition['refill_order.mchid'] = $_GET['mchid'];
             $condition['refill_order.mchid'] = $_GET['mchid'];

+ 2 - 2
admin/control/orderstats.php

@@ -60,9 +60,10 @@ class orderstatsControl extends SystemControl
         }
         }
         
         
         $total_stats = $this->stats($condition);
         $total_stats = $this->stats($condition);
+        $order_time_type_text = ['notify_time' => '回调时间', 'order_time' => '下单时间'];
         Tpl::output('total_stats', $total_stats);
         Tpl::output('total_stats', $total_stats);
         Tpl::output('stats_list', $stats_list);
         Tpl::output('stats_list', $stats_list);
-        Tpl::output('order_time_type_text', $this->order_time_type);
+        Tpl::output('order_time_type_text', $order_time_type_text);
         Tpl::output('show_page', $model_refill_order->showpage());
         Tpl::output('show_page', $model_refill_order->showpage());
         Tpl::showpage($page);
         Tpl::showpage($page);
     }
     }
@@ -138,7 +139,6 @@ class orderstatsControl extends SystemControl
         }
         }
         return $result;
         return $result;
     }
     }
-
     public function refill_taskOp()
     public function refill_taskOp()
     {
     {
         $model = Model('refill_task');
         $model = Model('refill_task');

+ 2 - 3
admin/control/provider_ctl.php

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

+ 18 - 1
admin/control/refill_successful.php

@@ -117,7 +117,8 @@ class refill_successfulControl extends SystemControl
         //0:成功单,1:失败单,2:成功率
         //0:成功单,1:失败单,2:成功率
         $ins = Cache::getInstance('cacheredis');
         $ins = Cache::getInstance('cacheredis');
         $json = $ins->get_org('merchant_card_type_ratios');
         $json = $ins->get_org('merchant_card_type_ratios');
-        $data = json_decode($json, true);
+        $data = json_decode($json);
+        $data = $this->object_array($data);
         $result = [];
         $result = [];
         $stats = [];
         $stats = [];
         $card_types = ['YD', 'LT', 'DX'];
         $card_types = ['YD', 'LT', 'DX'];
@@ -146,4 +147,20 @@ class refill_successfulControl extends SystemControl
         Tpl::output('list', $result);
         Tpl::output('list', $result);
         Tpl::showpage('merchant.ratios');
         Tpl::showpage('merchant.ratios');
     }
     }
+
+    private function object_array($array)
+    {
+        if(is_object($array))
+        {
+            $array = (array)$array;
+        }
+        if(is_array($array))
+        {
+            foreach($array as $key=>$value)
+            {
+                $array[$key] = $this->object_array($value);
+            }
+        }
+        return $array;
+    }
 }
 }

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

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

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

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

+ 11 - 8
admin/templates/default/merchant.index.php

@@ -79,7 +79,7 @@ defined('InShopNC') or exit('Access Invalid!'); ?>
                 <th class="align-left">上次登录日期</th>
                 <th class="align-left">上次登录日期</th>
                 <th class="align-center">加款操作</th>
                 <th class="align-center">加款操作</th>
                 <th class="align-center">机构操作</th>
                 <th class="align-center">机构操作</th>
-                <th class="align-center">充值操作(暂不生效)</th>
+                <th class="align-center">充值操作</th>
                 <th class="align-center"><?php echo $lang['operation']; ?></th>
                 <th class="align-center"><?php echo $lang['operation']; ?></th>
             </tr>
             </tr>
             </thead>
             </thead>
@@ -122,7 +122,7 @@ defined('InShopNC') or exit('Access Invalid!'); ?>
                             <a href="index.php?act=merchant&op=recharge_manual&type=edit&mchid=<?php echo $v['mchid'] ?>">调款</a>
                             <a href="index.php?act=merchant&op=recharge_manual&type=edit&mchid=<?php echo $v['mchid'] ?>">调款</a>
                         </td>
                         </td>
                         <td class="align-center w200" id="mechanism">
                         <td class="align-center w200" id="mechanism">
-                            <a href="index.php?act=merchant&op=merchant_edit&mchid=<?php echo $v['mchid'] ?>">编辑</a>
+                            <a href="index.php?act=merchant&op=merchant_edit&mchid=<?php echo $v['mchid'] ?>">基础设置</a>
                             <?php if($v['merchant_state'] == 1){?>
                             <?php if($v['merchant_state'] == 1){?>
                                 |
                                 |
                                 <a class="closeall" href="index.php?act=merchant&op=changeState&state=2&mchid=<?php echo $v['mchid'] ?>" style="color: red">关闭机构</a>
                                 <a class="closeall" href="index.php?act=merchant&op=changeState&state=2&mchid=<?php echo $v['mchid'] ?>" style="color: red">关闭机构</a>
@@ -133,13 +133,16 @@ defined('InShopNC') or exit('Access Invalid!'); ?>
                             <?php }?>
                             <?php }?>
                         </td>
                         </td>
                         <td class="align-center">
                         <td class="align-center">
-                            <a href="index.php?act=merchant&op=merchant_retry_times&mchid=<?php echo $v['mchid'] ?>">
-                                质量设置
-                            </a>
-                            |
-                            <a href="index.php?act=merchant&op=merchant_intercept&mchid=<?php echo $v['mchid'] ?>">
-                                拦截设置
+                            <a href="index.php?act=merchant&op=merchant_ctl&mchid=<?php echo $v['mchid'] ?>">
+                                充值设置
                             </a>
                             </a>
+<!--                            <a href="index.php?act=merchant&op=merchant_retry_times&mchid=--><?php //echo $v['mchid'] ?><!--">-->
+<!--                                质量设置-->
+<!--                            </a>-->
+<!--                            |-->
+<!--                            <a href="index.php?act=merchant&op=merchant_intercept&mchid=--><?php //echo $v['mchid'] ?><!--">-->
+<!--                                拦截设置-->
+<!--                            </a>-->
                         </td>
                         </td>
                         <td class="align-center w200">
                         <td class="align-center w200">
                             <a href="index.php?act=merchant&op=price&quality=1&mchid=<?php echo $v['mchid'] ?>">通道费率设置</a>
                             <a href="index.php?act=merchant&op=price&quality=1&mchid=<?php echo $v['mchid'] ?>">通道费率设置</a>

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

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

+ 12 - 11
admin/templates/default/merchant.order.stats.php

@@ -31,8 +31,6 @@
                 <li><a href="index.php?act=OrderStats&op=index&type=system"><span>平台对账记录</span></a></li>
                 <li><a href="index.php?act=OrderStats&op=index&type=system"><span>平台对账记录</span></a></li>
                 <li><a href="index.php?act=OrderStats&op=index&type=provider"><span>上游对账记录</span></a></li>
                 <li><a href="index.php?act=OrderStats&op=index&type=provider"><span>上游对账记录</span></a></li>
                 <li><a href="JavaScript:void(0);" class="current"><span>下游对账记录</span></a></li>
                 <li><a href="JavaScript:void(0);" class="current"><span>下游对账记录</span></a></li>
-                <li><a href="index.php?act=OrderStats&op=refill_task"><span>任务列表</span></a></li>
-                <li><a href="index.php?act=OrderStats&op=task_add"><span>任务录入</span></a></li>
             </ul>
             </ul>
         </div>
         </div>
     </div>
     </div>
@@ -49,25 +47,30 @@
             <tr>
             <tr>
                 <th><label for="query_start_time">统计时间</label></th>
                 <th><label for="query_start_time">统计时间</label></th>
                 <td>
                 <td>
-                    <label for="startTime"></label>
                     <input class="txt date" type="text" value="<?php echo $_GET['query_start_time']; ?>"
                     <input class="txt date" type="text" value="<?php echo $_GET['query_start_time']; ?>"
-                           id="startTime" name="query_start_time" autocomplete="off" style="width:120px"/>
+                           id="startTime" name="query_start_time" autocomplete="off" style="width:120px" />
                     <label for="query_start_time">~</label>
                     <label for="query_start_time">~</label>
-                    <label for="endTime"></label>
                     <input class="txt date" type="text" value="<?php echo $_GET['query_end_time']; ?>"
                     <input class="txt date" type="text" value="<?php echo $_GET['query_end_time']; ?>"
-                           id="endTime" name="query_end_time" autocomplete="off" style="width:120px"/>
+                           id="endTime" name="query_end_time" autocomplete="off" style="width:120px" />
                 </td>
                 </td>
                 <th><label>统计日期类型</label></th>
                 <th><label>统计日期类型</label></th>
                 <td>
                 <td>
                     <select name="order_time_type" id="order_time_type">
                     <select name="order_time_type" id="order_time_type">
                         <option value="">请选择...</option>
                         <option value="">请选择...</option>
-                        <?php foreach ($output['order_time_type_text'] as $key => $value) { ?>
-                            <option value="<?php echo $key; ?>" <?php if($_GET['order_time_type'] == $value){ echo 'selected';}?>><?php echo $value; ?></option>
-                        <?php } ?>
+                        <option value="notify_time" <?php if($_GET['order_time_type'] == 'notify_time'){ echo 'selected';}?>>回调日期</option>
+                        <option value="order_time" <?php if($_GET['order_time_type'] == 'order_time'){ echo 'selected';}?>>下单日期</option>
                     </select>
                     </select>
                 </td>
                 </td>
                 <th><label>商户名称</label></th>
                 <th><label>商户名称</label></th>
                 <td>
                 <td>
+                    <!-- <select name="cid" id="cid" class="querySelect" lay-verify="" lay-search>
+                        <option value=""><?php echo $lang['nc_please_choose']; ?></option>
+                        <?php foreach($output['merchant_list'] as $merchant){?>
+                            <option value="<?php echo $merchant['mchid']?>"
+                                    <?php if ($_GET['cid'] == $merchant['mchid']){ ?>selected<?php } ?>><?php echo $merchant['company_name'] == '' ? $merchant['name'] : $merchant['company_name'];?>
+                            </option>
+                        <?php }?>
+                    </select> -->
                     <div id="selest_nc"></div>
                     <div id="selest_nc"></div>
                 </td>
                 </td>
                 <td><a href="javascript:void(0);" id="ncsubmit" class="btn-search "
                 <td><a href="javascript:void(0);" id="ncsubmit" class="btn-search "
@@ -129,7 +132,6 @@
 <!--                <th class="align-center">失败订单数量</th>-->
 <!--                <th class="align-center">失败订单数量</th>-->
 <!--                <th class="align-center">成功占比</th>-->
 <!--                <th class="align-center">成功占比</th>-->
                 <th class="align-center">当日结余</th>
                 <th class="align-center">当日结余</th>
-                <th class="align-center">充值中数量</th>
                 <th class="align-center">下游成功单量</th>
                 <th class="align-center">下游成功单量</th>
                 <th class="align-center">下游成功面值</th>
                 <th class="align-center">下游成功面值</th>
                 <th class="align-center">下游成功扣款金额</th>
                 <th class="align-center">下游成功扣款金额</th>
@@ -159,7 +161,6 @@
 <!--                        <td class="align-center">--><?php //echo $v['order_count']; ?><!--</td>-->
 <!--                        <td class="align-center">--><?php //echo $v['order_count']; ?><!--</td>-->
 <!--                        <td class="align-center">--><?php //echo $v['cancel_count']; ?><!--</td>-->
 <!--                        <td class="align-center">--><?php //echo $v['cancel_count']; ?><!--</td>-->
 <!--                        <td class="align-center">--><?php //echo $v['success_ratio']; ?><!--</td>-->
 <!--                        <td class="align-center">--><?php //echo $v['success_ratio']; ?><!--</td>-->
-                        <td class="align-center"><?php echo $v['send_count']; ?></td>
                         <td class="align-center"><?php echo $v['corder_success_count']; ?></td>
                         <td class="align-center"><?php echo $v['corder_success_count']; ?></td>
                         <td class="align-center"><?php echo $v['corder_success_refill_amounts']; ?></td>
                         <td class="align-center"><?php echo $v['corder_success_refill_amounts']; ?></td>
                         <td class="align-center"><?php echo $v['corder_success_amounts']; ?></td>
                         <td class="align-center"><?php echo $v['corder_success_amounts']; ?></td>

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

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

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

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

+ 7 - 18
admin/templates/default/provider.order.stats.php

@@ -31,8 +31,6 @@
                 <li><a href="index.php?act=OrderStats&op=index&type=system"><span>平台对账记录</span></a></li>
                 <li><a href="index.php?act=OrderStats&op=index&type=system"><span>平台对账记录</span></a></li>
                 <li><a href="JavaScript:void(0);" class="current"><span>上游对账记录</span></a></li>
                 <li><a href="JavaScript:void(0);" class="current"><span>上游对账记录</span></a></li>
                 <li><a href="index.php?act=OrderStats&op=index&type=merchant"><span>下游对账记录</span></a></li>
                 <li><a href="index.php?act=OrderStats&op=index&type=merchant"><span>下游对账记录</span></a></li>
-                <li><a href="index.php?act=OrderStats&op=refill_task"><span>任务列表</span></a></li>
-                <li><a href="index.php?act=OrderStats&op=task_add"><span>任务录入</span></a></li>
             </ul>
             </ul>
         </div>
         </div>
     </div>
     </div>
@@ -48,25 +46,18 @@
             <tr>
             <tr>
                 <th><label for="query_start_time">统计时间</label></th>
                 <th><label for="query_start_time">统计时间</label></th>
                 <td>
                 <td>
-                    <label for="startTime"></label
-                    ><input class="txt date" type="text"
-                            value="<?php echo $_GET['query_start_time']; ?>"
-                            id="startTime" name="query_start_time" autocomplete="off"
-                            style="width:120px"/>
+                    <input class="txt date" type="text" value="<?php echo $_GET['query_start_time']; ?>"
+                           id="startTime" name="query_start_time" autocomplete="off" style="width:120px" />
                     <label for="query_start_time">~</label>
                     <label for="query_start_time">~</label>
-                    <label for="endTime"></label>
-                    <input class="txt date" type="text"
-                           value="<?php echo $_GET['query_end_time']; ?>"
-                           id="endTime" name="query_end_time" autocomplete="off"
-                           style="width:120px"/>
+                    <input class="txt date" type="text" value="<?php echo $_GET['query_end_time']; ?>"
+                           id="endTime" name="query_end_time" autocomplete="off" style="width:120px" />
                 </td>
                 </td>
                 <th><label>统计日期类型</label></th>
                 <th><label>统计日期类型</label></th>
                 <td>
                 <td>
-                    <label for="order_time_type"></label><select name="order_time_type" id="order_time_type">
+                    <select name="order_time_type" id="order_time_type">
                         <option value="">请选择...</option>
                         <option value="">请选择...</option>
-                        <?php foreach ($output['order_time_type_text'] as $key => $value) { ?>
-                            <option value="<?php echo $key; ?>" <?php if($_GET['order_time_type'] == $value){ echo 'selected';}?>><?php echo $value; ?></option>
-                        <?php } ?>
+                        <option value="notify_time" <?php if($_GET['order_time_type'] == 'notify_time'){ echo 'selected';}?>>回调日期</option>
+                        <option value="order_time" <?php if($_GET['order_time_type'] == 'order_time'){ echo 'selected';}?>>下单日期</option>
                     </select>
                     </select>
                 </td>
                 </td>
                 <th><label>通道名称</label></th>
                 <th><label>通道名称</label></th>
@@ -131,7 +122,6 @@
 <!--                <th class="align-center">订单总量</th>-->
 <!--                <th class="align-center">订单总量</th>-->
 <!--                <th class="align-center">失败订单数量</th>-->
 <!--                <th class="align-center">失败订单数量</th>-->
 <!--                <th class="align-center">成功占比</th>-->
 <!--                <th class="align-center">成功占比</th>-->
-                <th class="align-center">充值中数量</th>
                 <th class="align-center">上游成功单量</th>
                 <th class="align-center">上游成功单量</th>
                 <th class="align-center">上游成功面值</th>
                 <th class="align-center">上游成功面值</th>
                 <th class="align-center">上游成功扣款金额</th>
                 <th class="align-center">上游成功扣款金额</th>
@@ -160,7 +150,6 @@
 <!--                        <td class="align-center">--><?php //echo $v['order_count']; ?><!--</td>-->
 <!--                        <td class="align-center">--><?php //echo $v['order_count']; ?><!--</td>-->
 <!--                        <td class="align-center">--><?php //echo $v['cancel_count']; ?><!--</td>-->
 <!--                        <td class="align-center">--><?php //echo $v['cancel_count']; ?><!--</td>-->
 <!--                        <td class="align-center">--><?php //echo $v['success_ratio']; ?><!--</td>-->
 <!--                        <td class="align-center">--><?php //echo $v['success_ratio']; ?><!--</td>-->
-                        <td class="align-center"><?php echo $v['send_count']; ?></td>
                         <td class="align-center"><?php echo $v['corder_success_count']; ?></td>
                         <td class="align-center"><?php echo $v['corder_success_count']; ?></td>
                         <td class="align-center"><?php echo $v['corder_success_refill_amounts']; ?></td>
                         <td class="align-center"><?php echo $v['corder_success_refill_amounts']; ?></td>
                         <td class="align-center"><?php echo $v['corder_success_amounts']; ?></td>
                         <td class="align-center"><?php echo $v['corder_success_amounts']; ?></td>

+ 0 - 280
admin/templates/default/refill.task.add.php

@@ -1,280 +0,0 @@
-<?php defined('InShopNC') or exit('Access Invalid!'); ?>
-<!--//zmr>v20-->
-<style>
-    .layui-form-select .layui-input {
-        padding: 13px 5px;
-    }
-
-    .layui-form-select dl {
-        top: 29px !important;
-        min-width: 40%!important;
-    }
-    .layui-form-select .layui-edge {
-        right: 204px!important;
-    }
-
-    .layui-input {
-        width: 41%!important;
-    }
-    .layui-form-select {
-        width: 85%;
-    }
-
-    .layui-select-title {
-        width: 100%;
-    }
-    .page .fixed-bar .item-title h3 {
-        margin-top: 18px !important;
-        margin-bottom: 10px !important;
-        font-weight: 700 !important;
-    }
-
-    .tab-base li span {
-        font-size: 12px !important;
-    }
-</style>
-<div class="page">
-    <div class="fixed-bar">
-        <div class="item-title">
-            <h3>对账管理</h3>
-            <ul class="tab-base">
-                <li><a href="index.php?act=OrderStats&op=index&type=system"><span>上游对账记录</span></a></li>
-                <li><a href="index.php?act=OrderStats&op=index&type=provider"><span>上游对账记录</span></a></li>
-                <li><a href="index.php?act=OrderStats&op=index&type=merchant"><span>下游对账记录</span></a></li>
-                <li><a href="index.php?act=OrderStats&op=refill_task"><span>任务列表</span></a></li>
-                <li><a href="JavaScript:void(0);" class="current"><span>任务录入</span></a></li>
-            </ul>
-        </div>
-    </div>
-    <div class="fixed-empty"></div>
-    <form id="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="layui-form">
-                    <select name="task_type" class="layui_in" id="task_type" lay-verify="" lay-search>
-                        <option value="">请选择</option>
-                        <?php foreach ($output['task_type'] as $key => $value){?>
-                            <option value="<?php echo $key;?>"><?php echo $value;?></option>
-                        <?php }?>
-                    </select>
-                    <td class="vatop tips"></td>
-                </td>
-            </tr>
-            <tr>
-                <td colspan="2" class="required"><label class="validation">主体类型:</label></td>
-            </tr>
-            <tr class="noborder">
-                <td class="layui-form">
-                    <select name="type" class="layui_in subject" id="type" lay-verify="" lay-search lay-filter="type">
-                        <option value="">请选择</option>
-                        <?php foreach ($output['type'] as $key => $value){?>
-                        <option value="<?php echo $key;?>"><?php echo $value;?></option>
-                        <?php }?>
-                    </select>
-                </td>
-                <td class="vatop tips"></td>
-            </tr>
-            <tr>
-                <td colspan="2" class="required"><label class="validation">主体选择:</label></td>
-            </tr>
-            <tr class="noborder" >
-                <td class="layui-form">
-                    <label for="selection"></label>
-                    <select name="body" id="selection" lay-search></select>
-                </td>
-                <td class="vatop tips"></td>
-            </tr>
-            <tr>
-                <td colspan="2" class="required"><label class="validation">任务统计条件:</label></td>
-            </tr>
-            <tr class="noborder" >
-                <td style="width: 380px;" >
-                    <label for="startTime">日期区间:</label>
-                    <input style="margin-left:10px;width:120px" class="txt date" type="text"
-                           value=""
-                           id="startTime" name="query_start_time" autocomplete="off"/>
-                    <label for="endTime">~</label>
-                    <input class="txt date" type="text" value="" id="endTime"
-                           name="query_end_time" autocomplete="off" style="width:120px"/>
-                </td>
-                <td class="vatop tips"></td>
-            </tr>  
-            <tr class="noborder" >
-                <td colspan="2" class="vatop rowform">
-                    <label for="order_time_type" >日期类型:</label>
-                </td>
-            </tr>
-            <tr class="noborder">
-                <td class="layui-form">
-                    <select name="order_time_type" class="querySelect" id="order_time_type">
-                        <option value="">请选择</option>
-                        <?php foreach ($output['order_time_type'] as $key => $value) { ?>
-                            <option value="<?php echo $key; ?>"><?php echo $value; ?></option>
-                        <?php } ?>
-                    </select>
-                </td>
-                <td class="vatop tips"></td>
-            </tr>  
-            <tr class="noborder">
-                <td colspan="2" class="vatop rowform">
-                    <label for="order_state" >订单状态:</label>
-                </td>
-            </tr>
-            <tr class="noborder">
-                <td class="layui-form">
-                    <select name="order_state" class="querySelect" id="order_state">
-                        <option value=""><?php echo $lang['nc_please_choose']; ?></option>
-                        <option value="10"><?php echo $lang['order_state_new']; ?></option>
-                        <option value="20"><?php echo $lang['order_state_pay']; ?></option>
-                        <option value="30"><?php echo $lang['order_state_send']; ?></option>
-                        <option value="40"><?php echo $lang['order_state_success']; ?></option>
-                        <option value="0"><?php echo $lang['order_state_cancel']; ?></option>
-                    </select>
-                </td>
-                <td class="vatop tips"></td>
-            </tr> 
-            </tbody>
-            <tfoot>
-            <tr class="tfoot">
-                <td>
-                    <a href="JavaScript:void(0);" class="btn" id="submitBtn"><span><?php echo $lang['nc_submit']; ?></span></a>
-                </td>
-            </tr>
-            </tfoot>
-        </table>
-    </form>
-</div>
-<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/laydate/laydate.js"></script>
-<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/js/jquery-ui/jquery.ui.js"></script>
-<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/js/jquery-ui/i18n/zh-CN.js"
-        charset="utf-8"></script>
-<link rel="stylesheet" type="text/css"
-      href="<?php echo RESOURCE_SITE_URL; ?>/js/jquery-ui/themes/ui-lightness/jquery.ui.css"/>
-<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/refill/layer.js"></script>
-<script type="text/javascript" src="<?php echo ADMIN_TEMPLATES_URL; ?>/layui/layui.js"></script>
-<link rel="stylesheet" type="text/css" href="<?php echo ADMIN_TEMPLATES_URL; ?>/layui/css/layui.css"/>
-
-<script type="text/javascript">
-    var ji = null;
-    $(function () {
-        $("#voucher").change(function () {
-            $("#textfield1").val($(this).val());
-        });
-        $("#submitBtn").click(function () {
-            if ($("#points_form").valid()) {
-                $("#points_form").submit();
-            }
-        });
-        //主体选择
-        layui.use(['form'], function () {
-            let form = layui.form;
-            form.on('select(type)', function (data) {
-                let form_type = data.value;
-                    form.render('select')
-                    if (form_type === 'merchant') {
-                    $.get('index.php?act=refill_order&op=merchant_data', function(res) {
-                        res = JSON.parse(res) 
-                        let html = '';
-                        res.forEach(item => {
-                        html += `<option value="${item.value}-${item.name}">${item.name}</option>`;
-                        })
-                        let select_type = `<select>${html}</select>`
-                        $('#selection').html(select_type);
-                        form.render('select')
-                    })
-                } else if (form_type === 'provider'){
-                    $.get('index.php?act=refill_order&op=provider_data', function(res) {
-                        res = JSON.parse(res) 
-                        let html = '';
-                        res.forEach(item => {
-                        html += `<option value="${item.value}-${item.name}">${item.name}</option>`;
-                        })
-                        let select_type = `<select>${html}</select>`
-                        $('#selection').html(select_type);
-                        form.render('select')
-                    })
-                } else {
-                        $('#selection').html('');
-                        form.render('select')
-                }
-            })
-        })
-        $('#points_form').validate({
-            errorPlacement: function (error, element) {
-                error.appendTo(element.parent().parent().prev().find('td:first'));
-            },
-            rules: {
-                type: {
-                    required: true
-                },
-                order_time_type: {
-                    required: true
-                },
-                body: {
-                    required: true
-                },
-                task_type: {
-                    required: true
-                },
-                query_start_time: {
-                    required: true
-                }
-            },
-            messages: {
-                type: {
-                    required: '未选择主体类型'
-                },
-                order_time_type: {
-                    required: '日期类型未选择'
-                },
-                body: {
-                    required: '未选择统计主体'
-                },
-                task_type: {
-                    required: '未选择任务类型'
-                },
-                query_start_time: {
-                    required: '未选择日期区间'
-                }
-            }
-        });
-            // 日期选择器
-        $('#query_start_time').datepicker({dateFormat: 'yy-mm-dd'});
-        $('#query_end_time').datepicker({dateFormat: 'yy-mm-dd'});
-        let start_a = laydate.render({
-            elem: '#startTime',
-            type: 'datetime',
-            trigger: 'click',
-            done: function (value, date, endDate) {
-                end.config.min = {
-                    year: date.year,
-                    month: date.month - 1,
-                    date: date.date,
-                }; 
-                end.config.value = {
-                    year: date.year,
-                    month: date.month - 1,
-                    date: date.date,
-                }; 
-            }
-        });
-        let end = laydate.render({
-            elem: '#endTime',
-            type: 'datetime',
-            trigger: 'click',
-            done: function (value, date, endDate) {
-                start_a.config.max = {
-                    year: date.year,
-                    month: date.month - 1,
-                    date: date.date,
-                }; 
-            }
-        });
-    })
-</script>

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

@@ -17,8 +17,6 @@
                 <li><a href="JavaScript:void(0);" class="current"><span>平台对账记录</span></a></li>
                 <li><a href="JavaScript:void(0);" class="current"><span>平台对账记录</span></a></li>
                 <li><a href="index.php?act=OrderStats&op=index&type=provider"><span>上游对账记录</span></a></li>
                 <li><a href="index.php?act=OrderStats&op=index&type=provider"><span>上游对账记录</span></a></li>
                 <li><a href="index.php?act=OrderStats&op=index&type=merchant"><span>下游对账记录</span></a></li>
                 <li><a href="index.php?act=OrderStats&op=index&type=merchant"><span>下游对账记录</span></a></li>
-                <li><a href="index.php?act=OrderStats&op=refill_task"><span>任务列表</span></a></li>
-                <li><a href="index.php?act=OrderStats&op=task_add"><span>任务录入</span></a></li>
             </ul>
             </ul>
         </div>
         </div>
     </div>
     </div>
@@ -31,25 +29,18 @@
             <tr>
             <tr>
                 <th><label for="query_start_time">统计时间</label></th>
                 <th><label for="query_start_time">统计时间</label></th>
                 <td>
                 <td>
-                    <label for="startTime"></label>
-                    <input class="txt date" type="text"
-                           value="<?php echo $_GET['query_start_time']; ?>"
-                           id="startTime" name="query_start_time" autocomplete="off"
-                           style="width:120px"/>
+                    <input class="txt date" type="text" value="<?php echo $_GET['query_start_time']; ?>"
+                           id="startTime" name="query_start_time" autocomplete="off" style="width:120px" />
                     <label for="query_start_time">~</label>
                     <label for="query_start_time">~</label>
-                    <label for="endTime"></label>
-                    <input class="txt date" type="text"
-                           value="<?php echo $_GET['query_end_time']; ?>"
-                           id="endTime" name="query_end_time" autocomplete="off"
-                           style="width:120px"/></td>
+                    <input class="txt date" type="text" value="<?php echo $_GET['query_end_time']; ?>"
+                           id="endTime" name="query_end_time" autocomplete="off" style="width:120px" /></td>
                 <td>
                 <td>
                 <th><label>统计日期类型</label></th>
                 <th><label>统计日期类型</label></th>
                 <td>
                 <td>
                     <select name="order_time_type" id="order_time_type">
                     <select name="order_time_type" id="order_time_type">
                         <option value="">请选择...</option>
                         <option value="">请选择...</option>
-                        <?php foreach ($output['order_time_type_text'] as $key => $value) { ?>
-                            <option value="<?php echo $key; ?>" <?php if($_GET['order_time_type'] == $value){ echo 'selected';}?>><?php echo $value; ?></option>
-                        <?php } ?>
+                        <option value="notify_time" <?php if($_GET['order_time_type'] == 'notify_time'){ echo 'selected';}?>>回调日期</option>
+                        <option value="order_time" <?php if($_GET['order_time_type'] == 'order_time'){ echo 'selected';}?>>下单日期</option>
                     </select>
                     </select>
                 </td>
                 </td>
                 </td>
                 </td>

+ 2 - 0
crontab/control/minutes.php

@@ -32,6 +32,8 @@ class minutesControl extends BaseCronControl
         $this->_cron_common([1,2,3,4,5,6,7]);
         $this->_cron_common([1,2,3,4,5,6,7]);
         $this->_fetch_order_unavaliable();
         $this->_fetch_order_unavaliable();
         $this->_check_merchant_alarm_amount();
         $this->_check_merchant_alarm_amount();
+
+//        $this->_refill_task();
         Log::record(__FUNCTION__ . " end",Log::DEBUG);
         Log::record(__FUNCTION__ . " end",Log::DEBUG);
 
 
 //        $this->_web_index_update();
 //        $this->_web_index_update();

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

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

+ 77 - 51
data/config/win/refill.ini.php

@@ -1471,42 +1471,42 @@ $lingzhman48_phone = ['name' => 'lingzhman48', 'store_id' => 76, 'qualitys' => '
 $cangbu_phone = ['name' => 'cangbu', 'store_id' => 78,'qualitys' => '1',
 $cangbu_phone = ['name' => 'cangbu', 'store_id' => 78,'qualitys' => '1',
     'amount' => [
     'amount' => [
         10 => [
         10 => [
-            ['goods_id' => 6744, 'price' => 9.54, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6744, 'price' => 9.57, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6744, 'price' => 9.45, 'quality' => 1, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6744, 'price' => 9.45, 'quality' => 1, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6744, 'price' => 9.5, 'quality' => 1, 'card_type' => 'chinatelecom']
             ['goods_id' => 6744, 'price' => 9.5, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         ],
         20 => [
         20 => [
-            ['goods_id' => 6745, 'price' => 19.08, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6745, 'price' => 19.14, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6745, 'price' => 18.9, 'quality' => 1, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6745, 'price' => 18.9, 'quality' => 1, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6745, 'price' => 19, 'quality' => 1, 'card_type' => 'chinatelecom']
             ['goods_id' => 6745, 'price' => 19, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         ],
         30 => [
         30 => [
-            ['goods_id' => 6746, 'price' => 28.62, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6746, 'price' => 28.71, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6746, 'price' => 28.35, 'quality' => 1, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6746, 'price' => 28.35, 'quality' => 1, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6746, 'price' => 28.5, 'quality' => 1, 'card_type' => 'chinatelecom']
             ['goods_id' => 6746, 'price' => 28.5, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         ],
         50 => [
         50 => [
-            ['goods_id' => 6747, 'price' => 48, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6747, 'price' => 47.85, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6747, 'price' => 47.25, 'quality' => 1, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6747, 'price' => 47.25, 'quality' => 1, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6747, 'price' => 47.5, 'quality' => 1, 'card_type' => 'chinatelecom']
             ['goods_id' => 6747, 'price' => 47.5, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         ],
         100 => [
         100 => [
-            ['goods_id' => 6748, 'price' => 96, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6748, 'price' => 95.7, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6748, 'price' => 94.5, 'quality' => 1, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6748, 'price' => 94.5, 'quality' => 1, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6748, 'price' => 95, 'quality' => 1, 'card_type' => 'chinatelecom']
             ['goods_id' => 6748, 'price' => 95, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         ],
         200 => [
         200 => [
-            ['goods_id' => 6749, 'price' => 192, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6749, 'price' => 191.4, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6749, 'price' => 189, 'quality' => 1, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6749, 'price' => 189, 'quality' => 1, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6749, 'price' => 190, 'quality' => 1, 'card_type' => 'chinatelecom']
             ['goods_id' => 6749, 'price' => 190, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         ],
         300 => [
         300 => [
-            ['goods_id' => 6750, 'price' => 288, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6750, 'price' => 287.1, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6750, 'price' => 283.5, 'quality' => 1, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6750, 'price' => 283.5, 'quality' => 1, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6750, 'price' => 285, 'quality' => 1, 'card_type' => 'chinatelecom']
             ['goods_id' => 6750, 'price' => 285, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         ],
         500 => [
         500 => [
-            ['goods_id' => 6751, 'price' => 480, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6751, 'price' => 478.5, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6751, 'price' => 472.5, 'quality' => 1, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6751, 'price' => 472.5, 'quality' => 1, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6751, 'price' => 475, 'quality' => 1, 'card_type' => 'chinatelecom']
             ['goods_id' => 6751, 'price' => 475, 'quality' => 1, 'card_type' => 'chinatelecom']
         ]
         ]
@@ -1850,14 +1850,34 @@ $lechong_phone = ['name' => 'lechong', 'store_id' => 99, 'qualitys' => '1',
 
 
 $xinhengyang_phone = ['name' => 'xinhengyang', 'store_id' => 100, 'qualitys' => '1',
 $xinhengyang_phone = ['name' => 'xinhengyang', 'store_id' => 100, 'qualitys' => '1',
     'amount' => [
     'amount' => [
-        10 => [['goods_id' => 6893, 'price' => 9.56, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        20 => [['goods_id' => 6894, 'price' => 19.12, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        30 => [['goods_id' => 6895, 'price' => 28.68, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        50 => [['goods_id' => 6896, 'price' => 47.8, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        100 => [['goods_id' => 6897, 'price' => 95.6, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        200 => [['goods_id' => 6898, 'price' => 191.2, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        300 => [['goods_id' => 6899, 'price' => 286.8, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        500 => [['goods_id' => 6900, 'price' => 478, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']]
+//        10 => [['goods_id' => 6893, 'price' => 9.56, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+//        20 => [['goods_id' => 6894, 'price' => 19.12, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        30 => [
+            ['goods_id' => 6895, 'price' => 28.62, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6895, 'price' => 28.59, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 6895, 'price' => 28.62, 'quality' => 1, 'card_type' => 'chinatelecom']
+        ],
+        50 => [
+            ['goods_id' => 6896, 'price' => 47.7, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6896, 'price' => 47.65, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 6896, 'price' => 47.7, 'quality' => 1, 'card_type' => 'chinatelecom']
+        ],
+        100 => [
+            ['goods_id' => 6897, 'price' => 95.4, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6897, 'price' => 95.3, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 6897, 'price' => 95.4, 'quality' => 1, 'card_type' => 'chinatelecom']
+        ],
+        200 => [
+            ['goods_id' => 6898, 'price' => 190.8, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6898, 'price' => 190.6, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 6898, 'price' => 190.8, 'quality' => 1, 'card_type' => 'chinatelecom']
+        ],
+        300 => [
+            ['goods_id' => 6899, 'price' => 286.2, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6899, 'price' => 285.9, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 6899, 'price' => 286.2, 'quality' => 1, 'card_type' => 'chinatelecom']
+        ],
+//        500 => [['goods_id' => 6900, 'price' => 478, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']]
     ],
     ],
     'official_sn' => true, 'refill_type' => 'api'];
     'official_sn' => true, 'refill_type' => 'api'];
 
 
@@ -1880,27 +1900,27 @@ $miaoxt_phone = ['name' => 'miaoxt', 'store_id' => 101, 'qualitys' => '2',
         ],
         ],
         50 => [
         50 => [
             ['goods_id' => 6904, 'price' => 50.1, 'quality' => 2, 'card_type' => 'chinamobile'],
             ['goods_id' => 6904, 'price' => 50.1, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6904, 'price' => 50, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 6904, 'price' => 50.2, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6904, 'price' => 50.1, 'quality' => 2, 'card_type' => 'chinatelecom']
             ['goods_id' => 6904, 'price' => 50.1, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         ],
         100 => [
         100 => [
             ['goods_id' => 6905, 'price' => 100.2, 'quality' => 2, 'card_type' => 'chinamobile'],
             ['goods_id' => 6905, 'price' => 100.2, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6905, 'price' => 100, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 6905, 'price' => 100.1, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6905, 'price' => 100.2, 'quality' => 2, 'card_type' => 'chinatelecom']
             ['goods_id' => 6905, 'price' => 100.2, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         ],
         200 => [
         200 => [
             ['goods_id' => 6906, 'price' => 200.4, 'quality' => 2, 'card_type' => 'chinamobile'],
             ['goods_id' => 6906, 'price' => 200.4, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6906, 'price' => 200, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 6906, 'price' => 200.2, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6906, 'price' => 200.4, 'quality' => 2, 'card_type' => 'chinatelecom']
             ['goods_id' => 6906, 'price' => 200.4, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         ],
         300 => [
         300 => [
             ['goods_id' => 6907, 'price' => 300.6, 'quality' => 2, 'card_type' => 'chinamobile'],
             ['goods_id' => 6907, 'price' => 300.6, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6907, 'price' => 300, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 6907, 'price' => 300.3, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6907, 'price' => 300.6, 'quality' => 2, 'card_type' => 'chinatelecom']
             ['goods_id' => 6907, 'price' => 300.6, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         ],
         500 => [
         500 => [
             ['goods_id' => 6908, 'price' => 501, 'quality' => 2, 'card_type' => 'chinamobile'],
             ['goods_id' => 6908, 'price' => 501, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6908, 'price' => 500, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 6908, 'price' => 500.5, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6908, 'price' => 501, 'quality' => 2, 'card_type' => 'chinatelecom']
             ['goods_id' => 6908, 'price' => 501, 'quality' => 2, 'card_type' => 'chinatelecom']
         ]
         ]
     ],
     ],
@@ -1921,14 +1941,14 @@ $tianyan_phone = ['name' => 'tianyan', 'store_id' => 102, 'qualitys' => '1',
 
 
 $yunsuoyaoman_phone = ['name' => 'yunsuoyaoman', 'store_id' => 110,'qualitys' => '5',
 $yunsuoyaoman_phone = ['name' => 'yunsuoyaoman', 'store_id' => 110,'qualitys' => '5',
     'amount' => [
     'amount' => [
-        10 => [['goods_id' => 6970, 'price' => 9.16, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        20 => [['goods_id' => 6971, 'price' => 18.32, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        30 => [['goods_id' => 6972, 'price' => 27.48, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        50 => [['goods_id' => 6973, 'price' => 45.8, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        100 => [['goods_id' => 6974, 'price' => 91.6, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        200 => [['goods_id' => 6975, 'price' => 183.2, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        300 => [['goods_id' => 6976, 'price' => 274.8, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        500 => [['goods_id' => 6977, 'price' => 458, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']]
+        10 => [['goods_id' => 6970, 'price' => 9.22, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        20 => [['goods_id' => 6971, 'price' => 18.44, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        30 => [['goods_id' => 6972, 'price' => 27.66, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        50 => [['goods_id' => 6973, 'price' => 46.1, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        100 => [['goods_id' => 6974, 'price' => 92.2, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        200 => [['goods_id' => 6975, 'price' => 184.4, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        300 => [['goods_id' => 6976, 'price' => 276.5, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        500 => [['goods_id' => 6977, 'price' => 461, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']]
     ],
     ],
     'official_sn' => true, 'refill_type' => 'api'];
     'official_sn' => true, 'refill_type' => 'api'];
 
 
@@ -2401,17 +2421,17 @@ $guochuang_nation_phone = ['name' => 'guochuang_nation', 'store_id' => 121, 'qua
         ],
         ],
 
 
         10 => [
         10 => [
-            ['goods_id' => 7060, 'price' => 10.21, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 7060, 'price' => 10.24, 'quality' => 2, 'card_type' => 'chinamobile'],
             ['goods_id' => 7060, 'price' => 10.07, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7060, 'price' => 10.07, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7060, 'price' => 10.21, 'quality' => 2, 'card_type' => 'chinatelecom']
             ['goods_id' => 7060, 'price' => 10.21, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         ],
         20 => [
         20 => [
-            ['goods_id' => 7061, 'price' => 20.22, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 7061, 'price' => 20.09, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7061, 'price' => 20.48, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 7061, 'price' => 20.52, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7061, 'price' => 20.22, 'quality' => 2, 'card_type' => 'chinatelecom']
             ['goods_id' => 7061, 'price' => 20.22, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         ],
         30 => [
         30 => [
-            ['goods_id' => 7062, 'price' => 30.12, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 7062, 'price' => 30.21, 'quality' => 2, 'card_type' => 'chinamobile'],
             ['goods_id' => 7062, 'price' => 30.135, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7062, 'price' => 30.135, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7062, 'price' => 30.39, 'quality' => 2, 'card_type' => 'chinatelecom']
             ['goods_id' => 7062, 'price' => 30.39, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         ],
@@ -2480,14 +2500,14 @@ $shimier_phone = ['name' => 'shimier', 'store_id' => 123,'qualitys' => '1',
 
 
 $zhongst_mix_phone = ['name' => 'zhongst_mix', 'store_id' => 124, 'qualitys' => '2',
 $zhongst_mix_phone = ['name' => 'zhongst_mix', 'store_id' => 124, 'qualitys' => '2',
     'amount' => [
     'amount' => [
-        10 => [['goods_id' => 7084, 'price' => 9.95, 'quality' => 2, 'card_type' => 'chinamobile']],
-        20 => [['goods_id' => 7085, 'price' => 19.9, 'quality' => 2, 'card_type' => 'chinamobile']],
-        30 => [['goods_id' => 7086, 'price' => 29.85, 'quality' => 2, 'card_type' => 'chinamobile']],
-        50 => [['goods_id' => 7087, 'price' => 49.75, 'quality' => 2, 'card_type' => 'chinamobile']],
-        100 => [['goods_id' => 7088, 'price' => 99.5, 'quality' => 2, 'card_type' => 'chinamobile']],
-        200 => [['goods_id' => 7089, 'price' => 199, 'quality' => 2, 'card_type' => 'chinamobile']],
-        300 => [['goods_id' => 7090, 'price' => 298.5, 'quality' => 2, 'card_type' => 'chinamobile']],
-        500 => [['goods_id' => 7091, 'price' => 497.5, 'quality' => 2, 'card_type' => 'chinamobile']]
+        10 => [['goods_id' => 7084, 'price' => 9.93, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        20 => [['goods_id' => 7085, 'price' => 19.86, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        30 => [['goods_id' => 7086, 'price' => 29.79, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        50 => [['goods_id' => 7087, 'price' => 49.65, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        100 => [['goods_id' => 7088, 'price' => 99.3, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        200 => [['goods_id' => 7089, 'price' => 198.6, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        300 => [['goods_id' => 7090, 'price' => 297.9, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        500 => [['goods_id' => 7091, 'price' => 496.5, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']]
     ],
     ],
     'official_sn' => true, 'refill_type' => 'api'];
     'official_sn' => true, 'refill_type' => 'api'];
 
 
@@ -2544,35 +2564,35 @@ $hangtong_phone = ['name' => 'hangtong', 'store_id' => 126,'qualitys' => '1',
 $dashang_phone = ['name' => 'dashang', 'store_id' => 127, 'qualitys' => '2',
 $dashang_phone = ['name' => 'dashang', 'store_id' => 127, 'qualitys' => '2',
     'amount' => [
     'amount' => [
         10 => [
         10 => [
-            ['goods_id' => 7108, 'price' => 9.98, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7108, 'price' => 9.99, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7108, 'price' => 9.98, 'quality' => 2, 'card_type' => 'chinatelecom']
             ['goods_id' => 7108, 'price' => 9.98, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         ],
         20 => [
         20 => [
-            ['goods_id' => 7109, 'price' => 19.96, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7109, 'price' => 19.98, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7109, 'price' => 19.96, 'quality' => 2, 'card_type' => 'chinatelecom']
             ['goods_id' => 7109, 'price' => 19.96, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         ],
         30 => [
         30 => [
-            ['goods_id' => 7110, 'price' => 29.94, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7110, 'price' => 29.97, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7110, 'price' => 29.94, 'quality' => 2, 'card_type' => 'chinatelecom']
             ['goods_id' => 7110, 'price' => 29.94, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         ],
         50 => [
         50 => [
-            ['goods_id' => 7111, 'price' => 49.9, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7111, 'price' => 49.875, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7111, 'price' => 49.9, 'quality' => 2, 'card_type' => 'chinatelecom']
             ['goods_id' => 7111, 'price' => 49.9, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         ],
         100 => [
         100 => [
-            ['goods_id' => 7112, 'price' => 99.8, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7112, 'price' => 99.75, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7112, 'price' => 99.8, 'quality' => 2, 'card_type' => 'chinatelecom']
             ['goods_id' => 7112, 'price' => 99.8, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         ],
         200 => [
         200 => [
-            ['goods_id' => 7113, 'price' => 199.6, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7113, 'price' => 199.5, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7113, 'price' => 199.6, 'quality' => 2, 'card_type' => 'chinatelecom']
             ['goods_id' => 7113, 'price' => 199.6, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         ],
         300 => [
         300 => [
-            ['goods_id' => 7114, 'price' => 299.4, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7114, 'price' => 299.25, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7114, 'price' => 299.4, 'quality' => 2, 'card_type' => 'chinatelecom']
             ['goods_id' => 7114, 'price' => 299.4, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         ],
         500 => [
         500 => [
-            ['goods_id' => 7115, 'price' => 499, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7115, 'price' => 498.75, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7115, 'price' => 499, 'quality' => 2, 'card_type' => 'chinatelecom']
             ['goods_id' => 7115, 'price' => 499, 'quality' => 2, 'card_type' => 'chinatelecom']
         ]
         ]
     ],
     ],
@@ -3036,7 +3056,7 @@ $config['merchant_retry_times'] = [
         'qualities' => [1 => ['secs' => 1200, 'times' => 100], 2 => ['secs' => 100, 'times' => 5]],
         'qualities' => [1 => ['secs' => 1200, 'times' => 100], 2 => ['secs' => 100, 'times' => 5]],
         'lower_ratio' => ['ratio' => 0.9, 'period' => 3600], 'profit_ratio' => 0.003],
         'lower_ratio' => ['ratio' => 0.9, 'period' => 3600], 'profit_ratio' => 0.003],
     10216 => [ //飘逸-10分
     10216 => [ //飘逸-10分
-        'qualities' => [1 => ['secs' => 630, 'times' => 100], 2 => ['secs' => 70, 'times' => 5]],
+        'qualities' => [1 => ['secs' => 530, 'times' => 100], 2 => ['secs' => 70, 'times' => 5]],
         'lower_ratio' => ['ratio' => 0.4, 'period' => 3600], 'profit_ratio' => 0.015],
         'lower_ratio' => ['ratio' => 0.4, 'period' => 3600], 'profit_ratio' => 0.015],
     10217 => [ //天采-混充50m
     10217 => [ //天采-混充50m
         'qualities' => [1 => ['secs' => 2400, 'times' => 200], 2 => ['secs' => 600, 'times' => 20]],
         'qualities' => [1 => ['secs' => 2400, 'times' => 200], 2 => ['secs' => 600, 'times' => 20]],
@@ -3044,7 +3064,13 @@ $config['merchant_retry_times'] = [
 
 
     10231 => [ //汇通-普充2号
     10231 => [ //汇通-普充2号
         'qualities' => [1 => ['secs' => 1000, 'times' => 200], 2 => ['secs' => 200, 'times' => 20]],
         'qualities' => [1 => ['secs' => 1000, 'times' => 200], 2 => ['secs' => 200, 'times' => 20]],
-        'lower_ratio' => ['ratio' => 0.6, 'period' => 3600], 'profit_ratio' => 0.003]
+        'lower_ratio' => ['ratio' => 0.6, 'period' => 3600], 'profit_ratio' => 0.003],
+    10233 => [ //瑾相联-10分
+        'qualities' => [1 => ['secs' => 630, 'times' => 100], 2 => ['secs' => 70, 'times' => 5]],
+        'lower_ratio' => ['ratio' => 0.4, 'period' => 3600], 'profit_ratio' => 0.015],
+    10236 => [ //邀友補充-05號通道
+        'qualities' => [1 => ['secs' => 3300, 'times' => 1000], 2 => ['secs' => 300, 'times' => 5]],
+        'lower_ratio' => ['ratio' => 0.99, 'period' => 3600], 'profit_ratio' => 0.015],
 ];
 ];
 
 
 //// "status": 1 //状态 0:空号;1:实号;2:停机;3:库无;4:沉默号;5:风险号
 //// "status": 1 //状态 0:空号;1:实号;2:停机;3:库无;4:沉默号;5:风险号

+ 77 - 51
data/config/xyz/refill.ini.php

@@ -1471,42 +1471,42 @@ $lingzhman48_phone = ['name' => 'lingzhman48', 'store_id' => 76, 'qualitys' => '
 $cangbu_phone = ['name' => 'cangbu', 'store_id' => 78,'qualitys' => '1',
 $cangbu_phone = ['name' => 'cangbu', 'store_id' => 78,'qualitys' => '1',
     'amount' => [
     'amount' => [
         10 => [
         10 => [
-            ['goods_id' => 6744, 'price' => 9.54, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6744, 'price' => 9.57, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6744, 'price' => 9.45, 'quality' => 1, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6744, 'price' => 9.45, 'quality' => 1, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6744, 'price' => 9.5, 'quality' => 1, 'card_type' => 'chinatelecom']
             ['goods_id' => 6744, 'price' => 9.5, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         ],
         20 => [
         20 => [
-            ['goods_id' => 6745, 'price' => 19.08, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6745, 'price' => 19.14, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6745, 'price' => 18.9, 'quality' => 1, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6745, 'price' => 18.9, 'quality' => 1, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6745, 'price' => 19, 'quality' => 1, 'card_type' => 'chinatelecom']
             ['goods_id' => 6745, 'price' => 19, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         ],
         30 => [
         30 => [
-            ['goods_id' => 6746, 'price' => 28.62, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6746, 'price' => 28.71, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6746, 'price' => 28.35, 'quality' => 1, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6746, 'price' => 28.35, 'quality' => 1, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6746, 'price' => 28.5, 'quality' => 1, 'card_type' => 'chinatelecom']
             ['goods_id' => 6746, 'price' => 28.5, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         ],
         50 => [
         50 => [
-            ['goods_id' => 6747, 'price' => 48, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6747, 'price' => 47.85, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6747, 'price' => 47.25, 'quality' => 1, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6747, 'price' => 47.25, 'quality' => 1, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6747, 'price' => 47.5, 'quality' => 1, 'card_type' => 'chinatelecom']
             ['goods_id' => 6747, 'price' => 47.5, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         ],
         100 => [
         100 => [
-            ['goods_id' => 6748, 'price' => 96, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6748, 'price' => 95.7, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6748, 'price' => 94.5, 'quality' => 1, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6748, 'price' => 94.5, 'quality' => 1, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6748, 'price' => 95, 'quality' => 1, 'card_type' => 'chinatelecom']
             ['goods_id' => 6748, 'price' => 95, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         ],
         200 => [
         200 => [
-            ['goods_id' => 6749, 'price' => 192, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6749, 'price' => 191.4, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6749, 'price' => 189, 'quality' => 1, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6749, 'price' => 189, 'quality' => 1, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6749, 'price' => 190, 'quality' => 1, 'card_type' => 'chinatelecom']
             ['goods_id' => 6749, 'price' => 190, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         ],
         300 => [
         300 => [
-            ['goods_id' => 6750, 'price' => 288, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6750, 'price' => 287.1, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6750, 'price' => 283.5, 'quality' => 1, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6750, 'price' => 283.5, 'quality' => 1, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6750, 'price' => 285, 'quality' => 1, 'card_type' => 'chinatelecom']
             ['goods_id' => 6750, 'price' => 285, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         ],
         500 => [
         500 => [
-            ['goods_id' => 6751, 'price' => 480, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6751, 'price' => 478.5, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6751, 'price' => 472.5, 'quality' => 1, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6751, 'price' => 472.5, 'quality' => 1, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6751, 'price' => 475, 'quality' => 1, 'card_type' => 'chinatelecom']
             ['goods_id' => 6751, 'price' => 475, 'quality' => 1, 'card_type' => 'chinatelecom']
         ]
         ]
@@ -1850,14 +1850,34 @@ $lechong_phone = ['name' => 'lechong', 'store_id' => 99, 'qualitys' => '1',
 
 
 $xinhengyang_phone = ['name' => 'xinhengyang', 'store_id' => 100, 'qualitys' => '1',
 $xinhengyang_phone = ['name' => 'xinhengyang', 'store_id' => 100, 'qualitys' => '1',
     'amount' => [
     'amount' => [
-        10 => [['goods_id' => 6893, 'price' => 9.56, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        20 => [['goods_id' => 6894, 'price' => 19.12, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        30 => [['goods_id' => 6895, 'price' => 28.68, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        50 => [['goods_id' => 6896, 'price' => 47.8, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        100 => [['goods_id' => 6897, 'price' => 95.6, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        200 => [['goods_id' => 6898, 'price' => 191.2, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        300 => [['goods_id' => 6899, 'price' => 286.8, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        500 => [['goods_id' => 6900, 'price' => 478, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']]
+//        10 => [['goods_id' => 6893, 'price' => 9.56, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+//        20 => [['goods_id' => 6894, 'price' => 19.12, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        30 => [
+            ['goods_id' => 6895, 'price' => 28.62, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6895, 'price' => 28.59, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 6895, 'price' => 28.62, 'quality' => 1, 'card_type' => 'chinatelecom']
+        ],
+        50 => [
+            ['goods_id' => 6896, 'price' => 47.7, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6896, 'price' => 47.65, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 6896, 'price' => 47.7, 'quality' => 1, 'card_type' => 'chinatelecom']
+        ],
+        100 => [
+            ['goods_id' => 6897, 'price' => 95.4, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6897, 'price' => 95.3, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 6897, 'price' => 95.4, 'quality' => 1, 'card_type' => 'chinatelecom']
+        ],
+        200 => [
+            ['goods_id' => 6898, 'price' => 190.8, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6898, 'price' => 190.6, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 6898, 'price' => 190.8, 'quality' => 1, 'card_type' => 'chinatelecom']
+        ],
+        300 => [
+            ['goods_id' => 6899, 'price' => 286.2, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6899, 'price' => 285.9, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 6899, 'price' => 286.2, 'quality' => 1, 'card_type' => 'chinatelecom']
+        ],
+//        500 => [['goods_id' => 6900, 'price' => 478, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']]
     ],
     ],
     'official_sn' => true, 'refill_type' => 'api'];
     'official_sn' => true, 'refill_type' => 'api'];
 
 
@@ -1880,27 +1900,27 @@ $miaoxt_phone = ['name' => 'miaoxt', 'store_id' => 101, 'qualitys' => '2',
         ],
         ],
         50 => [
         50 => [
             ['goods_id' => 6904, 'price' => 50.1, 'quality' => 2, 'card_type' => 'chinamobile'],
             ['goods_id' => 6904, 'price' => 50.1, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6904, 'price' => 50, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 6904, 'price' => 50.2, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6904, 'price' => 50.1, 'quality' => 2, 'card_type' => 'chinatelecom']
             ['goods_id' => 6904, 'price' => 50.1, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         ],
         100 => [
         100 => [
             ['goods_id' => 6905, 'price' => 100.2, 'quality' => 2, 'card_type' => 'chinamobile'],
             ['goods_id' => 6905, 'price' => 100.2, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6905, 'price' => 100, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 6905, 'price' => 100.1, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6905, 'price' => 100.2, 'quality' => 2, 'card_type' => 'chinatelecom']
             ['goods_id' => 6905, 'price' => 100.2, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         ],
         200 => [
         200 => [
             ['goods_id' => 6906, 'price' => 200.4, 'quality' => 2, 'card_type' => 'chinamobile'],
             ['goods_id' => 6906, 'price' => 200.4, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6906, 'price' => 200, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 6906, 'price' => 200.2, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6906, 'price' => 200.4, 'quality' => 2, 'card_type' => 'chinatelecom']
             ['goods_id' => 6906, 'price' => 200.4, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         ],
         300 => [
         300 => [
             ['goods_id' => 6907, 'price' => 300.6, 'quality' => 2, 'card_type' => 'chinamobile'],
             ['goods_id' => 6907, 'price' => 300.6, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6907, 'price' => 300, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 6907, 'price' => 300.3, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6907, 'price' => 300.6, 'quality' => 2, 'card_type' => 'chinatelecom']
             ['goods_id' => 6907, 'price' => 300.6, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         ],
         500 => [
         500 => [
             ['goods_id' => 6908, 'price' => 501, 'quality' => 2, 'card_type' => 'chinamobile'],
             ['goods_id' => 6908, 'price' => 501, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6908, 'price' => 500, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 6908, 'price' => 500.5, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6908, 'price' => 501, 'quality' => 2, 'card_type' => 'chinatelecom']
             ['goods_id' => 6908, 'price' => 501, 'quality' => 2, 'card_type' => 'chinatelecom']
         ]
         ]
     ],
     ],
@@ -1921,14 +1941,14 @@ $tianyan_phone = ['name' => 'tianyan', 'store_id' => 102, 'qualitys' => '1',
 
 
 $yunsuoyaoman_phone = ['name' => 'yunsuoyaoman', 'store_id' => 110,'qualitys' => '5',
 $yunsuoyaoman_phone = ['name' => 'yunsuoyaoman', 'store_id' => 110,'qualitys' => '5',
     'amount' => [
     'amount' => [
-        10 => [['goods_id' => 6970, 'price' => 9.16, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        20 => [['goods_id' => 6971, 'price' => 18.32, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        30 => [['goods_id' => 6972, 'price' => 27.48, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        50 => [['goods_id' => 6973, 'price' => 45.8, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        100 => [['goods_id' => 6974, 'price' => 91.6, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        200 => [['goods_id' => 6975, 'price' => 183.2, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        300 => [['goods_id' => 6976, 'price' => 274.8, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        500 => [['goods_id' => 6977, 'price' => 458, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']]
+        10 => [['goods_id' => 6970, 'price' => 9.22, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        20 => [['goods_id' => 6971, 'price' => 18.44, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        30 => [['goods_id' => 6972, 'price' => 27.66, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        50 => [['goods_id' => 6973, 'price' => 46.1, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        100 => [['goods_id' => 6974, 'price' => 92.2, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        200 => [['goods_id' => 6975, 'price' => 184.4, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        300 => [['goods_id' => 6976, 'price' => 276.5, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        500 => [['goods_id' => 6977, 'price' => 461, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']]
     ],
     ],
     'official_sn' => true, 'refill_type' => 'api'];
     'official_sn' => true, 'refill_type' => 'api'];
 
 
@@ -2401,17 +2421,17 @@ $guochuang_nation_phone = ['name' => 'guochuang_nation', 'store_id' => 121, 'qua
         ],
         ],
 
 
         10 => [
         10 => [
-            ['goods_id' => 7060, 'price' => 10.21, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 7060, 'price' => 10.24, 'quality' => 2, 'card_type' => 'chinamobile'],
             ['goods_id' => 7060, 'price' => 10.07, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7060, 'price' => 10.07, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7060, 'price' => 10.21, 'quality' => 2, 'card_type' => 'chinatelecom']
             ['goods_id' => 7060, 'price' => 10.21, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         ],
         20 => [
         20 => [
-            ['goods_id' => 7061, 'price' => 20.22, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 7061, 'price' => 20.09, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7061, 'price' => 20.48, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 7061, 'price' => 20.52, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7061, 'price' => 20.22, 'quality' => 2, 'card_type' => 'chinatelecom']
             ['goods_id' => 7061, 'price' => 20.22, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         ],
         30 => [
         30 => [
-            ['goods_id' => 7062, 'price' => 30.12, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 7062, 'price' => 30.21, 'quality' => 2, 'card_type' => 'chinamobile'],
             ['goods_id' => 7062, 'price' => 30.135, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7062, 'price' => 30.135, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7062, 'price' => 30.39, 'quality' => 2, 'card_type' => 'chinatelecom']
             ['goods_id' => 7062, 'price' => 30.39, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         ],
@@ -2480,14 +2500,14 @@ $shimier_phone = ['name' => 'shimier', 'store_id' => 123,'qualitys' => '1',
 
 
 $zhongst_mix_phone = ['name' => 'zhongst_mix', 'store_id' => 124, 'qualitys' => '2',
 $zhongst_mix_phone = ['name' => 'zhongst_mix', 'store_id' => 124, 'qualitys' => '2',
     'amount' => [
     'amount' => [
-        10 => [['goods_id' => 7084, 'price' => 9.95, 'quality' => 2, 'card_type' => 'chinamobile']],
-        20 => [['goods_id' => 7085, 'price' => 19.9, 'quality' => 2, 'card_type' => 'chinamobile']],
-        30 => [['goods_id' => 7086, 'price' => 29.85, 'quality' => 2, 'card_type' => 'chinamobile']],
-        50 => [['goods_id' => 7087, 'price' => 49.75, 'quality' => 2, 'card_type' => 'chinamobile']],
-        100 => [['goods_id' => 7088, 'price' => 99.5, 'quality' => 2, 'card_type' => 'chinamobile']],
-        200 => [['goods_id' => 7089, 'price' => 199, 'quality' => 2, 'card_type' => 'chinamobile']],
-        300 => [['goods_id' => 7090, 'price' => 298.5, 'quality' => 2, 'card_type' => 'chinamobile']],
-        500 => [['goods_id' => 7091, 'price' => 497.5, 'quality' => 2, 'card_type' => 'chinamobile']]
+        10 => [['goods_id' => 7084, 'price' => 9.93, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        20 => [['goods_id' => 7085, 'price' => 19.86, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        30 => [['goods_id' => 7086, 'price' => 29.79, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        50 => [['goods_id' => 7087, 'price' => 49.65, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        100 => [['goods_id' => 7088, 'price' => 99.3, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        200 => [['goods_id' => 7089, 'price' => 198.6, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        300 => [['goods_id' => 7090, 'price' => 297.9, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        500 => [['goods_id' => 7091, 'price' => 496.5, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']]
     ],
     ],
     'official_sn' => true, 'refill_type' => 'api'];
     'official_sn' => true, 'refill_type' => 'api'];
 
 
@@ -2544,35 +2564,35 @@ $hangtong_phone = ['name' => 'hangtong', 'store_id' => 126,'qualitys' => '1',
 $dashang_phone = ['name' => 'dashang', 'store_id' => 127, 'qualitys' => '2',
 $dashang_phone = ['name' => 'dashang', 'store_id' => 127, 'qualitys' => '2',
     'amount' => [
     'amount' => [
         10 => [
         10 => [
-            ['goods_id' => 7108, 'price' => 9.98, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7108, 'price' => 9.99, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7108, 'price' => 9.98, 'quality' => 2, 'card_type' => 'chinatelecom']
             ['goods_id' => 7108, 'price' => 9.98, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         ],
         20 => [
         20 => [
-            ['goods_id' => 7109, 'price' => 19.96, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7109, 'price' => 19.98, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7109, 'price' => 19.96, 'quality' => 2, 'card_type' => 'chinatelecom']
             ['goods_id' => 7109, 'price' => 19.96, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         ],
         30 => [
         30 => [
-            ['goods_id' => 7110, 'price' => 29.94, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7110, 'price' => 29.97, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7110, 'price' => 29.94, 'quality' => 2, 'card_type' => 'chinatelecom']
             ['goods_id' => 7110, 'price' => 29.94, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         ],
         50 => [
         50 => [
-            ['goods_id' => 7111, 'price' => 49.9, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7111, 'price' => 49.875, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7111, 'price' => 49.9, 'quality' => 2, 'card_type' => 'chinatelecom']
             ['goods_id' => 7111, 'price' => 49.9, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         ],
         100 => [
         100 => [
-            ['goods_id' => 7112, 'price' => 99.8, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7112, 'price' => 99.75, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7112, 'price' => 99.8, 'quality' => 2, 'card_type' => 'chinatelecom']
             ['goods_id' => 7112, 'price' => 99.8, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         ],
         200 => [
         200 => [
-            ['goods_id' => 7113, 'price' => 199.6, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7113, 'price' => 199.5, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7113, 'price' => 199.6, 'quality' => 2, 'card_type' => 'chinatelecom']
             ['goods_id' => 7113, 'price' => 199.6, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         ],
         300 => [
         300 => [
-            ['goods_id' => 7114, 'price' => 299.4, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7114, 'price' => 299.25, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7114, 'price' => 299.4, 'quality' => 2, 'card_type' => 'chinatelecom']
             ['goods_id' => 7114, 'price' => 299.4, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         ],
         500 => [
         500 => [
-            ['goods_id' => 7115, 'price' => 499, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7115, 'price' => 498.75, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7115, 'price' => 499, 'quality' => 2, 'card_type' => 'chinatelecom']
             ['goods_id' => 7115, 'price' => 499, 'quality' => 2, 'card_type' => 'chinatelecom']
         ]
         ]
     ],
     ],
@@ -3036,7 +3056,7 @@ $config['merchant_retry_times'] = [
         'qualities' => [1 => ['secs' => 1200, 'times' => 100], 2 => ['secs' => 100, 'times' => 5]],
         'qualities' => [1 => ['secs' => 1200, 'times' => 100], 2 => ['secs' => 100, 'times' => 5]],
         'lower_ratio' => ['ratio' => 0.9, 'period' => 3600], 'profit_ratio' => 0.003],
         'lower_ratio' => ['ratio' => 0.9, 'period' => 3600], 'profit_ratio' => 0.003],
     10216 => [ //飘逸-10分
     10216 => [ //飘逸-10分
-        'qualities' => [1 => ['secs' => 630, 'times' => 100], 2 => ['secs' => 70, 'times' => 5]],
+        'qualities' => [1 => ['secs' => 530, 'times' => 100], 2 => ['secs' => 70, 'times' => 5]],
         'lower_ratio' => ['ratio' => 0.4, 'period' => 3600], 'profit_ratio' => 0.015],
         'lower_ratio' => ['ratio' => 0.4, 'period' => 3600], 'profit_ratio' => 0.015],
     10217 => [ //天采-混充50m
     10217 => [ //天采-混充50m
         'qualities' => [1 => ['secs' => 2400, 'times' => 200], 2 => ['secs' => 600, 'times' => 20]],
         'qualities' => [1 => ['secs' => 2400, 'times' => 200], 2 => ['secs' => 600, 'times' => 20]],
@@ -3044,7 +3064,13 @@ $config['merchant_retry_times'] = [
 
 
     10231 => [ //汇通-普充2号
     10231 => [ //汇通-普充2号
         'qualities' => [1 => ['secs' => 1000, 'times' => 200], 2 => ['secs' => 200, 'times' => 20]],
         'qualities' => [1 => ['secs' => 1000, 'times' => 200], 2 => ['secs' => 200, 'times' => 20]],
-        'lower_ratio' => ['ratio' => 0.6, 'period' => 3600], 'profit_ratio' => 0.003]
+        'lower_ratio' => ['ratio' => 0.6, 'period' => 3600], 'profit_ratio' => 0.003],
+    10233 => [ //瑾相联-10分
+        'qualities' => [1 => ['secs' => 630, 'times' => 100], 2 => ['secs' => 70, 'times' => 5]],
+        'lower_ratio' => ['ratio' => 0.4, 'period' => 3600], 'profit_ratio' => 0.015],
+    10236 => [ //邀友補充-05號通道
+        'qualities' => [1 => ['secs' => 3300, 'times' => 1000], 2 => ['secs' => 300, 'times' => 5]],
+        'lower_ratio' => ['ratio' => 0.99, 'period' => 3600], 'profit_ratio' => 0.015],
 ];
 ];
 
 
 //// "status": 1 //状态 0:空号;1:实号;2:停机;3:库无;4:沉默号;5:风险号
 //// "status": 1 //状态 0:空号;1:实号;2:停机;3:库无;4:沉默号;5:风险号

+ 77 - 51
data/config/xyzadm/refill.ini.php

@@ -1471,42 +1471,42 @@ $lingzhman48_phone = ['name' => 'lingzhman48', 'store_id' => 76, 'qualitys' => '
 $cangbu_phone = ['name' => 'cangbu', 'store_id' => 78,'qualitys' => '1',
 $cangbu_phone = ['name' => 'cangbu', 'store_id' => 78,'qualitys' => '1',
     'amount' => [
     'amount' => [
         10 => [
         10 => [
-            ['goods_id' => 6744, 'price' => 9.54, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6744, 'price' => 9.57, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6744, 'price' => 9.45, 'quality' => 1, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6744, 'price' => 9.45, 'quality' => 1, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6744, 'price' => 9.5, 'quality' => 1, 'card_type' => 'chinatelecom']
             ['goods_id' => 6744, 'price' => 9.5, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         ],
         20 => [
         20 => [
-            ['goods_id' => 6745, 'price' => 19.08, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6745, 'price' => 19.14, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6745, 'price' => 18.9, 'quality' => 1, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6745, 'price' => 18.9, 'quality' => 1, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6745, 'price' => 19, 'quality' => 1, 'card_type' => 'chinatelecom']
             ['goods_id' => 6745, 'price' => 19, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         ],
         30 => [
         30 => [
-            ['goods_id' => 6746, 'price' => 28.62, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6746, 'price' => 28.71, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6746, 'price' => 28.35, 'quality' => 1, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6746, 'price' => 28.35, 'quality' => 1, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6746, 'price' => 28.5, 'quality' => 1, 'card_type' => 'chinatelecom']
             ['goods_id' => 6746, 'price' => 28.5, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         ],
         50 => [
         50 => [
-            ['goods_id' => 6747, 'price' => 48, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6747, 'price' => 47.85, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6747, 'price' => 47.25, 'quality' => 1, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6747, 'price' => 47.25, 'quality' => 1, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6747, 'price' => 47.5, 'quality' => 1, 'card_type' => 'chinatelecom']
             ['goods_id' => 6747, 'price' => 47.5, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         ],
         100 => [
         100 => [
-            ['goods_id' => 6748, 'price' => 96, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6748, 'price' => 95.7, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6748, 'price' => 94.5, 'quality' => 1, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6748, 'price' => 94.5, 'quality' => 1, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6748, 'price' => 95, 'quality' => 1, 'card_type' => 'chinatelecom']
             ['goods_id' => 6748, 'price' => 95, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         ],
         200 => [
         200 => [
-            ['goods_id' => 6749, 'price' => 192, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6749, 'price' => 191.4, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6749, 'price' => 189, 'quality' => 1, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6749, 'price' => 189, 'quality' => 1, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6749, 'price' => 190, 'quality' => 1, 'card_type' => 'chinatelecom']
             ['goods_id' => 6749, 'price' => 190, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         ],
         300 => [
         300 => [
-            ['goods_id' => 6750, 'price' => 288, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6750, 'price' => 287.1, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6750, 'price' => 283.5, 'quality' => 1, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6750, 'price' => 283.5, 'quality' => 1, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6750, 'price' => 285, 'quality' => 1, 'card_type' => 'chinatelecom']
             ['goods_id' => 6750, 'price' => 285, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         ],
         500 => [
         500 => [
-            ['goods_id' => 6751, 'price' => 480, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6751, 'price' => 478.5, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6751, 'price' => 472.5, 'quality' => 1, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6751, 'price' => 472.5, 'quality' => 1, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6751, 'price' => 475, 'quality' => 1, 'card_type' => 'chinatelecom']
             ['goods_id' => 6751, 'price' => 475, 'quality' => 1, 'card_type' => 'chinatelecom']
         ]
         ]
@@ -1850,14 +1850,34 @@ $lechong_phone = ['name' => 'lechong', 'store_id' => 99, 'qualitys' => '1',
 
 
 $xinhengyang_phone = ['name' => 'xinhengyang', 'store_id' => 100, 'qualitys' => '1',
 $xinhengyang_phone = ['name' => 'xinhengyang', 'store_id' => 100, 'qualitys' => '1',
     'amount' => [
     'amount' => [
-        10 => [['goods_id' => 6893, 'price' => 9.56, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        20 => [['goods_id' => 6894, 'price' => 19.12, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        30 => [['goods_id' => 6895, 'price' => 28.68, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        50 => [['goods_id' => 6896, 'price' => 47.8, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        100 => [['goods_id' => 6897, 'price' => 95.6, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        200 => [['goods_id' => 6898, 'price' => 191.2, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        300 => [['goods_id' => 6899, 'price' => 286.8, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        500 => [['goods_id' => 6900, 'price' => 478, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']]
+//        10 => [['goods_id' => 6893, 'price' => 9.56, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+//        20 => [['goods_id' => 6894, 'price' => 19.12, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        30 => [
+            ['goods_id' => 6895, 'price' => 28.62, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6895, 'price' => 28.59, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 6895, 'price' => 28.62, 'quality' => 1, 'card_type' => 'chinatelecom']
+        ],
+        50 => [
+            ['goods_id' => 6896, 'price' => 47.7, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6896, 'price' => 47.65, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 6896, 'price' => 47.7, 'quality' => 1, 'card_type' => 'chinatelecom']
+        ],
+        100 => [
+            ['goods_id' => 6897, 'price' => 95.4, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6897, 'price' => 95.3, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 6897, 'price' => 95.4, 'quality' => 1, 'card_type' => 'chinatelecom']
+        ],
+        200 => [
+            ['goods_id' => 6898, 'price' => 190.8, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6898, 'price' => 190.6, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 6898, 'price' => 190.8, 'quality' => 1, 'card_type' => 'chinatelecom']
+        ],
+        300 => [
+            ['goods_id' => 6899, 'price' => 286.2, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6899, 'price' => 285.9, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 6899, 'price' => 286.2, 'quality' => 1, 'card_type' => 'chinatelecom']
+        ],
+//        500 => [['goods_id' => 6900, 'price' => 478, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']]
     ],
     ],
     'official_sn' => true, 'refill_type' => 'api'];
     'official_sn' => true, 'refill_type' => 'api'];
 
 
@@ -1880,27 +1900,27 @@ $miaoxt_phone = ['name' => 'miaoxt', 'store_id' => 101, 'qualitys' => '2',
         ],
         ],
         50 => [
         50 => [
             ['goods_id' => 6904, 'price' => 50.1, 'quality' => 2, 'card_type' => 'chinamobile'],
             ['goods_id' => 6904, 'price' => 50.1, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6904, 'price' => 50, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 6904, 'price' => 50.2, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6904, 'price' => 50.1, 'quality' => 2, 'card_type' => 'chinatelecom']
             ['goods_id' => 6904, 'price' => 50.1, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         ],
         100 => [
         100 => [
             ['goods_id' => 6905, 'price' => 100.2, 'quality' => 2, 'card_type' => 'chinamobile'],
             ['goods_id' => 6905, 'price' => 100.2, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6905, 'price' => 100, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 6905, 'price' => 100.1, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6905, 'price' => 100.2, 'quality' => 2, 'card_type' => 'chinatelecom']
             ['goods_id' => 6905, 'price' => 100.2, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         ],
         200 => [
         200 => [
             ['goods_id' => 6906, 'price' => 200.4, 'quality' => 2, 'card_type' => 'chinamobile'],
             ['goods_id' => 6906, 'price' => 200.4, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6906, 'price' => 200, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 6906, 'price' => 200.2, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6906, 'price' => 200.4, 'quality' => 2, 'card_type' => 'chinatelecom']
             ['goods_id' => 6906, 'price' => 200.4, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         ],
         300 => [
         300 => [
             ['goods_id' => 6907, 'price' => 300.6, 'quality' => 2, 'card_type' => 'chinamobile'],
             ['goods_id' => 6907, 'price' => 300.6, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6907, 'price' => 300, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 6907, 'price' => 300.3, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6907, 'price' => 300.6, 'quality' => 2, 'card_type' => 'chinatelecom']
             ['goods_id' => 6907, 'price' => 300.6, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         ],
         500 => [
         500 => [
             ['goods_id' => 6908, 'price' => 501, 'quality' => 2, 'card_type' => 'chinamobile'],
             ['goods_id' => 6908, 'price' => 501, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6908, 'price' => 500, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 6908, 'price' => 500.5, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6908, 'price' => 501, 'quality' => 2, 'card_type' => 'chinatelecom']
             ['goods_id' => 6908, 'price' => 501, 'quality' => 2, 'card_type' => 'chinatelecom']
         ]
         ]
     ],
     ],
@@ -1921,14 +1941,14 @@ $tianyan_phone = ['name' => 'tianyan', 'store_id' => 102, 'qualitys' => '1',
 
 
 $yunsuoyaoman_phone = ['name' => 'yunsuoyaoman', 'store_id' => 110,'qualitys' => '5',
 $yunsuoyaoman_phone = ['name' => 'yunsuoyaoman', 'store_id' => 110,'qualitys' => '5',
     'amount' => [
     'amount' => [
-        10 => [['goods_id' => 6970, 'price' => 9.16, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        20 => [['goods_id' => 6971, 'price' => 18.32, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        30 => [['goods_id' => 6972, 'price' => 27.48, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        50 => [['goods_id' => 6973, 'price' => 45.8, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        100 => [['goods_id' => 6974, 'price' => 91.6, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        200 => [['goods_id' => 6975, 'price' => 183.2, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        300 => [['goods_id' => 6976, 'price' => 274.8, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        500 => [['goods_id' => 6977, 'price' => 458, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']]
+        10 => [['goods_id' => 6970, 'price' => 9.22, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        20 => [['goods_id' => 6971, 'price' => 18.44, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        30 => [['goods_id' => 6972, 'price' => 27.66, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        50 => [['goods_id' => 6973, 'price' => 46.1, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        100 => [['goods_id' => 6974, 'price' => 92.2, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        200 => [['goods_id' => 6975, 'price' => 184.4, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        300 => [['goods_id' => 6976, 'price' => 276.5, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        500 => [['goods_id' => 6977, 'price' => 461, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']]
     ],
     ],
     'official_sn' => true, 'refill_type' => 'api'];
     'official_sn' => true, 'refill_type' => 'api'];
 
 
@@ -2401,17 +2421,17 @@ $guochuang_nation_phone = ['name' => 'guochuang_nation', 'store_id' => 121, 'qua
         ],
         ],
 
 
         10 => [
         10 => [
-            ['goods_id' => 7060, 'price' => 10.21, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 7060, 'price' => 10.24, 'quality' => 2, 'card_type' => 'chinamobile'],
             ['goods_id' => 7060, 'price' => 10.07, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7060, 'price' => 10.07, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7060, 'price' => 10.21, 'quality' => 2, 'card_type' => 'chinatelecom']
             ['goods_id' => 7060, 'price' => 10.21, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         ],
         20 => [
         20 => [
-            ['goods_id' => 7061, 'price' => 20.22, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 7061, 'price' => 20.09, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7061, 'price' => 20.48, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 7061, 'price' => 20.52, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7061, 'price' => 20.22, 'quality' => 2, 'card_type' => 'chinatelecom']
             ['goods_id' => 7061, 'price' => 20.22, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         ],
         30 => [
         30 => [
-            ['goods_id' => 7062, 'price' => 30.12, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 7062, 'price' => 30.21, 'quality' => 2, 'card_type' => 'chinamobile'],
             ['goods_id' => 7062, 'price' => 30.135, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7062, 'price' => 30.135, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7062, 'price' => 30.39, 'quality' => 2, 'card_type' => 'chinatelecom']
             ['goods_id' => 7062, 'price' => 30.39, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         ],
@@ -2480,14 +2500,14 @@ $shimier_phone = ['name' => 'shimier', 'store_id' => 123,'qualitys' => '1',
 
 
 $zhongst_mix_phone = ['name' => 'zhongst_mix', 'store_id' => 124, 'qualitys' => '2',
 $zhongst_mix_phone = ['name' => 'zhongst_mix', 'store_id' => 124, 'qualitys' => '2',
     'amount' => [
     'amount' => [
-        10 => [['goods_id' => 7084, 'price' => 9.95, 'quality' => 2, 'card_type' => 'chinamobile']],
-        20 => [['goods_id' => 7085, 'price' => 19.9, 'quality' => 2, 'card_type' => 'chinamobile']],
-        30 => [['goods_id' => 7086, 'price' => 29.85, 'quality' => 2, 'card_type' => 'chinamobile']],
-        50 => [['goods_id' => 7087, 'price' => 49.75, 'quality' => 2, 'card_type' => 'chinamobile']],
-        100 => [['goods_id' => 7088, 'price' => 99.5, 'quality' => 2, 'card_type' => 'chinamobile']],
-        200 => [['goods_id' => 7089, 'price' => 199, 'quality' => 2, 'card_type' => 'chinamobile']],
-        300 => [['goods_id' => 7090, 'price' => 298.5, 'quality' => 2, 'card_type' => 'chinamobile']],
-        500 => [['goods_id' => 7091, 'price' => 497.5, 'quality' => 2, 'card_type' => 'chinamobile']]
+        10 => [['goods_id' => 7084, 'price' => 9.93, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        20 => [['goods_id' => 7085, 'price' => 19.86, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        30 => [['goods_id' => 7086, 'price' => 29.79, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        50 => [['goods_id' => 7087, 'price' => 49.65, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        100 => [['goods_id' => 7088, 'price' => 99.3, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        200 => [['goods_id' => 7089, 'price' => 198.6, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        300 => [['goods_id' => 7090, 'price' => 297.9, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        500 => [['goods_id' => 7091, 'price' => 496.5, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']]
     ],
     ],
     'official_sn' => true, 'refill_type' => 'api'];
     'official_sn' => true, 'refill_type' => 'api'];
 
 
@@ -2544,35 +2564,35 @@ $hangtong_phone = ['name' => 'hangtong', 'store_id' => 126,'qualitys' => '1',
 $dashang_phone = ['name' => 'dashang', 'store_id' => 127, 'qualitys' => '2',
 $dashang_phone = ['name' => 'dashang', 'store_id' => 127, 'qualitys' => '2',
     'amount' => [
     'amount' => [
         10 => [
         10 => [
-            ['goods_id' => 7108, 'price' => 9.98, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7108, 'price' => 9.99, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7108, 'price' => 9.98, 'quality' => 2, 'card_type' => 'chinatelecom']
             ['goods_id' => 7108, 'price' => 9.98, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         ],
         20 => [
         20 => [
-            ['goods_id' => 7109, 'price' => 19.96, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7109, 'price' => 19.98, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7109, 'price' => 19.96, 'quality' => 2, 'card_type' => 'chinatelecom']
             ['goods_id' => 7109, 'price' => 19.96, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         ],
         30 => [
         30 => [
-            ['goods_id' => 7110, 'price' => 29.94, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7110, 'price' => 29.97, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7110, 'price' => 29.94, 'quality' => 2, 'card_type' => 'chinatelecom']
             ['goods_id' => 7110, 'price' => 29.94, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         ],
         50 => [
         50 => [
-            ['goods_id' => 7111, 'price' => 49.9, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7111, 'price' => 49.875, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7111, 'price' => 49.9, 'quality' => 2, 'card_type' => 'chinatelecom']
             ['goods_id' => 7111, 'price' => 49.9, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         ],
         100 => [
         100 => [
-            ['goods_id' => 7112, 'price' => 99.8, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7112, 'price' => 99.75, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7112, 'price' => 99.8, 'quality' => 2, 'card_type' => 'chinatelecom']
             ['goods_id' => 7112, 'price' => 99.8, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         ],
         200 => [
         200 => [
-            ['goods_id' => 7113, 'price' => 199.6, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7113, 'price' => 199.5, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7113, 'price' => 199.6, 'quality' => 2, 'card_type' => 'chinatelecom']
             ['goods_id' => 7113, 'price' => 199.6, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         ],
         300 => [
         300 => [
-            ['goods_id' => 7114, 'price' => 299.4, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7114, 'price' => 299.25, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7114, 'price' => 299.4, 'quality' => 2, 'card_type' => 'chinatelecom']
             ['goods_id' => 7114, 'price' => 299.4, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         ],
         500 => [
         500 => [
-            ['goods_id' => 7115, 'price' => 499, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7115, 'price' => 498.75, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7115, 'price' => 499, 'quality' => 2, 'card_type' => 'chinatelecom']
             ['goods_id' => 7115, 'price' => 499, 'quality' => 2, 'card_type' => 'chinatelecom']
         ]
         ]
     ],
     ],
@@ -3036,7 +3056,7 @@ $config['merchant_retry_times'] = [
         'qualities' => [1 => ['secs' => 1200, 'times' => 100], 2 => ['secs' => 100, 'times' => 5]],
         'qualities' => [1 => ['secs' => 1200, 'times' => 100], 2 => ['secs' => 100, 'times' => 5]],
         'lower_ratio' => ['ratio' => 0.9, 'period' => 3600], 'profit_ratio' => 0.003],
         'lower_ratio' => ['ratio' => 0.9, 'period' => 3600], 'profit_ratio' => 0.003],
     10216 => [ //飘逸-10分
     10216 => [ //飘逸-10分
-        'qualities' => [1 => ['secs' => 630, 'times' => 100], 2 => ['secs' => 70, 'times' => 5]],
+        'qualities' => [1 => ['secs' => 530, 'times' => 100], 2 => ['secs' => 70, 'times' => 5]],
         'lower_ratio' => ['ratio' => 0.4, 'period' => 3600], 'profit_ratio' => 0.015],
         'lower_ratio' => ['ratio' => 0.4, 'period' => 3600], 'profit_ratio' => 0.015],
     10217 => [ //天采-混充50m
     10217 => [ //天采-混充50m
         'qualities' => [1 => ['secs' => 2400, 'times' => 200], 2 => ['secs' => 600, 'times' => 20]],
         'qualities' => [1 => ['secs' => 2400, 'times' => 200], 2 => ['secs' => 600, 'times' => 20]],
@@ -3044,7 +3064,13 @@ $config['merchant_retry_times'] = [
 
 
     10231 => [ //汇通-普充2号
     10231 => [ //汇通-普充2号
         'qualities' => [1 => ['secs' => 1000, 'times' => 200], 2 => ['secs' => 200, 'times' => 20]],
         'qualities' => [1 => ['secs' => 1000, 'times' => 200], 2 => ['secs' => 200, 'times' => 20]],
-        'lower_ratio' => ['ratio' => 0.6, 'period' => 3600], 'profit_ratio' => 0.003]
+        'lower_ratio' => ['ratio' => 0.6, 'period' => 3600], 'profit_ratio' => 0.003],
+    10233 => [ //瑾相联-10分
+        'qualities' => [1 => ['secs' => 630, 'times' => 100], 2 => ['secs' => 70, 'times' => 5]],
+        'lower_ratio' => ['ratio' => 0.4, 'period' => 3600], 'profit_ratio' => 0.015],
+    10236 => [ //邀友補充-05號通道
+        'qualities' => [1 => ['secs' => 3300, 'times' => 1000], 2 => ['secs' => 300, 'times' => 5]],
+        'lower_ratio' => ['ratio' => 0.99, 'period' => 3600], 'profit_ratio' => 0.015],
 ];
 ];
 
 
 //// "status": 1 //状态 0:空号;1:实号;2:停机;3:库无;4:沉默号;5:风险号
 //// "status": 1 //状态 0:空号;1:实号;2:停机;3:库无;4:沉默号;5:风险号

+ 1 - 1
helper/bonus/BonusAmount.php

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

+ 6 - 1
helper/mtopcard/mtopcard.php

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

+ 4 - 4
helper/refill/CalcMerchantPrice.php

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

+ 2 - 0
helper/refill/LZRefillFactory.php

@@ -24,6 +24,8 @@ require_once(BASE_HELPER_PATH . '/refill/policy/lingzh/quality_ploy.php');
 require_once(BASE_HELPER_PATH . '/refill/policy/channel_filter.php');
 require_once(BASE_HELPER_PATH . '/refill/policy/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/overload_assigner.php');
 require_once(BASE_HELPER_PATH . '/refill/policy/overload_assigner.php');
+require_once(BASE_HELPER_PATH . '/refill/functional.php');
+
 
 
 
 
 use Log;
 use Log;

+ 5 - 0
helper/refill/RefillBase.php

@@ -753,4 +753,9 @@ class RefillBase
     {
     {
         $this->mPolicy->update_chspeeds($speeds);
         $this->mPolicy->update_chspeeds($speeds);
     }
     }
+    public function need_intercept($mchid,$card_type,$card_state,$is_transfer)
+    {
+        return $this->mPolicy->need_intercept($mchid,$card_type,$card_state,$is_transfer);
+
+    }
 }
 }

+ 2 - 0
helper/refill/XYZRefillFactory.php

@@ -28,6 +28,8 @@ require_once(BASE_HELPER_PATH . '/refill/policy/mgroup.php');
 require_once(BASE_HELPER_PATH . '/refill/policy/channel_filter.php');
 require_once(BASE_HELPER_PATH . '/refill/policy/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/overload_assigner.php');
 require_once(BASE_HELPER_PATH . '/refill/policy/overload_assigner.php');
+require_once(BASE_HELPER_PATH . '/refill/functional.php');
+
 
 
 use Log;
 use Log;
 use StatesHelper;
 use StatesHelper;

TEMPAT SAMPAH
helper/refill/api/xyz/guochuang/20211022黑龙江移动.png


TEMPAT SAMPAH
helper/refill/api/xyz/guochuang/20211025辽宁移动.png


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

@@ -64,9 +64,9 @@ class config
     const Price = [
     const Price = [
         //移动
         //移动
         "4-10-2" => 9.94, "4-20-2" => 19.88, "4-30-2" => 29.82, "4-50-2" => 49.7, "4-100-2" => 99.4, "4-200-2" => 198.8, "4-300-2" => 298.2, "4-500-2" => 497,//天津 2
         "4-10-2" => 9.94, "4-20-2" => 19.88, "4-30-2" => 29.82, "4-50-2" => 49.7, "4-100-2" => 99.4, "4-200-2" => 198.8, "4-300-2" => 298.2, "4-500-2" => 497,//天津 2
-        "4-10-6" => 9.72, "4-20-6" => 19.44, "4-30-6" => 29.16, "4-50-6" => 48.6, "4-100-6" => 97.2, "4-200-6" => 194.4, "4-300-6" => 291.6, "4-500-6" => 486,//辽宁 6
+        "4-10-6" => 9.75, "4-20-6" => 19.5, "4-30-6" => 29.25, "4-50-6" => 48.75, "4-100-6" => 97.5, "4-200-6" => 195, "4-300-6" => 292.5, "4-500-6" => 487.5,//辽宁 6
         "4-10-9" => 9.93, "4-20-9" => 19.86, "4-30-9" => 29.79, "4-50-9" => 49.65, "4-100-9" => 99.3,//上海 9
         "4-10-9" => 9.93, "4-20-9" => 19.86, "4-30-9" => 29.79, "4-50-9" => 49.65, "4-100-9" => 99.3,//上海 9
-        "4-10-8" => 9.995, "4-20-8" => 19.99, "4-30-8" => 29.985, "4-50-8" => 49.975, "4-100-8" => 99.95, "4-200-8" => 199.9, "4-300-8" => 299.85, "4-500-8" => 499.75,//黑龙江 8
+        "4-10-8" => 10.012, "4-20-8" => 20.024, "4-30-8" => 30.036, "4-50-8" => 50.06, "4-100-8" => 100.12, "4-200-8" => 200.24, "4-300-8" => 300.36, "4-500-8" => 500.6,//黑龙江 8
         "4-10-29" => 9.82, "4-20-29" => 19.64, "4-30-29" => 29.46, "4-50-29" => 49.1, "4-100-29" => 98.2, "4-200-29" => 196.4, "4-300-29" => 294.6, "4-500-29" => 491,//青海 29
         "4-10-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

+ 3 - 0
helper/refill/policy/IPolicy.php

@@ -12,6 +12,9 @@ interface IPolicy
     public function allow($mchid, $card_type, $amount, $quality): bool;
     public function allow($mchid, $card_type, $amount, $quality): bool;
     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 max_inprice($mchid, $spec, $card_type, $quality, $pcode);
+    public function need_intercept($mchid,$card_type,$card_state,$is_transfer) : bool;
+
     public function update_ratios($ratios);
     public function update_ratios($ratios);
     public function update_mchratios($all,$detail);
     public function update_mchratios($all,$detail);
     public function update_chspeeds($speeds);
     public function update_chspeeds($speeds);

+ 40 - 17
helper/refill/policy/chctl.php

@@ -22,10 +22,10 @@ class chctl
         ['quality'=> 2,'name' => 'channel-ctl-phone-fast-limit'],
         ['quality'=> 2,'name' => 'channel-ctl-phone-fast-limit'],
         ['quality'=> 3,'name' => 'channel-ctl-phone-card-limit'],
         ['quality'=> 3,'name' => 'channel-ctl-phone-card-limit'],
         ['quality'=> 4,'name' => 'channel-ctl-phone-third-limit'],
         ['quality'=> 4,'name' => 'channel-ctl-phone-third-limit'],
-        ['quality'=> 5,'name' => 'channel-ctl-phone-slow-limit'], //24 hour
-        ['quality'=> 6,'name' => 'channel-ctl-phone-slow6-limit'],//6 hour
+        ['quality'=> 5,'name' => 'channel-ctl-phone-slow-limit'],  //24 hour
+        ['quality'=> 6,'name' => 'channel-ctl-phone-slow6-limit'], //6 hour
         ['quality'=> 7,'name' => 'channel-ctl-phone-slow2-limit'], //2 hour
         ['quality'=> 7,'name' => 'channel-ctl-phone-slow2-limit'], //2 hour
-        ['quality'=> 8,'name' => 'channel-ctl-phone-slow48-limit'], //48 hour
+        ['quality'=> 8,'name' => 'channel-ctl-phone-slow48-limit'],//48 hour
         ['quality'=> 9,'name' => 'channel-ctl-phone-slow72-limit'] //72 hour
         ['quality'=> 9,'name' => 'channel-ctl-phone-slow72-limit'] //72 hour
     ];
     ];
 
 
@@ -112,23 +112,39 @@ class chctl
         }
         }
     }
     }
 
 
-    public function match($names,int $spec, int $card_type,int $quality)
+    public function match($names, int $spec, int $card_type, int $quality, $max_inprice)
     {
     {
         $trace = new scope_trace(__METHOD__);
         $trace = new scope_trace(__METHOD__);
         if ($card_type == mtopcard\ThirdRefillCard) {
         if ($card_type == mtopcard\ThirdRefillCard) {
             return $names;
             return $names;
         }
         }
 
 
-        $ctl_items = [];
-        foreach ($names as $name)
+        $pThis = $this;
+        $price_filter = function ($names,$spec,$card_type,$quality) use($pThis,$max_inprice)
         {
         {
-            $key = $this->prefix($name,$spec,$card_type,$quality);
-            if(array_key_exists($key,$this->mSpeedtable)) {
-                $ctl_items[] = $this->mSpeedtable[$key];
-            } else {
-                Log::record("unavaliable key={$key}",Log::DEBUG);
+            $ctls = [];
+            foreach ($names as $name)
+            {
+                $key = $pThis->prefix($name,$spec,$card_type,$quality);
+                if(array_key_exists($key,$pThis->mSpeedtable))
+                {
+                    $item = $pThis->mSpeedtable[$key];
+
+                    $inPrice = $item->price();
+                    Log::record("max_price = {$max_inprice},in_price={$inPrice}",Log::DEBUG);
+                    if ($max_inprice !== false && $inPrice > $max_inprice) {
+                        continue;
+                    } else {
+                        $ctls[] = $item;
+                    }
+                }
+                else {
+                    Log::record("auto_match speed table key={$key} is empty.",Log::DEBUG);
+                }
             }
             }
-        }
+            return $ctls;
+        };
+        $ctl_items = $price_filter($names,$spec,$card_type,$quality);
 
 
         $chooser = function ($ctl_items)
         $chooser = function ($ctl_items)
         {
         {
@@ -355,7 +371,7 @@ class chctl
         return [$feeds,$profits];
         return [$feeds,$profits];
     }
     }
 
 
-    public function auto_match($names, int $spec, int $card_type, int $quality, $out_price, $left_time) : array
+    public function auto_match($names, int $spec, int $card_type, int $quality, $out_price, $max_inprice, $left_time): array
     {
     {
         $formater = function ($val) {
         $formater = function ($val) {
             return number_format($val,10,'.','');
             return number_format($val,10,'.','');
@@ -462,16 +478,23 @@ class chctl
 
 
 
 
         $pThis = $this;
         $pThis = $this;
-        $speed_locker = function ($names,$spec,$card_type,$quality) use($pThis)
+        $price_filter = function ($names,$spec,$card_type,$quality) use($pThis,$max_inprice)
         {
         {
             $ctls = [];
             $ctls = [];
             foreach ($names as $name)
             foreach ($names as $name)
             {
             {
                 $key = $pThis->prefix($name,$spec,$card_type,$quality);
                 $key = $pThis->prefix($name,$spec,$card_type,$quality);
-                if(array_key_exists($key,$pThis->mSpeedtable)) {
+                if(array_key_exists($key,$pThis->mSpeedtable))
+                {
                     $item = $pThis->mSpeedtable[$key];
                     $item = $pThis->mSpeedtable[$key];
                     $item->calc_speed();
                     $item->calc_speed();
-                    $ctls[] = $item;
+
+                    $inPrice = $item->price();
+                    if ($max_inprice !== false && $inPrice > $max_inprice) {
+                        continue;
+                    } else {
+                        $ctls[] = $item;
+                    }
                 }
                 }
                 else {
                 else {
                     Log::record("auto_match speed table key={$key} is empty.",Log::DEBUG);
                     Log::record("auto_match speed table key={$key} is empty.",Log::DEBUG);
@@ -492,7 +515,7 @@ class chctl
         Log::record("auto_match outprice= {$out_price} names=" . implode(',', $names), Log::DEBUG);
         Log::record("auto_match outprice= {$out_price} names=" . implode(',', $names), Log::DEBUG);
 
 
         $can_feed = true;
         $can_feed = true;
-        $ctls = $speed_locker($names,$spec,$card_type,$quality);
+        $ctls = $price_filter($names,$spec,$card_type,$quality);
         [$sleeps,$wakeups] = $this->knockout($ctls,$out_price);
         [$sleeps,$wakeups] = $this->knockout($ctls,$out_price);
 
 
         $logger($sleeps,'sleeps');
         $logger($sleeps,'sleeps');

+ 97 - 51
helper/refill/policy/lingzh/policy.php

@@ -44,7 +44,6 @@ class policy extends ProviderManager implements IPolicy
         $this->mAmountLockTurn = rkcache($turn_name);
         $this->mAmountLockTurn = rkcache($turn_name);
         Log::record("AmountLockTurn = {$this->mAmountLockTurn}",Log::DEBUG);
         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->mRatioCtl->load();
 
 
@@ -88,16 +87,14 @@ class policy extends ProviderManager implements IPolicy
         };
         };
 
 
         $pQuality = $this->mQuality;
         $pQuality = $this->mQuality;
-        $mixed_quality = Quality::NormalQuick;
-        $mchids = $pQuality->mechants_quality($mixed_quality);
-        foreach ($mchids as $mchid)
+        $mchids = $pQuality->mechants_quality();
+        foreach ($mchids as $mchid => $mixed_quality)
         {
         {
             $qualities = $pQuality->qualities($mixed_quality);
             $qualities = $pQuality->qualities($mixed_quality);
             $specs = [];
             $specs = [];
-            foreach ($qualities as $quality)
-            {
+            foreach ($qualities as $quality) {
                 $item = $this->mPrices->merchant_specs($mchid, $quality);
                 $item = $this->mPrices->merchant_specs($mchid, $quality);
-                if(empty($item)) continue;
+                if (empty($item)) continue;
                 $specs[$quality] = $item;
                 $specs[$quality] = $item;
             }
             }
 
 
@@ -107,11 +104,16 @@ class policy extends ProviderManager implements IPolicy
                 [$card_type, $spec] = $item;
                 [$card_type, $spec] = $item;
                 if (!in_array($card_type, [4, 5, 6])) continue;
                 if (!in_array($card_type, [4, 5, 6])) continue;
 
 
+                $prices = [];
                 $sale_price = $this->mPrices->price($mchid,$card_type,$spec,$mixed_quality,'');
                 $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);
+                $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, $sale_price, [$qualities[0] => $low_price, $qualities[1] => $high_price]);
+                $this->mRatioCtl->setMixedPrice($mchid, $mixed_quality, $card_type, $spec, $prices);
             }
             }
         }
         }
     }
     }
@@ -161,6 +163,51 @@ class policy extends ProviderManager implements IPolicy
         return $total / count($names);
         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()
     {
     {
         $mchids = [];
         $mchids = [];
@@ -179,6 +226,7 @@ class policy extends ProviderManager implements IPolicy
                 $mchids[] = intval($item['mchid']);
                 $mchids[] = intval($item['mchid']);
             }
             }
         }
         }
+
         sort($mchids);
         sort($mchids);
 
 
         return $mchids;
         return $mchids;
@@ -231,63 +279,51 @@ class policy extends ProviderManager implements IPolicy
         Log::record("GroupControl second 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;
+            $mixedQuality = $org_quality;
         }
         }
         else {
         else {
-            $fQuality = $cur_quality;
+            $mixedQuality = $cur_quality;
         }
         }
 
 
-        $price = $this->mPrices->price($mchid,$card_type,$spec,$fQuality,$pcode);
+        $price = $this->mPrices->price($mchid,$card_type,$spec,$mixedQuality,$pcode);
         if($price === false) {
         if($price === false) {
             return [[],false];
             return [[],false];
         }
         }
-        $extra_price = $this->mPrices->extra_price($mchid,$card_type,$spec,$fQuality,$pcode);
+
+        $extra_price = $this->mPrices->extra_price($mchid,$card_type,$spec,$mixedQuality,$pcode);
         $extra_price = $extra_price == false ? 0.00 : $extra_price;
         $extra_price = $extra_price == false ? 0.00 : $extra_price;
 
 
+        //以当前通道质量为准
+        $max_inprice = $this->mPrices->max_inprice($mchid,$card_type,$spec,$cur_quality,$pcode);
+
         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))
-        {
-            $names = $this->mChannelControl->auto_match($names, $spec, $card_type, $cur_quality, $price - $extra_price, time() - $order_time);
-            Log::record("policy::find_providers ChannelControl auto_match quality={$cur_quality} spec={$spec} card_type={$card_type}  result=" . implode(',', $names), Log::DEBUG);
-
-            $name_provider = [];
-            foreach ($providers as $provider) {
-                $name = $provider->name();
-                $name_provider[$name] = $provider;
-            }
-
-            $result = [];
-            foreach ($names as $name)
-            {
-                if(array_key_exists($name,$name_provider)) {
-                    $result[] = $name_provider[$name];
-                }
-            }
+        if ($auto_find && in_array($card_type, $mobile_types, true) && in_array($cur_quality, $qualities, true)) {
+            $names = $this->mChannelControl->auto_match($names, $spec, $card_type, $cur_quality, $price - $extra_price, $max_inprice, time() - $order_time);
+            Log::record("policy::find_providers ChannelControl auto_match quality={$cur_quality} spec={$spec} card_type={$card_type} result=" . implode(',', $names), Log::DEBUG);
+        } else {
+            $names = $this->mChannelControl->match($names, $spec, $card_type, $cur_quality, $max_inprice);
+            Log::record("policy::find_providers ChannelControl match quality={$cur_quality} spec={$spec} card_type={$card_type} result=" . implode(',', $names), Log::DEBUG);
+        }
 
 
-            return [$result,false];
+        $name_provider = [];
+        foreach ($providers as $provider) {
+            $name = $provider->name();
+            $name_provider[$name] = $provider;
         }
         }
-        else
-        {
-            $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);
 
 
-            $result = [];
-            foreach ($name_overloads as $name => $overload)
-            {
-                foreach ($providers as $provider)
-                {
-                    if($name == $provider->name()) {
-                        $result[] = $provider;
-                    }
-                }
+        $result = [];
+        foreach ($names as $name)
+        {
+            if(array_key_exists($name,$name_provider)) {
+                $result[] = $name_provider[$name];
             }
             }
-
-            return [$result,false];
         }
         }
+
+        return [$result,false];
     }
     }
 
 
     public function price($mchid,$spec,$card_type,$quality,$pcode)
     public function price($mchid,$spec,$card_type,$quality,$pcode)
@@ -295,6 +331,11 @@ class policy extends ProviderManager implements IPolicy
         return $this->mPrices->price($mchid,$card_type,$spec,$quality,$pcode);
         return $this->mPrices->price($mchid,$card_type,$spec,$quality,$pcode);
     }
     }
 
 
+    public function max_inprice($mchid, $spec, $card_type, $quality, $pcode)
+    {
+        return $this->mPrices->max_inprice($mchid,$card_type,$spec,$quality,$pcode);
+    }
+
     public function channeles(int $mchid, int $spec, int $card_type, int $quality, $regin_no)
     public function channeles(int $mchid, int $spec, int $card_type, int $quality, $regin_no)
     {
     {
         $providers = parent::get_providers($mchid, $spec, $card_type, $quality, $regin_no);
         $providers = parent::get_providers($mchid, $spec, $card_type, $quality, $regin_no);
@@ -349,14 +390,14 @@ class policy extends ProviderManager implements IPolicy
                 Log::record("{$mchid} 没有协商 quality = {$quality} 价格",Log::DEBUG);
                 Log::record("{$mchid} 没有协商 quality = {$quality} 价格",Log::DEBUG);
                 continue;
                 continue;
             }
             }
+            $max_inprice = $this->mPrices->max_inprice($mchid,$card_type,$spec,$cur_quality,$pcode);
 
 
             $providers = parent::get_providers($mchid, $spec, $card_type, $quality, $regin_no);
             $providers = parent::get_providers($mchid, $spec, $card_type, $quality, $regin_no);
             if(empty($providers)) continue;
             if(empty($providers)) continue;
 
 
             $names = $namer($providers);
             $names = $namer($providers);
-            $names_overload = $this->mChannelControl->match($names, $spec, $card_type, $quality);
-
-            if (!empty($names_overload)) {
+            $names = $this->mChannelControl->match($names, $spec, $card_type, $quality, $max_inprice);
+            if (!empty($names)) {
                 return [$org_quality, $quality];
                 return [$org_quality, $quality];
             } else {
             } else {
                 Log::record("Policy::find_quality:{$quality}-{$spec}-{$card_type} is fail", Log::DEBUG);
                 Log::record("Policy::find_quality:{$quality}-{$spec}-{$card_type} is fail", Log::DEBUG);
@@ -423,6 +464,11 @@ class policy extends ProviderManager implements IPolicy
         return [$params, $sign];
         return [$params, $sign];
     }
     }
 
 
+    public function need_intercept($mchid,$card_type,$card_state,$is_transfer) : bool
+    {
+        return $this->mRatioCtl->need_intercept($mchid,$card_type,$card_state,$is_transfer);
+    }
+    
     private function sign($params, $key)
     private function sign($params, $key)
     {
     {
         $body = "{$params['ord']}{$params['state']}{$key}";
         $body = "{$params['ord']}{$params['state']}{$key}";

+ 31 - 3
helper/refill/policy/merchant_price.php

@@ -8,11 +8,13 @@ class merchant_price
 {
 {
     private $mPrices;
     private $mPrices;
     private $mExtraPrices;
     private $mExtraPrices;
+    private $mMaxInPrices;
 
 
     public function __construct()
     public function __construct()
     {
     {
         $this->mPrices = [];
         $this->mPrices = [];
         $this->mExtraPrices = [];
         $this->mExtraPrices = [];
+        $this->mMaxInPrices = [];
     }
     }
 
 
     public function load($mchids)
     public function load($mchids)
@@ -40,15 +42,24 @@ class merchant_price
                 $card_types = $item['card_types'];
                 $card_types = $item['card_types'];
                 $price = ncPriceFormat($item['price']);
                 $price = ncPriceFormat($item['price']);
                 $extra_price = ncPriceFormat($item['extra_price']);
                 $extra_price = ncPriceFormat($item['extra_price']);
+                $max_inprice = ncPriceFormat($item['max_inprice']);
+
+                //false 表示不曾设置价格限制
+                $max_inprice = $max_inprice <= 0.00001 ? false : $max_inprice;
 
 
                 $spec = intval($item['spec']);
                 $spec = intval($item['spec']);
                 $quality = intval($item['quality']);
                 $quality = intval($item['quality']);
 
 
                 $types = explode(',',$card_types);
                 $types = explode(',',$card_types);
-                foreach ($types as $card_type) {
+                foreach ($types as $card_type)
+                {
                     $key = "{$mchid}-{$quality}-{$card_type}-{$spec}";
                     $key = "{$mchid}-{$quality}-{$card_type}-{$spec}";
+
                     $this->mPrices[$key] = $price;
                     $this->mPrices[$key] = $price;
                     $this->mExtraPrices[$key] = $extra_price;
                     $this->mExtraPrices[$key] = $extra_price;
+                    if ($max_inprice !== false) {
+                        $this->mMaxInPrices[$key] = $max_inprice;
+                    }
                 }
                 }
             }
             }
         }
         }
@@ -57,7 +68,7 @@ class merchant_price
     public function price($mchid,$card_type,$spec,$quality,$pcode)
     public function price($mchid,$card_type,$spec,$quality,$pcode)
     {
     {
         $card_type = intval($card_type);
         $card_type = intval($card_type);
-        if(in_array($card_type,[1,2,4,5,6])) //油,话费价格查找.
+        if (in_array($card_type, [1, 2, 4, 5, 6], true)) //油,话费价格查找.
         {
         {
             $key = "{$mchid}-{$quality}-{$card_type}-{$spec}";
             $key = "{$mchid}-{$quality}-{$card_type}-{$spec}";
             if (array_key_exists($key, $this->mPrices)) {
             if (array_key_exists($key, $this->mPrices)) {
@@ -92,7 +103,7 @@ class merchant_price
     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);
-        if(in_array($card_type,[1,2,4,5,6])) //油,话费价格查找.
+        if (in_array($card_type, [1, 2, 4, 5, 6], true)) //油,话费价格查找.
         {
         {
             $key = "{$mchid}-{$quality}-{$card_type}-{$spec}";
             $key = "{$mchid}-{$quality}-{$card_type}-{$spec}";
             if (array_key_exists($key, $this->mExtraPrices)) {
             if (array_key_exists($key, $this->mExtraPrices)) {
@@ -105,4 +116,21 @@ class merchant_price
             return false;
             return false;
         }
         }
     }
     }
+
+    public function max_inprice($mchid,$card_type,$spec,$quality,$pcode)
+    {
+        $card_type = intval($card_type);
+        if (in_array($card_type, [1, 2, 4, 5, 6], true)) //油,话费价格查找.
+        {
+            $key = "{$mchid}-{$quality}-{$card_type}-{$spec}";
+            if (array_key_exists($key, $this->mMaxInPrices)) {
+                return $this->mMaxInPrices[$key];
+            } else {
+                return false;
+            }
+        }
+        else {
+            return false;
+        }
+    }
 }
 }

+ 131 - 8
helper/refill/policy/mratio_control.php

@@ -7,22 +7,105 @@ use Log;
 class mratio_control
 class mratio_control
 {
 {
     private $mTimesConfig; //对应refill.ini 配置文件数据
     private $mTimesConfig; //对应refill.ini 配置文件数据
+    private $mInterceptConfig;
     private $mGrossRatios;
     private $mGrossRatios;
     private $mDetailRatios;
     private $mDetailRatios;
     private $mMixedPrices;
     private $mMixedPrices;
 
 
+
     public function __construct()
     public function __construct()
     {
     {
         $this->mTimesConfig = [];
         $this->mTimesConfig = [];
+        $this->mInterceptConfig = [];
+
         $this->mGrossRatios = [];
         $this->mGrossRatios = [];
         $this->mDetailRatios = [];
         $this->mDetailRatios = [];
         $this->mMixedPrices = [];
         $this->mMixedPrices = [];
     }
     }
 
 
+    private function load_retry()
+    {
+        $isDay = functional::isDay();
+        $mch_configs = function ($isDay)
+        {
+            $result = [];
+
+            $i = 0;
+            while (true)
+            {
+                $start = $i * 100;
+                $items = Model()->table('merchant')->where(['mchid' => ['gt', 0], 'merchant_state' => 1])->field('mchid,retry_times_cfg')->order('mchid asc')->limit("{$start},100")->select();
+                if(empty($items)) {
+                    break;
+                }
+                $i++;
+
+                foreach ($items as $item)
+                {
+                    $mchid = intval($item['mchid']);
+                    if($mchid <= 0) continue;
+
+                    $retry_times_cfg = unserialize($item['retry_times_cfg']);
+                    if(empty($retry_times_cfg)) continue;
+
+                    $qualities = &$retry_times_cfg['qualities'];
+                    foreach ($qualities as $quality => $cfg)
+                    {
+                        if ($isDay) {
+                            $qualities[$quality]['secs'] = $cfg['day_secs'];
+                        } else {
+                            $qualities[$quality]['secs'] = $cfg['night_secs'];
+                        }
+                    }
+
+                    $result[$mchid] = $retry_times_cfg;
+                }
+            }
+
+            return $result;
+        };
+
+        $this->mTimesConfig = $mch_configs($isDay);
+    }
+
+    private function load_intercept()
+    {
+        $mch_configs = function ()
+        {
+            $result = [];
+
+            $i = 0;
+            while (true)
+            {
+                $start = $i * 100;
+                $items = Model()->table('merchant')->where(['mchid' => ['gt', 0], 'merchant_state' => 1])->field('mchid,intercept_cfg')->order('mchid asc')->limit("{$start},100")->select();
+                if(empty($items)) {
+                    break;
+                }
+                $i++;
+
+                foreach ($items as $item)
+                {
+                    $mchid = intval($item['mchid']);
+                    if($mchid <= 0) continue;
+
+                    $cfg = unserialize($item['intercept_cfg']);
+                    if(empty($cfg)) continue;
+
+                    $result[$mchid] = $cfg;
+                }
+            }
+
+            return $result;
+        };
+
+        $this->mInterceptConfig = $mch_configs();
+    }
+
     public function load()
     public function load()
     {
     {
-        global $config;
-        $this->mTimesConfig = $config['merchant_retry_times'] ?? [];
+        $this->load_retry();
+        $this->load_intercept();
     }
     }
 
 
     public function update($gross_ratios, $detail_ratios)
     public function update($gross_ratios, $detail_ratios)
@@ -61,17 +144,24 @@ class mratio_control
         return false;
         return false;
     }
     }
 
 
-    public function total($mchid)
+    public function total($mchid,$qualities)
     {
     {
-        if (array_key_exists($mchid, $this->mTimesConfig)) {
+        if (array_key_exists($mchid, $this->mTimesConfig))
+        {
             $items = $this->mTimesConfig[$mchid]['qualities'];
             $items = $this->mTimesConfig[$mchid]['qualities'];
 
 
             $times = 0;
             $times = 0;
             $secs = 0;
             $secs = 0;
-            foreach ($items as $quality => $val) {
+            foreach ($items as $quality => $val)
+            {
+                if (!in_array($quality,$qualities,true)) {
+                    continue;
+                }
+
                 $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];
@@ -92,7 +182,8 @@ class mratio_control
 
 
     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'];
@@ -114,7 +205,11 @@ class mratio_control
     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']];
+        if (empty($lower_ratio)) {
+            return [0.0, 3600];
+        } else {
+            return [$lower_ratio['ratio'], $lower_ratio['period']];
+        }
     }
     }
 
 
     private function profit_ratio($mchid) {
     private function profit_ratio($mchid) {
@@ -143,6 +238,7 @@ class mratio_control
                 return $ratios[$period];
                 return $ratios[$period];
             }
             }
         }
         }
+        
         return [0, 0, 1.0];
         return [0, 0, 1.0];
     }
     }
 
 
@@ -157,8 +253,13 @@ class mratio_control
         return $result;
         return $result;
     }
     }
 
 
-    public function ratio_match($mchid, $org_quality, $cur_quality, $card_type, $spec,$qualities)
+    //return true 表示不可以补充。
+    public function ratio_match($mchid, $org_quality, $cur_quality, $card_type, $spec, $qualities)
     {
     {
+        if(count($qualities) <= 1) {
+            return true;
+        }
+
         $header = __METHOD__ . " mchid={$mchid} card_type={$card_type} spec={$spec}";
         $header = __METHOD__ . " mchid={$mchid} card_type={$card_type} spec={$spec}";
         [$ratio, $period] = $this->lower_ratio($mchid);
         [$ratio, $period] = $this->lower_ratio($mchid);
         [$_succ, $_fail, $gross_ratio] = $this->gross_ratio($mchid, $period);
         [$_succ, $_fail, $gross_ratio] = $this->gross_ratio($mchid, $period);
@@ -207,4 +308,26 @@ class mratio_control
         $can_next = $profit_judger($org_quality,$qualities,$prices,$dratios,$profit_ratio);
         $can_next = $profit_judger($org_quality,$qualities,$prices,$dratios,$profit_ratio);
         return !$can_next;
         return !$can_next;
     }
     }
+
+    public function need_intercept($mchid,$card_type,$card_state,$is_transfer) : bool
+    {
+        $mintercepts = $this->mInterceptConfig;
+        if(array_key_exists($mchid,$mintercepts))
+        {
+            $mintercepts = $mintercepts[$mchid];
+            if(!empty($mintercepts['card_states']) && in_array($card_state,$mintercepts['card_states'],true)) {
+                return true;
+            }
+
+            if(!empty($mintercepts['card_types']) && in_array($card_type,$mintercepts['card_types'],true)) {
+                return true;
+            }
+
+            if($mintercepts['is_transfer'] && $is_transfer) {
+                return true;
+            }
+        }
+
+        return false;
+    }
 }
 }

+ 4 - 4
helper/refill/policy/quaility.php

@@ -188,7 +188,7 @@ class Quality
         }
         }
 
 
         $qualities = $this->qualities($org_quality);
         $qualities = $this->qualities($org_quality);
-        $max_times = $this->max_times($mchid,$org_quality);
+        $max_times = $this->max_times($mchid,$org_quality,$qualities);
         if ($this->mRatioCtl->exist($mchid)) {
         if ($this->mRatioCtl->exist($mchid)) {
             Log::record("ratio_phone_quality exist=true",Log::DEBUG);
             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);
             $qualities = $this->ratio_phone_quality($org_quality, $qualities, $cur_quality, $times, $used_time, $mchid, $card_type, $spec);
@@ -202,7 +202,7 @@ class Quality
 
 
     private function ratio_phone_quality($org_quality,$qualities, $cur_quality, $times, $used_time, $mchid, $card_type, $spec)
     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,$qualities);
 
 
         $left_time = $time_out - $used_time;
         $left_time = $time_out - $used_time;
         if ($left_time <= 0 || $max_times <= $times) {
         if ($left_time <= 0 || $max_times <= $times) {
@@ -338,9 +338,9 @@ class Quality
 
 
     }
     }
 
 
-    private function max_times($mchid,$quality)
+    private function max_times($mchid,$quality,$qualities)
     {
     {
-        [$succ, $times,$secs] = $this->mRatioCtl->total($mchid);
+        [$succ, $times,$secs] = $this->mRatioCtl->total($mchid,$qualities);
         if ($succ) {
         if ($succ) {
             return $times;
             return $times;
         } else {
         } else {

+ 28 - 8
helper/refill/policy/xyz/policy.php

@@ -284,29 +284,34 @@ class policy extends ProviderManager implements IPolicy
         Log::record("GroupControl second 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;
+            $mixedQuality = $org_quality;
         }
         }
         else {
         else {
-            $fQuality = $cur_quality;
+            $mixedQuality = $cur_quality;
         }
         }
 
 
-        $price = $this->mPrices->price($mchid,$card_type,$spec,$fQuality,$pcode);
+        $price = $this->mPrices->price($mchid,$card_type,$spec,$mixedQuality,$pcode);
         if($price === false) {
         if($price === false) {
             return [[],false];
             return [[],false];
         }
         }
-        $extra_price = $this->mPrices->extra_price($mchid,$card_type,$spec,$fQuality,$pcode);
+
+        $extra_price = $this->mPrices->extra_price($mchid,$card_type,$spec,$mixedQuality,$pcode);
         $extra_price = $extra_price == false ? 0.00 : $extra_price;
         $extra_price = $extra_price == false ? 0.00 : $extra_price;
 
 
+        //以当前通道质量为准
+        $max_inprice = $this->mPrices->max_inprice($mchid,$card_type,$spec,$cur_quality,$pcode);
+        Log::record("max_price={$max_inprice}",Log::DEBUG);
+
         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)) {
-            $names = $this->mChannelControl->auto_match($names, $spec, $card_type, $cur_quality, $price - $extra_price, time() - $order_time);
+        if ($auto_find && in_array($card_type, $mobile_types, true) && in_array($cur_quality, $qualities, true)) {
+            $names = $this->mChannelControl->auto_match($names, $spec, $card_type, $cur_quality, $price - $extra_price, $max_inprice, time() - $order_time);
             Log::record("policy::find_providers ChannelControl auto_match quality={$cur_quality} spec={$spec} card_type={$card_type} result=" . implode(',', $names), Log::DEBUG);
             Log::record("policy::find_providers ChannelControl auto_match quality={$cur_quality} spec={$spec} card_type={$card_type} result=" . implode(',', $names), Log::DEBUG);
         } else {
         } else {
-            $names = $this->mChannelControl->match($names, $spec, $card_type, $cur_quality);
+            $names = $this->mChannelControl->match($names, $spec, $card_type, $cur_quality, $max_inprice);
             Log::record("policy::find_providers ChannelControl match quality={$cur_quality} spec={$spec} card_type={$card_type} result=" . implode(',', $names), Log::DEBUG);
             Log::record("policy::find_providers ChannelControl match quality={$cur_quality} spec={$spec} card_type={$card_type} result=" . implode(',', $names), Log::DEBUG);
         }
         }
 
 
@@ -332,6 +337,11 @@ class policy extends ProviderManager implements IPolicy
         return $this->mPrices->price($mchid,$card_type,$spec,$quality,$pcode);
         return $this->mPrices->price($mchid,$card_type,$spec,$quality,$pcode);
     }
     }
 
 
+    public function max_inprice($mchid, $spec, $card_type, $quality, $pcode)
+    {
+        return $this->mPrices->max_inprice($mchid,$card_type,$spec,$quality,$pcode);
+    }
+
     public function channeles(int $mchid, int $spec, int $card_type, int $quality, $regin_no)
     public function channeles(int $mchid, int $spec, int $card_type, int $quality, $regin_no)
     {
     {
         $providers = parent::get_providers($mchid, $spec, $card_type, $quality, $regin_no);
         $providers = parent::get_providers($mchid, $spec, $card_type, $quality, $regin_no);
@@ -388,11 +398,15 @@ class policy extends ProviderManager implements IPolicy
                 continue;
                 continue;
             }
             }
 
 
+            $max_inprice = $this->mPrices->max_inprice($mchid,$card_type,$spec,$quality,$pcode);
+            Log::record("max_price={$max_inprice}",Log::DEBUG);
+
+
             $providers = parent::get_providers($mchid, $spec, $card_type, $quality, $regin_no);
             $providers = parent::get_providers($mchid, $spec, $card_type, $quality, $regin_no);
             if(empty($providers)) continue;
             if(empty($providers)) continue;
 
 
             $names = $namer($providers);
             $names = $namer($providers);
-            $names = $this->mChannelControl->match($names, $spec, $card_type, $quality);
+            $names = $this->mChannelControl->match($names, $spec, $card_type, $quality, $max_inprice);
             if (!empty($names)) {
             if (!empty($names)) {
                 return [$org_quality, $quality];
                 return [$org_quality, $quality];
             } else {
             } else {
@@ -561,6 +575,12 @@ class policy extends ProviderManager implements IPolicy
         return $checker($url, "http://") || $checker($url, "https://");
         return $checker($url, "http://") || $checker($url, "https://");
     }
     }
 
 
+    public function need_intercept($mchid,$card_type,$card_state,$is_transfer) : bool
+    {
+        return $this->mRatioCtl->need_intercept($mchid,$card_type,$card_state,$is_transfer);
+
+    }
+
     public function update_ratios($ratios)
     public function update_ratios($ratios)
     {
     {
         $this->mChannelControl->update_ratios($ratios);
         $this->mChannelControl->update_ratios($ratios);

+ 4 - 4
helper/refill/util.php

@@ -648,15 +648,15 @@ class util
     //for tester
     //for tester
     public static function send_normal($order_sn)
     public static function send_normal($order_sn)
     {
     {
-        $status = mt_rand(1,10);
-        if($status > 9) {
+        $status = mt_rand(1,100);
+        if($status > 97) {
             $status = 1;
             $status = 1;
         } else {
         } else {
             $status = 0;
             $status = 0;
         }
         }
         $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(3);
             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);
@@ -680,7 +680,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(3);
             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);

+ 49 - 63
helper/statistics/stat_refill.php

@@ -153,47 +153,40 @@ class stat_refill
     {
     {
         $cond = [
         $cond = [
             'refill_order.inner_status' => 0,
             'refill_order.inner_status' => 0,
+            'vr_order.order_state' => ORDER_STATE_SUCCESS,
             "refill_order.{$order_time_type}&refill_order.{$order_time_type}" => ['_multi' => true, ['egt', $day_time], ['lt', $day_time + stat_refill::DaySecs]],
             "refill_order.{$order_time_type}&refill_order.{$order_time_type}" => ['_multi' => true, ['egt', $day_time], ['lt', $day_time + stat_refill::DaySecs]],
         ];
         ];
 
 
-        foreach ($this->mMerchantNames as $mchid => $cname)
-        {
-            $mchid = intval($mchid);
-            if($mchid <= 0) continue;
-            if($cur_mchid != 0 && $cur_mchid != $mchid) continue;
-            $cond['refill_order.mchid'] = $mchid;
-            $items = Model('')->table('refill_order,vr_order')
-                ->field('mchid, count(*) as order_count, sum(refill_amount) as refill_amounts, sum(channel_amount) as channel_amounts, sum(mch_amount) as mch_amounts, order_state')
-                ->join('inner')
-                ->on('refill_order.order_id=vr_order.order_id')
-                ->where($cond)
-                ->group('order_state')
-                ->select();
-            if(empty($items)) continue;
+        $items = Model('')->table('refill_order,vr_order')
+            ->field('mchid, count(*) as order_count, sum(refill_amount) as refill_amounts, sum(channel_amount) as channel_amounts, sum(mch_amount) as mch_amounts')
+            ->join('inner')
+            ->on('refill_order.order_id=vr_order.order_id')
+            ->where($cond)
+            ->group('mchid')
+            ->select();
 
 
+        foreach ($items as $item)
+        {
             $params = [];
             $params = [];
-
             $params['time_text'] = date("Y-m-d" , $day_time);
             $params['time_text'] = date("Y-m-d" , $day_time);
             $params['time_stamp'] = $day_time;
             $params['time_stamp'] = $day_time;
             $params['type'] = 'merchant';
             $params['type'] = 'merchant';
             $params['order_time_type'] = $order_time_type;
             $params['order_time_type'] = $order_time_type;
+
+            $mchid = intval($item['mchid']);
+            if($mchid <= 0) continue;
+            if($cur_mchid != 0 && $cur_mchid != $mchid) continue;
+
             $params['cid'] = $mchid;
             $params['cid'] = $mchid;
-            $params['cname'] = $cname;
-            foreach ($items as $item)
-            {
-                $order_state = $item['order_state'];
-                if ($order_state == ORDER_STATE_SUCCESS) {
-                    $params['success_count'] = $item['order_count'];
-                    $params['success_refill_amounts'] = $item['refill_amounts'];
-                    $params['success_channel_amounts'] = $item['channel_amounts'];
-                    $params['success_mch_amounts'] = $item['mch_amounts'];
-                    $params['profit_amounts'] = $item['mch_amounts'] - $item['channel_amounts'];
-                } elseif ($order_state == ORDER_STATE_CANCEL) {
-                    $params['cancel_count'] = $item['order_count'];
-                } else {
-                    $params['send_count'] = $item['order_count'];
-                }
-            }
+            if(!array_key_exists($mchid,$this->mMerchantNames)) continue;
+            $params['cname'] = $this->mMerchantNames[$mchid];
+
+            $params['success_count'] = $item['order_count'];
+            $params['success_refill_amounts'] = $item['refill_amounts'];
+            $params['success_channel_amounts'] = $item['channel_amounts'];
+            $params['success_mch_amounts'] = $item['mch_amounts'];
+            $params['profit_amounts'] = $item['mch_amounts'] - $item['channel_amounts'];
+
             if($cur_mchid != 0 && $cur_mchid == $mchid) {
             if($cur_mchid != 0 && $cur_mchid == $mchid) {
                 Model('')->table('refill_stats')->where(['time_stamp' => $day_time, 'cid' => $cur_mchid, 'type' => 'merchant', 'order_time_type' => $order_time_type])->update($params);
                 Model('')->table('refill_stats')->where(['time_stamp' => $day_time, 'cid' => $cur_mchid, 'type' => 'merchant', 'order_time_type' => $order_time_type])->update($params);
             }else{
             }else{
@@ -206,48 +199,41 @@ class stat_refill
     {
     {
         $cond = [
         $cond = [
             'refill_order.inner_status' => 0,
             'refill_order.inner_status' => 0,
+            'vr_order.order_state' => ORDER_STATE_SUCCESS,
             "refill_order.{$order_time_type}&refill_order.{$order_time_type}" => ['_multi' => true, ['egt', $day_time], ['lt', $day_time + stat_refill::DaySecs]],
             "refill_order.{$order_time_type}&refill_order.{$order_time_type}" => ['_multi' => true, ['egt', $day_time], ['lt', $day_time + stat_refill::DaySecs]],
         ];
         ];
 
 
-        foreach ($this->mProviderNames as $store_id => $cname)
-        {
-            $store_id = intval($store_id);
-            if($store_id <= 0) continue;
-            if($cur_storeid != 0 && $cur_storeid != $store_id) continue;
-
-            $cond['vr_order.store_id'] = $store_id;
-            $items = Model('')->table('refill_order,vr_order')
-                ->field('vr_order.store_id, count(*) as order_count, sum(refill_amount) as refill_amounts, sum(channel_amount) as channel_amounts, sum(mch_amount) as mch_amounts, order_state')
-                ->join('inner')
-                ->on('refill_order.order_id=vr_order.order_id')
-                ->where($cond)
-                ->group('order_state')
-                ->select();
-            if(empty($items)) continue;
+        $items = Model('')->table('refill_order,vr_order')
+            ->field('vr_order.store_id, count(*) as order_count, sum(refill_amount) as refill_amounts, sum(channel_amount) as channel_amounts, sum(mch_amount) as mch_amounts')
+            ->join('inner')
+            ->on('refill_order.order_id=vr_order.order_id')
+            ->where($cond)
+            ->group('vr_order.store_id')
+            ->select();
 
 
+        foreach ($items as $item)
+        {
             $params = [];
             $params = [];
             $params['time_text'] = date("Y-m-d" , $day_time);
             $params['time_text'] = date("Y-m-d" , $day_time);
             $params['time_stamp'] = $day_time;
             $params['time_stamp'] = $day_time;
             $params['type'] = 'provider';
             $params['type'] = 'provider';
             $params['order_time_type'] = $order_time_type;
             $params['order_time_type'] = $order_time_type;
+
+            $store_id = intval($item['store_id']);
+            if($store_id <= 0) continue;
+            if($cur_storeid != 0 && $cur_storeid != $store_id) continue;
+
             $params['cid'] = $store_id;
             $params['cid'] = $store_id;
-            $params['cname'] = $cname;
-
-            foreach ($items as $item)
-            {
-                $order_state = $item['order_state'];
-                if ($order_state == ORDER_STATE_SUCCESS) {
-                    $params['success_count'] = $item['order_count'];
-                    $params['success_refill_amounts'] = $item['refill_amounts'];
-                    $params['success_channel_amounts'] = $item['channel_amounts'];
-                    $params['success_mch_amounts'] = $item['mch_amounts'];
-                    $params['profit_amounts'] = $item['mch_amounts'] - $item['channel_amounts'];
-                } elseif ($order_state == ORDER_STATE_CANCEL) {
-                    $params['cancel_count'] = $item['order_count'];
-                } else {
-                    $params['send_count'] = $item['order_count'];
-                }
-            }
+            if(!array_key_exists($store_id,$this->mProviderNames)) continue;
+            $params['cname'] = $this->mProviderNames[$store_id];
+
+
+            $params['success_count'] = $item['order_count'];
+            $params['success_refill_amounts'] = $item['refill_amounts'];
+            $params['success_channel_amounts'] = $item['channel_amounts'];
+            $params['success_mch_amounts'] = $item['mch_amounts'];
+            $params['profit_amounts'] = $item['mch_amounts'] - $item['channel_amounts'];
+
             if($cur_storeid != 0 && $cur_storeid == $store_id) {
             if($cur_storeid != 0 && $cur_storeid == $store_id) {
                 Model('')->table('refill_stats')->where(['time_stamp' => $day_time, 'cid' => $cur_storeid, 'type' => 'provider', 'order_time_type' => $order_time_type])->update($params);
                 Model('')->table('refill_stats')->where(['time_stamp' => $day_time, 'cid' => $cur_storeid, 'type' => 'provider', 'order_time_type' => $order_time_type])->update($params);
             }else{
             }else{

+ 20 - 16
rdispatcher/proxy.php

@@ -46,7 +46,7 @@ class proxy
             return $this->onEerror($order, '空号或风险号');
             return $this->onEerror($order, '空号或风险号');
         }
         }
         if($this->need_intercept($order)) {
         if($this->need_intercept($order)) {
-            return $this->onEerror($order, '转网或者问题号码被拦截.');
+            return $this->onEerror($order, '转网,问题号码,运营商维护被拦截.');
         }
         }
 
 
         [$org_quality,$quality] = refill\RefillFactory::instance()->find_quality($order);
         [$org_quality,$quality] = refill\RefillFactory::instance()->find_quality($order);
@@ -105,22 +105,26 @@ class proxy
         $mchid = $order->mchid();
         $mchid = $order->mchid();
         $card_state = $order->card_state();
         $card_state = $order->card_state();
         $is_transfer = $order->is_transfer();
         $is_transfer = $order->is_transfer();
+        $is_transfer = $order->is_transfer();
+        $card_type = $order->card_type();
 
 
-        global $config;
-        $mintercepts = $config['merchant_intercept'] ?? [];
-        if(array_key_exists($mchid,$mintercepts))
-        {
-            $mintercepts = $mintercepts[$mchid];
-            if(in_array($card_state,$mintercepts['card_states'])) {
-                return true;
-            }
-
-            if($mintercepts['is_transfer'] && $is_transfer) {
-                return true;
-            }
-        }
-
-        return false;
+        return refill\RefillFactory::instance()->need_intercept($mchid,$card_type,$card_state,$is_transfer);
+
+//        global $config;
+//        $mintercepts = $config['merchant_intercept'] ?? [];
+//        if(array_key_exists($mchid,$mintercepts))
+//        {
+//            $mintercepts = $mintercepts[$mchid];
+//            if(in_array($card_state,$mintercepts['card_states'])) {
+//                return true;
+//            }
+//
+//            if($mintercepts['is_transfer'] && $is_transfer) {
+//                return true;
+//            }
+//        }
+//
+//        return false;
     }
     }
 
 
     private function canceled($mchid,$mch_order)
     private function canceled($mchid,$mch_order)

+ 3 - 2
test/TestExportOrder.php

@@ -10,7 +10,6 @@ define('BASE_ROOT_PATH', str_replace('/test', '', dirname(__FILE__)));
 require_once(BASE_ROOT_PATH . '/global.php');
 require_once(BASE_ROOT_PATH . '/global.php');
 require_once(BASE_CORE_PATH . '/lrlz.php');
 require_once(BASE_CORE_PATH . '/lrlz.php');
 require_once(BASE_ROOT_PATH . '/fooder.php');
 require_once(BASE_ROOT_PATH . '/fooder.php');
-require_once(BASE_HELPER_PATH . '/PHPExcel/PHPExcel.php');
 
 
 
 
 class TestExportOrder extends TestCase
 class TestExportOrder extends TestCase
@@ -75,6 +74,7 @@ class TestExportOrder extends TestCase
         fclose($fp);
         fclose($fp);
     }
     }
 
 
+<<<<<<< HEAD
     public function testRefillTask()
     public function testRefillTask()
     {
     {
         $model_refill_task = Model('refill_task');
         $model_refill_task = Model('refill_task');
@@ -246,9 +246,10 @@ class TestExportOrder extends TestCase
         return $orders;
         return $orders;
     }
     }
 
 
+=======
+>>>>>>> raccount
     public function testStrSer()
     public function testStrSer()
     {
     {
-        $str = 'a:4:{s:9:"qualities";a:3:{i:1;a:3:{s:8:"day_secs";i:3600;s:10:"night_secs";i:1800;s:5:"times";i:50;}i:2;a:3:{s:8:"day_secs";i:600;s:10:"night_secs";i:300;s:5:"times";i:10;}i:3;a:3:{s:8:"day_secs";i:900;s:10:"night_secs";i:600;s:5:"times";i:1;}}s:11:"lower_ratio";a:2:{s:5:"ratio";d:0.9;s:6:"period";i:3600;}s:12:"profit_ratio";d:0.03;s:6:"opened";b:1;}';
         $str = 'a:3:{s:11:"is_transfer";b:1;s:11:"card_states";a:2:{i:0;i:0;i:1;i:5;}s:10:"card_types";a:1:{i:0;i:4;}}';
         $str = 'a:3:{s:11:"is_transfer";b:1;s:11:"card_states";a:2:{i:0;i:0;i:1;i:5;}s:10:"card_types";a:1:{i:0;i:4;}}';
         $arr = unserialize($str);
         $arr = unserialize($str);
     }
     }

+ 8 - 9
test/TestRefill.php

@@ -940,17 +940,16 @@ class TestRefill extends TestCase
 
 
     public function testGuochuang_nation()
     public function testGuochuang_nation()
     {
     {
-        $providers = $this->getProvider('guochuang_nation');
+//        $providers = $this->getProvider('guochuang_nation');
 //        $resp = $providers->add(18500608333, 5, 1, ['order_sn' => $this->make_sn(), 'regin_no' => 1]);
 //        $resp = $providers->add(18500608333, 5, 1, ['order_sn' => $this->make_sn(), 'regin_no' => 1]);
-        $resp = $providers->query(['order_sn' => '4372390688043259849812']);
 
 
-//        $body = '{"account":"19982440060","evidence":"1000000083421102010443856304","evidenceType":"","id":"D2021102010210473815","inTime":"2021/10/20 10:31:14","money":"100","outerId":"1659990688040464576756","status":"SUCCESS"}';
-//        $params['ts'] = 1634697074;
-//        $params['sign'] = 'C93583DEF43208A26983BC5427CFFF12';
-//        $params['body'] = $body;
-//        $providers = $this->getProvider('guochuang_nation','RefillCallBack');
-//        $ret = $providers->verify($params);
-//        $resp = $providers->notify($params);
+        $body = '{"account":"18500608333","evidence":"N/A","evidenceType":"","id":"D2021090718185107657","inTime":"2021/09/07 18:19:05","money":"1","outerId":"65261631009929751933","status":"SUCCESS"}';
+        $params['ts'] = 1631009945;
+        $params['sign'] = 'C53F921EB5573EF4D0C757C5B5D4185D';
+        $params['body'] = $body;
+        $providers = $this->getProvider('guochuang_nation','RefillCallBack');
+        $ret = $providers->verify($params);
+        $resp = $providers->notify($params);
     }
     }
 
 
     public function testTianyanman()
     public function testTianyanman()

+ 0 - 6
test/TestRefillStats.php

@@ -24,12 +24,6 @@ class TestRefillStats extends TestCase
         $refill = new statistics\stat_refill();
         $refill = new statistics\stat_refill();
         $refill->run();
         $refill->run();
     }
     }
-
-    public function testMerchantStats()
-    {
-        $refill = new statistics\stat_refill();
-        $refill->merchant_stat(1617465600);
-    }
 }
 }
 
 
 //docker-compose run phpcli php /var/www/html/phpunit-9.2.5.phar --filter "/(TestRefillStats::testLatestDay)( .*)?$/" --test-suffix TestRefillStats.php /var/www/html/test
 //docker-compose run phpcli php /var/www/html/phpunit-9.2.5.phar --filter "/(TestRefillStats::testLatestDay)( .*)?$/" --test-suffix TestRefillStats.php /var/www/html/test

+ 2 - 2
test/TestRefillThird.php

@@ -122,7 +122,7 @@ class TestRefillThird extends TestCase
         $sender = function ()
         $sender = function ()
         {
         {
             $time = time();
             $time = time();
-            for ($i = 0; $i < 10000; $i++)
+            for ($i = 0; $i < 100; $i++)
             {
             {
                 $params = [ 'mchid' => 1092,
                 $params = [ 'mchid' => 1092,
                     'buyer_id' => 60221,
                     'buyer_id' => 60221,
@@ -141,7 +141,7 @@ class TestRefillThird extends TestCase
             }
             }
         };
         };
 
 
-        for ($i = 0;$i < 10; $i++) {
+        for ($i = 0;$i < 100; $i++) {
             $sender();
             $sender();
             sleep(2);
             sleep(2);
         }
         }