浏览代码

Merge branch 'raccount' into remit

xiaoyu 2 年之前
父节点
当前提交
15a0bd12a0
共有 42 个文件被更改,包括 1167 次插入691 次删除
  1. 26 7
      admin/control/refill_analysis.php
  2. 153 49
      admin/templates/default/analysis.new_version.mch_order_send.php
  3. 181 27
      admin/templates/default/analysis.new_version.provider.php
  4. 208 48
      admin/templates/default/analysis.new_version.system.php
  5. 43 11
      crontab/control/minutes.php
  6. 38 40
      data/config/xyz/refill.ini.php
  7. 30 32
      data/config/yl/refill.ini.php
  8. 10 0
      data/model/refill_detail.model.php
  9. 13 0
      docker/compose/workcuda/sdatacalc/docker-compose.yml
  10. 0 12
      docker/compose/workcuda/statsec/docker-compose.yml
  11. 12 1
      docker/compose/workcuda/slave-crond/docker-compose.yml
  12. 16 0
      docker/compose/yl/ylslave-crond/docker-compose.yml
  13. 二进制
      helper/refill/api/xyz/guochuang/20220705广东移动调价函.png
  14. 二进制
      helper/refill/api/xyz/guochuang/20220706辽宁移动调价函.png
  15. 二进制
      helper/refill/api/xyz/guochuang/20220708辽宁 青海 贵州调价函.png
  16. 二进制
      helper/refill/api/xyz/guochuang/20220710河南移动调价函.png
  17. 二进制
      helper/refill/api/xyz/guochuang/20220710辽宁移动调价函.png
  18. 二进制
      helper/refill/api/xyz/guochuang/20220711吉林移动调价函.png
  19. 5 5
      helper/refill/api/xyz/guochuang/config.php
  20. 17 23
      helper/refill/api/xyz/yamiao_high/config.php
  21. 23 30
      helper/refill/api/xyz/yamiao_high/开户信息.txt
  22. 17 23
      helper/refill/api/xyz/yamiao_normal/config.php
  23. 23 29
      helper/refill/api/xyz/yamiao_normal/开户信息.txt
  24. 17 19
      helper/refill/api/xyz/yunchonggong/config.php
  25. 26 9
      helper/refill/api/xyz/yunchonggong/开户信息.txt
  26. 15 57
      helper/refill/api/xyz/yunchonggongfs/config.php
  27. 22 11
      helper/refill/api/xyz/yunchonggongfs/开户信息.txt
  28. 5 5
      helper/refill/api/yl/guochuang/config.php
  29. 17 23
      helper/refill/api/yl/yamiao_high/config.php
  30. 23 30
      helper/refill/api/yl/yamiao_high/开户信息.txt
  31. 17 23
      helper/refill/api/yl/yamiao_normal/config.php
  32. 23 29
      helper/refill/api/yl/yamiao_normal/开户信息.txt
  33. 17 17
      helper/refill/api/yl/yunchonggong/config.php
  34. 12 10
      helper/refill/api/yl/yunchonggong/开户信息.txt
  35. 17 59
      helper/refill/api/yl/yunchonggongfs/config.php
  36. 12 11
      helper/refill/api/yl/yunchonggongfs/开户信息.txt
  37. 20 18
      plot/app.py
  38. 18 1
      plot/plot_control.py
  39. 13 3
      plot/refill/ChannelPainter.py
  40. 69 22
      plot/refill/MerchantPainter.py
  41. 5 3
      plot/refill/algorithm.py
  42. 4 4
      test/TestRefill.php

+ 26 - 7
admin/control/refill_analysis.php

@@ -3,7 +3,7 @@ include(BASE_CONFIG_PATH . CONFIG_PREFIX . '/refill.ini.php');
 require_once(BASE_ROOT_PATH . '/core/framework/function/http.php');
 class refill_analysisControl extends SystemControl
 {
-    private $ANALYSIS_URL = BASE_SITE_URL;
+    private $ANALYSIS_URL = 'https://ylweb.xyzshops.cn';
     
     public function __construct()
     {
@@ -200,13 +200,22 @@ class refill_analysisControl extends SystemControl
     {
         $cond = [];
         if(!empty($_GET['quality'])){
-//            echo json_encode([]);
             $cond['qualitys'] = $_GET['quality'];
         }
+        $url = $this->ANALYSIS_URL . '/plot/channels';
+        Log::record("analysis get provider_data url : {$url}", Log::DEBUG);
+        $resp = http_request($url);
+        preg_match_all('/[a-z]+_*[a-z]*/', $resp, $matches);
+        if(empty($resp) || empty($matches)) {
+            echo(json_encode(''));
+            return;
+        }
+        $cond['name'] = ['in', $matches[0]];
         $provider_list = $this->providers($cond);
+
         $result = [];
         foreach ($provider_list as $value) {
-            $data['name'] = $value['store_name'] ?? $value['name'];
+            $data['name'] = "{$value['store_name']}:{$value['name']}";
             $data['value'] = $value['name'];
             $result[] = $data;
         }
@@ -215,13 +224,23 @@ class refill_analysisControl extends SystemControl
 
     public function merchant_dataOp()
     {
-        $merchant_list = $this->merchants();
+        $cond = [];
+        $url = $this->ANALYSIS_URL . '/plot/mchids';
+        Log::record("analysis get merchant_data url : {$url}", Log::DEBUG);
+        $resp = http_request($url);
+        preg_match_all('/\d{2,6}/', $resp, $matches);
+        if(empty($resp) || empty($matches)) {
+            echo(json_encode(''));
+            return;
+        }
+        $cond['mchid'] = ['in', $matches[0]];
+        $merchant_list = $this->merchants($cond);
+
         $result = [];
         foreach ($merchant_list as $value) {
-            $data['name'] = $value['company_name'] ?? $value['name'];
+            $name = $value['company_name'] ?? $value['name'];
+            $data['name'] = $name .' : '. $value['mchid'] .'-'. $value['time_out'];
             $data['value'] = $value['mchid'];
-            $data['alpha'] = $value['alpha'];
-            $data['color'] = false;
             $result[] = $data;
         }
         echo json_encode($result);

+ 153 - 49
admin/templates/default/analysis.new_version.mch_order_send.php

@@ -1,3 +1,50 @@
+<style>
+    #checkChannel {
+        border-spacing: 0;
+        border-collapse: collapse;
+    }
+
+    #checkChannel td {
+        height: 20px;
+        padding: 2px;
+        background: #F3FBFE;
+        border: 1px solid #fff;
+        display: block;
+        white-space: nowrap;
+        font-size: 10px;
+    }
+
+    #checkChannel tr {
+        height: 20px;
+    }
+
+    #checkChannel thead tr {
+        table-layout: fixed;
+        top: 0;
+        left: 0;
+    }
+
+    #checkChannel tbody {
+        height: calc(100vh - 210px);
+        display: block;
+        overflow-y: scroll;
+    }
+
+    .echartsContent {
+        display: flex;
+        height: calc(100vh - 150px);
+    }
+
+    #echart {
+        flex: 1;
+        margin-left: 5px;
+    }
+
+    #echart img {
+        width: 100%;
+    }
+</style>
+
 <div class="page">
     <div class="fixed-bar">
         <div class="item-title">
@@ -21,16 +68,14 @@
             <tr>
                 <th><label for="query_start_time">统计时间</label></th>
                 <td>
-                    <input class="txt date" type="text" value="<?php echo $_GET['query_start_time']; ?>"
-                           id="startTime" name="query_start_time" autocomplete="off" style="width:120px" />
+                    <input class="txt date" type="text" value="<?php echo $_GET['query_start_time']; ?>" id="startTime" name="query_start_time" autocomplete="off" style="width:120px" />
                     <label for="query_start_time">~</label>
-                    <input class="txt date" type="text" value="<?php echo $_GET['query_end_time']; ?>"
-                           id="endTime" name="query_end_time" autocomplete="off" style="width:120px" />
+                    <input class="txt date" type="text" value="<?php echo $_GET['query_end_time']; ?>" id="endTime" name="query_end_time" autocomplete="off" style="width:120px" />
                 </td>
-                <th><label>机构选择</label></th>
+                <!-- <th><label>机构选择</label></th>
                 <td>
                     <div id="select_merchants"></div>
-                </td>
+                </td> -->
                 <th><label>卡类型</label></th>
                 <td>
                     <div id="select_cardtypes"></div>
@@ -63,13 +108,32 @@
                     </select>
                 </td>
                 <td>
-                    <a href="javascript:void(0);" id="ncsubmit" class="btn-search"
-                       title="<?php echo $lang['nc_query']; ?>">&nbsp;
+                    <a href="javascript:void(0);" id="ncsubmit" class="btn-search" title="<?php echo $lang['nc_query']; ?>">&nbsp;
                     </a>
                 </td>
             </tr>
         </table>
     </form>
+    <div class="echartsContent">
+        <table id="checkChannel">
+            <thead>
+                <tr>
+                    <td>
+                        <label>
+                            <input type="checkbox" id="checkAllChannel">
+                            编号(机构列表)
+                        </label>
+                    </td>
+                </tr>
+            </thead>
+            <tbody id="checkChannelContent">
+
+            </tbody>
+        </table>
+        <div id="echart">
+
+        </div>
+    </div>
     <div id="box">
         <!-- <iframe
             src="https://www.xyzshops.cn/plot/index?time_stamp=1621488600&interval=60" scrolling="no" id="Iframe" frameborder="0"></iframe> -->
@@ -77,15 +141,13 @@
 </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>
-<script type="text/javascript" src="<?php echo ADMIN_TEMPLATES_URL;?>/js/xm-select.js"></script>
-<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL;?>/refill/layer.js"></script>
-<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL;?>/refill/moment-with-locales.js"></script>
-<link rel="stylesheet" type="text/css"
-      href="<?php echo RESOURCE_SITE_URL; ?>/js/jquery-ui/themes/ui-lightness/jquery.ui.css"/>
+<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/js/jquery-ui/i18n/zh-CN.js" charset="utf-8"></script>
+<script type="text/javascript" src="<?php echo ADMIN_TEMPLATES_URL; ?>/js/xm-select.js"></script>
+<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/refill/layer.js"></script>
+<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/refill/moment-with-locales.js"></script>
+<link rel="stylesheet" type="text/css" href="<?php echo RESOURCE_SITE_URL; ?>/js/jquery-ui/themes/ui-lightness/jquery.ui.css" />
 <script type="text/javascript">
-    $(function () {
+    $(function() {
         laydate.render({
             elem: '#startTime',
             type: 'datetime'
@@ -95,26 +157,45 @@
             type: 'datetime'
         });
 
-        let select_merchants
-        $.get('index.php?act=refill_analysis&op=merchant_data', function (data) {
-            data = JSON.parse(data)
-            select_merchants = xmSelect.render({
-                el: '#select_merchants',
-                size: 'mini',
-                filterable: true,
-                style: {
-                    minHeight: '27px',
-                    lineHeight: '27px',
-                    marginLeft: '4px',
-                    width: '250px'
-                },
-                language: 'zn',
-                data: data
+        function formatChannelTable(tableData) {
+            let data;
+            if (typeof tableData == 'object') {
+                data = tableData;
+            } else {
+                data = JSON.parse(tableData)
+            }
+            let tableHTML = '';
+            data.map(item => {
+                tableHTML += `
+                    <tr>
+                        <td><label><input type="checkbox" name="channelValue"" value="${item.value}" />${item.name}</label></td>
+                    </tr>
+                `;
             })
+            $('#checkChannelContent').append(tableHTML);
+        }
+
+        // let select_merchants
+        $.get('index.php?act=refill_analysis&op=merchant_data', function(data) {
+            data = JSON.parse(data)
+            formatChannelTable(data)
+            // select_merchants = xmSelect.render({
+            //     el: '#select_merchants',
+            //     size: 'mini',
+            //     filterable: true,
+            //     style: {
+            //         minHeight: '27px',
+            //         lineHeight: '27px',
+            //         marginLeft: '4px',
+            //         width: '250px'
+            //     },
+            //     language: 'zn',
+            //     data: data
+            // })
         })
 
         let select_cardtypes
-        $.get('index.php?act=refill_analysis&op=card_type_data', function (data) {
+        $.get('index.php?act=refill_analysis&op=card_type_data', function(data) {
             data = JSON.parse(data)
             select_cardtypes = xmSelect.render({
                 el: '#select_cardtypes',
@@ -131,23 +212,48 @@
             })
         })
 
-        function select_set(selectArr){
+        function select_set(selectArr) {
             let selectStr = ''
             for (let i = 0; i < selectArr.length; i++) {
-                selectStr += selectArr[i].value+','
+                selectStr += selectArr[i].value + ','
             }
-            selectStr = selectStr.substr(0, selectStr.length-1)
+            selectStr = selectStr.substr(0, selectStr.length - 1)
             return selectStr
         }
 
-        $('#ncsubmit').click(function () {
+        $('#checkAllChannel').click(function() {
+            if ($(this).get(0).checked) {
+                $('input[name="channelValue"]').attr('checked', 'checked')
+            } else {
+                $('input[name="channelValue"]').removeAttr('checked')
+            }
+        })
+
+
+        $('#ncsubmit').click(function() {
             let query_start_time = $("input[name=query_start_time]").val()
-            let start_time = parseInt((new Date(query_start_time)).getTime()/1000);
+            let start_time = parseInt((new Date(query_start_time)).getTime() / 1000);
             let query_end_time = $("input[name=query_end_time]").val()
-            let end_time = parseInt((new Date(query_end_time)).getTime()/1000);
+            let end_time = parseInt((new Date(query_end_time)).getTime() / 1000);
 
-            let mchids = select_set(select_merchants.getValue())
-            let card_types = select_set(select_cardtypes.getValue())
+            if (!start_time && !end_time) {
+                start_time = Date.parse(new Date()) / 1000 - 7200;
+                end_time = Date.parse(new Date()) / 1000;
+            }
+
+            // let mchids = select_set(select_merchants.getValue())
+
+            let mchidList = [];
+            $('input[name="channelValue"]').each(function() {
+                if ($(this).attr('checked')) {
+                    mchidList.push($(this).attr('value'))
+                }
+            })
+
+            let mchids = mchidList.join(',');
+
+
+            let card_types = select_cardtypes && select_set(select_cardtypes.getValue())
             let spec = $("select[name=amount]").val()
             let filter_wave = $("select[name=filter_wave]").val()
             let src = window.location.origin + "/plot/mch_order_send?"
@@ -155,8 +261,7 @@
                 src += "&start_time=" + start_time;
             }
             if (end_time) {
-                if(end_time < start_time || !start_time)
-                {
+                if (end_time < start_time || !start_time) {
                     layer.msg('日期有误,结束日期需大于开始日期');
                     return
                 }
@@ -171,15 +276,14 @@
             if (spec) {
                 src += "&spec=" + spec;
             }
-            if(filter_wave > 0) {
+            if (filter_wave > 0) {
                 src += '&filter_wave=' + filter_wave;
             }
-            $.get(src, function (data){
-                if (!data) {
-                    return
-                }
-                $('#box').html(data)
+            $.get(src, function(data) {
+                $('#echart').html(data)
             });
         });
+
+        $('#ncsubmit').trigger('click');
     })
-</script>
+</script>

+ 181 - 27
admin/templates/default/analysis.new_version.provider.php

@@ -1,3 +1,51 @@
+<style>
+    #checkChannel {
+        border-spacing: 0;
+        border-collapse: collapse;
+    }
+
+    #checkChannel td {
+        min-width: 110px;
+        height: 20px;
+        padding: 2px;
+        background: #F3FBFE;
+        border: 1px solid #fff;
+        display: block;
+        white-space: nowrap;
+        font-size: 10px;
+    }
+
+    #checkChannel tr {
+        height: 20px;
+    }
+
+    #checkChannel thead tr {
+        table-layout: fixed;
+        top: 0;
+        left: 0;
+    }
+
+    #checkChannel tbody {
+        height: calc(100vh - 210px);
+        display: block;
+        overflow-y: scroll;
+    }
+
+    .echartsContent {
+        display: flex;
+        height: calc(100vh - 150px);
+    }
+
+    #echart {
+        flex: 1;
+        margin-left: 5px;
+    }
+
+    #echart img {
+        width: 100%;
+    }
+</style>
+
 <div class="page">
     <div class="fixed-bar">
         <div class="item-title">
@@ -29,6 +77,7 @@
                 <td>
                     <select name="quality" class="querySelect">
                         <option value=""><?php echo $lang['nc_please_choose']; ?></option>
+                        <option value="">全部</option>
                         <option value="<?php echo refill\Quality::Normal; ?>">普充(无流水)
                         </option>
                         <option value="<?php echo refill\Quality::Quick; ?>">快充
@@ -51,10 +100,6 @@
                         </option>
                     </select>
                 </td>
-                <th><label>通道选择</label></th>
-                <td>
-                    <div id="select_chnames"></div>
-                </td>
                 <th><label>卡类型</label></th>
                 <td>
                     <div id="select_cardtypes"></div>
@@ -92,6 +137,30 @@
                 </td>
             </tr>
         </table>
+
+        <div class="echartsContent">
+            <table id="checkChannel">
+                <thead>
+                    <tr>
+                        <td>
+                            <label>
+                                <input type="checkbox" id="checkAllChannel">
+                                编号(通道列表)
+                            </label>
+                        </td>
+                    </tr>
+                </thead>
+                <tbody id="checkChannelContent">
+
+                </tbody>
+            </table>
+            <div id="echart">
+
+            </div>
+        </div>
+
+
+
     </form>
     <div id="box">
         <!-- <iframe
@@ -110,6 +179,39 @@
 
         var provider = <?php echo json_encode($output['providers']) ?>
 
+        let ratios = [];
+
+        let qualitys = [];
+
+        const defaultChannelType = <?php echo refill\Quality::Normal; ?>;
+
+        $.get(`index.php?act=refill_analysis&op=provider_data`, function(data) {
+            data = JSON.parse(data)
+            if (data.length > 0) {
+                qualitys = data;
+                formatChannelTable(data);
+            }
+        })
+
+        function formatChannelTable(tableData) {
+            $('#checkChannelContent').children().remove();
+            let data;
+            if (typeof tableData == 'object') {
+                data = tableData;
+            } else {
+                data = JSON.parse(tableData)
+            }
+
+            let tableHTML = '';
+            data.map(item => {
+                tableHTML += `
+                    <tr>
+                        <td><label><input type="checkbox" name="channelValue" ${item.checked?'checked="checked"':''}  value="${item.value}" />${item.name}${item.ratio?`<span style="color:red;">(${item.ratio})</span>`:''}</label></td>
+                    </tr>
+                `;
+            })
+            $('#checkChannelContent').append(tableHTML);
+        }
 
         laydate.render({
             elem: '#startTime',
@@ -120,23 +222,6 @@
             type: 'datetime'
         });
 
-        let select_chnames
-        $.get('index.php?act=refill_analysis&op=provider_data', function(data) {
-            data = JSON.parse(data)
-            select_chnames = xmSelect.render({
-                el: '#select_chnames',
-                size: 'mini',
-                filterable: true,
-                style: {
-                    minHeight: '27px',
-                    lineHeight: '27px',
-                    marginLeft: '4px',
-                    width: '250px'
-                },
-                language: 'zn',
-                data: data
-            })
-        })
 
         let select_cardtypes
         $.get('index.php?act=refill_analysis&op=card_type_data', function(data) {
@@ -165,14 +250,70 @@
             return selectStr
         }
 
+        function updateQualityTable() {
+            const allQualityList = JSON.parse(JSON.stringify(qualitys));
+
+            allQualityList.map(item => {
+                item.checked = false;
+            })
+
+
+            function findItem(value) {
+                const item = allQualityList.filter(item => {
+                    return item.value == value;
+                })
+                if (item.length > 0) {
+                    return item[0].name
+                }
+                return false
+            }
+            const ratioList = ratios.map(item => {
+                return {
+                    name: findItem(item.split(':')[0]) || item.split(':')[0],
+                    value: item.split(':')[0],
+                    ratio: item.split(':')[1],
+                    checked: parseFloat(item.split(':')[1]) == 0 ? false : true
+                }
+            });
+
+
+            let mergeQualitys = [...ratioList, ...allQualityList];
+
+            const newArr = [];
+            const obj = {};
+
+            for (let i = 0; i < mergeQualitys.length; i++) {
+                if (!obj[mergeQualitys[i].value]) {
+                    newArr.push(mergeQualitys[i]);
+                    obj[mergeQualitys[i].value] = true;
+                }
+            }
+
+            formatChannelTable(newArr);
+        }
+
         $('#ncsubmit').click(function() {
             let query_start_time = $("input[name=query_start_time]").val()
             let start_time = parseInt((new Date(query_start_time)).getTime() / 1000);
             let query_end_time = $("input[name=query_end_time]").val()
             let end_time = parseInt((new Date(query_end_time)).getTime() / 1000);
 
-            let chnames = select_set(select_chnames.getValue())
-            let card_types = select_set(select_cardtypes.getValue())
+            if (!start_time && !end_time) {
+                start_time = Date.parse(new Date()) / 1000 - 7200;
+                end_time = Date.parse(new Date()) / 1000;
+            }
+
+            let chnamesList = [];
+            $('input[name="channelValue"]').each(function() {
+                if ($(this).attr('checked')) {
+                    chnamesList.push($(this).attr('value'))
+                }
+            })
+
+            let chnames = chnamesList.join(',');
+
+
+            let card_types = select_cardtypes && select_set(select_cardtypes.getValue())
             let spec = $("select[name=amount]").val()
             let filter_wave = $("select[name=filter_wave]").val()
             let src = window.location.origin + "/plot/ch_ratio?"
@@ -198,12 +339,25 @@
             if (filter_wave > 0) {
                 src += '&filter_wave=' + filter_wave;
             }
-            $.get(src, function(data) {
-                if (!data) {
-                    return
+            $.get(src, function(data)
+            {
+                if (data.state == 'success') {
+                    $('#echart').html(`<img src='data:image/png;base64,${data.img}'/>`)
+                    ratios = data.ratios;
+                    updateQualityTable()
                 }
-                $('#box').html(data)
             });
         });
+
+        $('#checkAllChannel').click(function() {
+            if ($(this).get(0).checked) {
+                $('input[name="channelValue"]').attr('checked', 'checked')
+            } else {
+                $('input[name="channelValue"]').removeAttr('checked')
+            }
+        })
+
+        $('.querySelect').trigger('change');
+        $('#ncsubmit').trigger('click');
     })
 </script>

+ 208 - 48
admin/templates/default/analysis.new_version.system.php

@@ -1,3 +1,49 @@
+<style>
+    #checkChannel {
+        border-spacing: 0;
+        border-collapse: collapse;
+    }
+
+    #checkChannel td {
+        height: 20px;
+        padding: 2px;
+        background: #F3FBFE;
+        border: 1px solid #fff;
+        display: block;
+        white-space: nowrap;
+        font-size: 10px;
+    }
+
+    #checkChannel tr {
+        height: 20px;
+    }
+
+    #checkChannel thead tr {
+        table-layout: fixed;
+        top: 0;
+        left: 0;
+    }
+
+    #checkChannel tbody {
+        height: calc(100vh - 210px);
+        display: block;
+        overflow-y: scroll;
+    }
+
+    .echartsContent {
+        display: flex;
+        height: calc(100vh - 150px);
+    }
+
+    #echart {
+        flex: 1;
+        margin-left: 5px;
+    }
+
+    #echart img {
+        width: 100%;
+    }
+</style>
 <div class="page">
     <div class="fixed-bar">
         <div class="item-title">
@@ -21,16 +67,14 @@
             <tr>
                 <th><label for="query_start_time">统计时间</label></th>
                 <td>
-                    <input class="txt date" type="text" value="<?php echo $_GET['query_start_time']; ?>"
-                           id="startTime" name="query_start_time" autocomplete="off" style="width:120px" />
+                    <input class="txt date" type="text" value="<?php echo $_GET['query_start_time']; ?>" id="startTime" name="query_start_time" autocomplete="off" style="width:120px" />
                     <label for="query_start_time">~</label>
-                    <input class="txt date" type="text" value="<?php echo $_GET['query_end_time']; ?>"
-                           id="endTime" name="query_end_time" autocomplete="off" style="width:120px" />
+                    <input class="txt date" type="text" value="<?php echo $_GET['query_end_time']; ?>" id="endTime" name="query_end_time" autocomplete="off" style="width:120px" />
                 </td>
-                <th><label>机构选择</label></th>
+                <!-- <th><label>机构选择</label></th>
                 <td>
                     <div id="select_merchants"></div>
-                </td>
+                </td> -->
                 <th><label>卡类型</label></th>
                 <td>
                     <div id="select_cardtypes"></div>
@@ -63,13 +107,34 @@
                     </select>
                 </td>
                 <td>
-                    <a href="javascript:void(0);" id="ncsubmit" class="btn-search"
-                       title="<?php echo $lang['nc_query']; ?>">&nbsp;
+                    <a href="javascript:void(0);" id="ncsubmit" class="btn-search" title="<?php echo $lang['nc_query']; ?>">&nbsp;
                     </a>
                 </td>
             </tr>
         </table>
     </form>
+
+    <div class="echartsContent">
+        <table id="checkChannel">
+            <thead>
+                <tr>
+                    <td>
+                        <label>
+                            <input type="checkbox" id="checkAllChannel">
+                            编号(机构列表)
+                        </label>
+                    </td>
+                </tr>
+            </thead>
+            <tbody id="checkChannelContent">
+
+            </tbody>
+        </table>
+        <div id="echart">
+
+        </div>
+    </div>
+
     <div id="box">
         <!-- <iframe
             src="https://www.xyzshops.cn/plot/index?time_stamp=1621488600&interval=60" scrolling="no" id="Iframe" frameborder="0"></iframe> -->
@@ -77,15 +142,19 @@
 </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>
-<script type="text/javascript" src="<?php echo ADMIN_TEMPLATES_URL;?>/js/xm-select.js"></script>
-<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL;?>/refill/layer.js"></script>
-<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL;?>/refill/moment-with-locales.js"></script>
-<link rel="stylesheet" type="text/css"
-      href="<?php echo RESOURCE_SITE_URL; ?>/js/jquery-ui/themes/ui-lightness/jquery.ui.css"/>
+<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/js/jquery-ui/i18n/zh-CN.js" charset="utf-8"></script>
+<script type="text/javascript" src="<?php echo ADMIN_TEMPLATES_URL; ?>/js/xm-select.js"></script>
+<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/refill/layer.js"></script>
+<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/refill/moment-with-locales.js"></script>
+<link rel="stylesheet" type="text/css" href="<?php echo RESOURCE_SITE_URL; ?>/js/jquery-ui/themes/ui-lightness/jquery.ui.css" />
 <script type="text/javascript">
-    $(function () {
+    $(function() {
+
+        let ratios = [];
+
+        let qualitys = [];
+
+
         laydate.render({
             elem: '#startTime',
             type: 'datetime'
@@ -95,26 +164,91 @@
             type: 'datetime'
         });
 
-        let select_merchants
-        $.get('index.php?act=refill_analysis&op=merchant_data', function (data) {
-            data = JSON.parse(data)
-            select_merchants = xmSelect.render({
-                el: '#select_merchants',
-                size: 'mini',
-                filterable: true,
-                style: {
-                    minHeight: '27px',
-                    lineHeight: '27px',
-                    marginLeft: '4px',
-                    width: '250px'
-                },
-                language: 'zn',
-                data: data
+
+
+        function formatChannelTable(tableData) {
+            $('#checkChannelContent').children().remove();
+            let data;
+            if (typeof tableData == 'object') {
+                data = tableData;
+            } else {
+                data = JSON.parse(tableData)
+            }
+            let tableHTML = '';
+            data.map(item => {
+                tableHTML += `
+                    <tr>
+                        <td><label><input type="checkbox" name="channelValue" ${item.checked?'checked="checked"':''}  value="${item.value}" />${item.name}${item.ratio?`<span style="color:red;">(${item.ratio})</span>`:''}</label></td>
+                    </tr>
+                `;
             })
+            $('#checkChannelContent').append(tableHTML);
+        }
+
+        function updateQualityTable() {
+            const allQualityList = JSON.parse(JSON.stringify(qualitys));
+
+            allQualityList.map(item => {
+                item.checked = false;
+            })
+
+
+            function findItem(value) {
+                const item = allQualityList.filter(item => {
+                    return item.value == value;
+                })
+                if (item.length > 0) {
+                    return item[0].name
+                }
+                return false
+            }
+            const ratioList = ratios.map(item => {
+                return {
+                    name: findItem(item.split(':')[0]) || item.split(':')[0],
+                    value: item.split(':')[0],
+                    ratio: item.split(':')[1],
+                    checked: parseFloat(item.split(':')[1]) == 0 ? false : true
+                }
+            });
+
+
+            let mergeQualitys = [...ratioList, ...allQualityList];
+
+            const newArr = [];
+            const obj = {};
+
+            for (let i = 0; i < mergeQualitys.length; i++) {
+                if (!obj[mergeQualitys[i].value]) {
+                    newArr.push(mergeQualitys[i]);
+                    obj[mergeQualitys[i].value] = true;
+                }
+            }
+
+            formatChannelTable(newArr);
+        }
+
+        // let select_merchants
+        $.get('index.php?act=refill_analysis&op=merchant_data', function(data) {
+            data = JSON.parse(data)
+            qualitys = data;
+            formatChannelTable(data)
+            // select_merchants = xmSelect.render({
+            //     el: '#select_merchants',
+            //     size: 'mini',
+            //     filterable: true,
+            //     style: {
+            //         minHeight: '27px',
+            //         lineHeight: '27px',
+            //         marginLeft: '4px',
+            //         width: '250px'
+            //     },
+            //     language: 'zn',
+            //     data: data
+            // })
         })
 
         let select_cardtypes
-        $.get('index.php?act=refill_analysis&op=card_type_data', function (data) {
+        $.get('index.php?act=refill_analysis&op=card_type_data', function(data) {
             data = JSON.parse(data)
             select_cardtypes = xmSelect.render({
                 el: '#select_cardtypes',
@@ -131,23 +265,47 @@
             })
         })
 
-        function select_set(selectArr){
+        function select_set(selectArr) {
             let selectStr = ''
             for (let i = 0; i < selectArr.length; i++) {
-                selectStr += selectArr[i].value+','
+                selectStr += selectArr[i].value + ','
             }
-            selectStr = selectStr.substr(0, selectStr.length-1)
+            selectStr = selectStr.substr(0, selectStr.length - 1)
             return selectStr
         }
 
-        $('#ncsubmit').click(function () {
+        $('#checkAllChannel').click(function() {
+            if ($(this).get(0).checked) {
+                $('input[name="channelValue"]').attr('checked', 'checked')
+            } else {
+                $('input[name="channelValue"]').removeAttr('checked')
+            }
+        })
+
+        $('#ncsubmit').click(function() {
             let query_start_time = $("input[name=query_start_time]").val()
-            let start_time = parseInt((new Date(query_start_time)).getTime()/1000);
+            let start_time = parseInt((new Date(query_start_time)).getTime() / 1000);
             let query_end_time = $("input[name=query_end_time]").val()
-            let end_time = parseInt((new Date(query_end_time)).getTime()/1000);
+            let end_time = parseInt((new Date(query_end_time)).getTime() / 1000);
+
+            if (!start_time && !end_time) {
+                start_time = Date.parse(new Date()) / 1000 - 7200;
+                end_time = Date.parse(new Date()) / 1000;
+            }
 
-            let mchids = select_set(select_merchants.getValue())
-            let card_types = select_set(select_cardtypes.getValue())
+
+            // let mchids = select_set(select_merchants.getValue())
+            let mchidList = [];
+            $('input[name="channelValue"]').each(function() {
+                if ($(this).attr('checked')) {
+                    mchidList.push($(this).attr('value'))
+                }
+            })
+
+            let mchids = mchidList.join(',');
+
+
+            let card_types = select_cardtypes && select_set(select_cardtypes.getValue())
             let spec = $("select[name=amount]").val()
             let filter_wave = $("select[name=filter_wave]").val()
             let src = window.location.origin + "/plot/mch_ratio?"
@@ -155,8 +313,7 @@
                 src += "&start_time=" + start_time;
             }
             if (end_time) {
-                if(end_time < start_time || !start_time)
-                {
+                if (end_time < start_time || !start_time) {
                     layer.msg('日期有误,结束日期需大于开始日期');
                     return
                 }
@@ -171,15 +328,18 @@
             if (spec) {
                 src += "&spec=" + spec;
             }
-            if(filter_wave > 0) {
+            if (filter_wave > 0) {
                 src += '&filter_wave=' + filter_wave;
             }
-            $.get(src, function (data){
-                if (!data) {
-                    return
+            $.get(src, function(data) {
+                if (data.state == 'success') {
+                    $('#echart').html(`<img src='data:image/png;base64,${data.img}'/>`)
+                    ratios = data.ratios;
+                    updateQualityTable()
                 }
-                $('#box').html(data)
             });
         });
+
+        $('#ncsubmit').trigger('click');
     })
-</script> 
+</script>

+ 43 - 11
crontab/control/minutes.php

@@ -435,6 +435,37 @@ class minutesControl extends BaseCronControl
         }
     }
 
+    //更新统计业务数据
+    public function stat_utilOp()
+    {
+        Log::short_name('stat_util');
+
+        while (true)
+        {
+            try {
+                $this->stat_util();
+            } catch (Exception $ex) {
+                Log::record($ex->getMessage(), Log::ERR);
+            }
+            sleep(1);
+        }
+    }
+
+    private function stat_util()
+    {
+        $update_earlist_sendtime = function () {
+            $mod = Model('refill_detail');
+            $time = $mod->getLatestSendTime();
+            wcache('latest_sending', ['order_time' => $time], 'refill-stat-');
+
+            Log::record("latest_send_time={$time}",Log::DEBUG);
+        };
+
+
+        $update_earlist_sendtime();
+
+    }
+
     /**
      * 执行通用任务
      */
@@ -478,19 +509,18 @@ class minutesControl extends BaseCronControl
             $method = '_cron_'.$k;
             Log::record("crontab minutest:{$method}",Log::DEBUG);
 
-            $result = call_user_func_array([$this,'_cron_'.$k], [$v]);
-            if (is_array($result)){
-                $cronid = array_merge($cronid,$result);
-            }
-            else {
-                $method = '_cron_'.$k;
-                Log::record("crontab minutest err:{$method}",Log::ERR);
+            $result = call_user_func_array([$this, '_cron_' . $k], [$v]);
+            if (is_array($result)) {
+                $cronid = array_merge($cronid, $result);
+            } else {
+                $method = '_cron_' . $k;
+                Log::record("crontab minutest err:{$method}", Log::ERR);
             }
         }
 
         //删除执行完成的cron信息
-        if (!empty($cronid) && is_array($cronid)){
-            $model_cron->delCron(['id'=> ['in',$cronid]]);
+        if (!empty($cronid) && is_array($cronid)) {
+            $model_cron->delCron(['id' => ['in', $cronid]]);
         }
 
         return true;
@@ -503,13 +533,15 @@ class minutesControl extends BaseCronControl
     {
         $condition = ['goods_commonid' => ['in',array_keys($cron)]];
         $update = Model('goods')->editProducesOnline($condition);
-        if ($update){
+        if ($update)
+        {
             //返回执行成功的cronid
             $cronid = [];
             foreach ($cron as $v) {
                 $cronid[] = $v['id'];
             }
-        } else {
+        }
+        else {
             return false;
         }
         return $cronid;

+ 38 - 40
data/config/xyz/refill.ini.php

@@ -1649,24 +1649,24 @@ $yunchonggong_phone = ['name' => 'yunchonggong', 'store_id' => 87,'qualitys' =>
 //            ['goods_id' => 6798, 'price' => 18.94, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
 //        ],
         30 => [
-            ['goods_id' => 6799, 'price' => 28.74, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6799, 'price' => 28.53, 'quality' => 1, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 6799, 'price' => 28.35, 'quality' => 1, 'card_type' => 'chinatelecom']
+            ['goods_id' => 6799, 'price' => 28.8, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6799, 'price' => 28.35, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 6799, 'price' => 28.5, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         50 => [
-            ['goods_id' => 6800, 'price' => 47.9, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6800, 'price' => 47.55, 'quality' => 1, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 6800, 'price' => 47.25, 'quality' => 1, 'card_type' => 'chinatelecom']
+            ['goods_id' => 6800, 'price' => 48, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6800, 'price' => 47.25, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 6800, 'price' => 47.5, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         100 => [
-            ['goods_id' => 6801, 'price' => 95.8, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6801, 'price' => 95.1, 'quality' => 1, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 6801, 'price' => 94.5, 'quality' => 1, 'card_type' => 'chinatelecom']
+            ['goods_id' => 6801, 'price' => 96, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6801, 'price' => 94.5, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 6801, 'price' => 95, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         200 => [
-            ['goods_id' => 6802, 'price' => 191.6, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6802, 'price' => 190.2, 'quality' => 1, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 6802, 'price' => 189, 'quality' => 1, 'card_type' => 'chinatelecom']
+            ['goods_id' => 6802, 'price' => 192, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6802, 'price' => 189, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 6802, 'price' => 190, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
 //        300 => [
 //            ['goods_id' => 6803, 'price' => 288, 'quality' => 1, 'card_type' => 'chinamobile'],
@@ -2892,22 +2892,22 @@ $chizeng_phone = ['name' => 'chizeng', 'store_id' => 133, 'qualitys' => '1',
 //            ['goods_id' => 7148, 'price' => 19, 'quality' => 1, 'card_type' => 'chinatelecom']
 //        ],
         30 => [
-            ['goods_id' => 7149, 'price' => 28.8, 'quality' => 1, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 7149, 'price' => 28.8, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 7149, 'price' => 28.8, 'quality' => 1, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7149, 'price' => 28.8, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         50 => [
-            ['goods_id' => 7150, 'price' => 48, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 7150, 'price' => 48.25, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 7150, 'price' => 48, 'quality' => 1, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7150, 'price' => 48, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         100 => [
-            ['goods_id' => 7151, 'price' => 96, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 7151, 'price' => 96.5, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 7151, 'price' => 96, 'quality' => 1, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7151, 'price' => 96, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         200 => [
-            ['goods_id' => 7152, 'price' => 192, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 7152, 'price' => 193, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 7152, 'price' => 192, 'quality' => 1, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7152, 'price' => 192, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
@@ -3265,14 +3265,14 @@ $dashang_normal_phone = ['name' => 'dashang_normal', 'store_id' => 148, 'quality
 
 $yunchonggongfs_phone = ['name' => 'yunchonggongfs', 'store_id' => 149,'qualitys' => '1',
     'amount' => [
-        10 => [['goods_id' => 7275, 'price' => 9.41, 'quality' => 1, 'card_type' => 'chinamobile']],
-        20 => [['goods_id' => 7276, 'price' => 18.82, 'quality' => 1, 'card_type' => 'chinamobile']],
+//        10 => [['goods_id' => 7275, 'price' => 9.41, 'quality' => 1, 'card_type' => 'chinamobile']],
+//        20 => [['goods_id' => 7276, 'price' => 18.82, 'quality' => 1, 'card_type' => 'chinamobile']],
         30 => [['goods_id' => 7277, 'price' => 28.23, 'quality' => 1, 'card_type' => 'chinamobile']],
         50 => [['goods_id' => 7278, 'price' => 47.05, 'quality' => 1, 'card_type' => 'chinamobile']],
         100 => [['goods_id' => 7279, 'price' => 94.1, 'quality' => 1, 'card_type' => 'chinamobile']],
         200 => [['goods_id' => 7280, 'price' => 188.2, 'quality' => 1, 'card_type' => 'chinamobile']],
-        300 => [['goods_id' => 7281, 'price' => 282.3, 'quality' => 1, 'card_type' => 'chinamobile']],
-        500 => [['goods_id' => 7282, 'price' => 470.5, 'quality' => 1, 'card_type' => 'chinamobile']]
+//        300 => [['goods_id' => 7281, 'price' => 282.3, 'quality' => 1, 'card_type' => 'chinamobile']],
+//        500 => [['goods_id' => 7282, 'price' => 470.5, 'quality' => 1, 'card_type' => 'chinamobile']]
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 
@@ -3403,13 +3403,13 @@ $guantu_phone = ['name' => 'guantu', 'store_id' => 157, 'qualitys' => '1',
 $yiqian_phone = ['name' => 'yiqian', 'store_id' => 158,'qualitys' => '2',
     'amount' => [
         10 => [
-//            ['goods_id' => 7333, 'price' => 10.38, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 7333, 'price' => 10.335, 'quality' => 2, 'card_type' => 'chinamobile'],
             ['goods_id' => 7333, 'price' => 10.07, 'quality' => 2, 'card_type' => 'chinaunicom'],
 //            ['goods_id' => 7333, 'price' => 9.985, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
 
         20 => [
-//            ['goods_id' => 7334, 'price' => 20.76, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 7334, 'price' => 20.67, 'quality' => 2, 'card_type' => 'chinamobile'],
             ['goods_id' => 7334, 'price' => 20.1, 'quality' => 2, 'card_type' => 'chinaunicom'],
 //            ['goods_id' => 7334, 'price' => 19.97, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
@@ -3999,8 +3999,8 @@ $yamiao_high_phone = ['name' => 'yamiao_high', 'store_id' => 171, 'qualitys' =>
             ['goods_id' => 7460, 'price' => 193, 'quality' => 1, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7460, 'price' => 193, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
-        300 => [['goods_id' => 7461, 'price' => 289.5, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        500 => [['goods_id' => 7462, 'price' => 482.5, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']]
+//        300 => [['goods_id' => 7461, 'price' => 289.5, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+//        500 => [['goods_id' => 7462, 'price' => 482.5, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']]
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 
@@ -4009,37 +4009,35 @@ $yamiao_normal_phone = ['name' => 'yamiao_normal', 'store_id' => 172, 'qualitys'
 //        10 => [['goods_id' => 7463, 'price' => 9.55, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
 //        20 => [['goods_id' => 7464, 'price' => 19.1, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
         30 => [
-            ['goods_id' => 7465, 'price' => 28.71, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 7465, 'price' => 28.8, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 7465, 'price' => 28.65, 'quality' => 1, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7465, 'price' => 28.38, 'quality' => 1, 'card_type' => 'chinatelecom'],
         ],
         50 => [
-            ['goods_id' => 7466, 'price' => 47.85, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 7466, 'price' => 48, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 7466, 'price' => 47.75, 'quality' => 1, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7466, 'price' => 47.3, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         100 => [
-            ['goods_id' => 7467, 'price' => 95.7, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 7467, 'price' => 96, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 7467, 'price' => 95.5, 'quality' => 1, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7467, 'price' => 94.6, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         200 => [
-            ['goods_id' => 7468, 'price' => 191.4, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 7468, 'price' => 192, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 7468, 'price' => 191, 'quality' => 1, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7468, 'price' => 189.2, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
-        300 => [
-            ['goods_id' => 7469, 'price' => 287.7, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 7469, 'price' => 286.5, 'quality' => 1, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 7469, 'price' => 285, 'quality' => 1, 'card_type' => 'chinatelecom']
-
-        ],
-        500 => [
-            ['goods_id' => 7470, 'price' => 479.5, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 7470, 'price' => 477.5, 'quality' => 1, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 7470, 'price' => 475, 'quality' => 1, 'card_type' => 'chinatelecom']
-
-        ]
+//        300 => [
+//            ['goods_id' => 7469, 'price' => 287.7, 'quality' => 1, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 7469, 'price' => 286.5, 'quality' => 1, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 7469, 'price' => 285, 'quality' => 1, 'card_type' => 'chinatelecom']
+//        ],
+//        500 => [
+//            ['goods_id' => 7470, 'price' => 479.5, 'quality' => 1, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 7470, 'price' => 477.5, 'quality' => 1, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 7470, 'price' => 475, 'quality' => 1, 'card_type' => 'chinatelecom']
+//        ]
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 

+ 30 - 32
data/config/yl/refill.ini.php

@@ -1657,23 +1657,23 @@ $yunchonggong_phone = ['name' => 'yunchonggong', 'store_id' => 87,'qualitys' =>
 //            ['goods_id' => 6798, 'price' => 18.94, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
 //        ],
         30 => [
-            ['goods_id' => 6799, 'price' => 28.74, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6799, 'price' => 28.53, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 6799, 'price' => 28.8, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6799, 'price' => 28.35, 'quality' => 1, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6799, 'price' => 28.5, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         50 => [
-            ['goods_id' => 6800, 'price' => 47.9, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6800, 'price' => 47.55, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 6800, 'price' => 48, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6800, 'price' => 47.25, 'quality' => 1, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6800, 'price' => 47.5, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         100 => [
-            ['goods_id' => 6801, 'price' => 95.8, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6801, 'price' => 95.1, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 6801, 'price' => 96, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6801, 'price' => 94.5, 'quality' => 1, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6801, 'price' => 95, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         200 => [
-            ['goods_id' => 6802, 'price' => 191.6, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6802, 'price' => 190.2, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 6802, 'price' => 192, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6802, 'price' => 189, 'quality' => 1, 'card_type' => 'chinaunicom'],
             ['goods_id' => 6802, 'price' => 190, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
 //        300 => [
@@ -2900,22 +2900,22 @@ $chizeng_phone = ['name' => 'chizeng', 'store_id' => 133, 'qualitys' => '1',
 //            ['goods_id' => 7148, 'price' => 19, 'quality' => 1, 'card_type' => 'chinatelecom']
 //        ],
         30 => [
-            ['goods_id' => 7149, 'price' => 28.8, 'quality' => 1, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 7149, 'price' => 28.8, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 7149, 'price' => 28.8, 'quality' => 1, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7149, 'price' => 28.8, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         50 => [
-            ['goods_id' => 7150, 'price' => 48, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 7150, 'price' => 48.25, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 7150, 'price' => 48, 'quality' => 1, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7150, 'price' => 48, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         100 => [
-            ['goods_id' => 7151, 'price' => 96, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 7151, 'price' => 96.5, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 7151, 'price' => 96, 'quality' => 1, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7151, 'price' => 96, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         200 => [
-            ['goods_id' => 7152, 'price' => 192, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 7152, 'price' => 193, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 7152, 'price' => 192, 'quality' => 1, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7152, 'price' => 192, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
@@ -3275,14 +3275,14 @@ $dashang_normal_phone = ['name' => 'dashang_normal', 'store_id' => 148, 'quality
 
 $yunchonggongfs_phone = ['name' => 'yunchonggongfs', 'store_id' => 149,'qualitys' => '1',
     'amount' => [
-        10 => [['goods_id' => 7275, 'price' => 9.41, 'quality' => 1, 'card_type' => 'chinamobile']],
-        20 => [['goods_id' => 7276, 'price' => 18.82, 'quality' => 1, 'card_type' => 'chinamobile']],
+//        10 => [['goods_id' => 7275, 'price' => 9.41, 'quality' => 1, 'card_type' => 'chinamobile']],
+//        20 => [['goods_id' => 7276, 'price' => 18.82, 'quality' => 1, 'card_type' => 'chinamobile']],
         30 => [['goods_id' => 7277, 'price' => 28.23, 'quality' => 1, 'card_type' => 'chinamobile']],
         50 => [['goods_id' => 7278, 'price' => 47.05, 'quality' => 1, 'card_type' => 'chinamobile']],
         100 => [['goods_id' => 7279, 'price' => 94.1, 'quality' => 1, 'card_type' => 'chinamobile']],
         200 => [['goods_id' => 7280, 'price' => 188.2, 'quality' => 1, 'card_type' => 'chinamobile']],
-        300 => [['goods_id' => 7281, 'price' => 282.3, 'quality' => 1, 'card_type' => 'chinamobile']],
-        500 => [['goods_id' => 7282, 'price' => 470.5, 'quality' => 1, 'card_type' => 'chinamobile']]
+//        300 => [['goods_id' => 7281, 'price' => 282.3, 'quality' => 1, 'card_type' => 'chinamobile']],
+//        500 => [['goods_id' => 7282, 'price' => 470.5, 'quality' => 1, 'card_type' => 'chinamobile']]
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 
@@ -3413,13 +3413,13 @@ $guantu_phone = ['name' => 'guantu', 'store_id' => 157, 'qualitys' => '1',
 $yiqian_phone = ['name' => 'yiqian', 'store_id' => 158,'qualitys' => '2',
     'amount' => [
         10 => [
-//            ['goods_id' => 7333, 'price' => 10.38, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 7333, 'price' => 10.335, 'quality' => 2, 'card_type' => 'chinamobile'],
             ['goods_id' => 7333, 'price' => 10.07, 'quality' => 2, 'card_type' => 'chinaunicom'],
 //            ['goods_id' => 7333, 'price' => 9.985, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
 
         20 => [
-//            ['goods_id' => 7334, 'price' => 20.76, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 7334, 'price' => 20.67, 'quality' => 2, 'card_type' => 'chinamobile'],
             ['goods_id' => 7334, 'price' => 20.1, 'quality' => 2, 'card_type' => 'chinaunicom'],
 //            ['goods_id' => 7334, 'price' => 19.97, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
@@ -4009,8 +4009,8 @@ $yamiao_high_phone = ['name' => 'yamiao_high', 'store_id' => 171, 'qualitys' =>
             ['goods_id' => 7460, 'price' => 193, 'quality' => 1, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7460, 'price' => 193, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
-        300 => [['goods_id' => 7461, 'price' => 289.5, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
-        500 => [['goods_id' => 7462, 'price' => 482.5, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']]
+//        300 => [['goods_id' => 7461, 'price' => 289.5, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+//        500 => [['goods_id' => 7462, 'price' => 482.5, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']]
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 
@@ -4038,18 +4038,16 @@ $yamiao_normal_phone = ['name' => 'yamiao_normal', 'store_id' => 172, 'qualitys'
             ['goods_id' => 7468, 'price' => 191, 'quality' => 1, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7468, 'price' => 189.2, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
-        300 => [
-            ['goods_id' => 7469, 'price' => 287.7, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 7469, 'price' => 286.5, 'quality' => 1, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 7469, 'price' => 285, 'quality' => 1, 'card_type' => 'chinatelecom']
-
-        ],
-        500 => [
-            ['goods_id' => 7470, 'price' => 479.5, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 7470, 'price' => 477.5, 'quality' => 1, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 7470, 'price' => 475, 'quality' => 1, 'card_type' => 'chinatelecom']
-
-        ]
+//        300 => [
+//            ['goods_id' => 7469, 'price' => 287.7, 'quality' => 1, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 7469, 'price' => 286.5, 'quality' => 1, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 7469, 'price' => 285, 'quality' => 1, 'card_type' => 'chinatelecom']
+//        ],
+//        500 => [
+//            ['goods_id' => 7470, 'price' => 479.5, 'quality' => 1, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 7470, 'price' => 477.5, 'quality' => 1, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 7470, 'price' => 475, 'quality' => 1, 'card_type' => 'chinatelecom']
+//        ]
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 

+ 10 - 0
data/model/refill_detail.model.php

@@ -20,4 +20,14 @@ class refill_detailModel extends Model
     {
         return $this->where($condition)->find();
     }
+
+    public function getLatestSendTime()
+    {
+        $item = $this->field('min(order_time) as send_time')->where(['order_state' => ORDER_STATE_SEND])->find();
+        if(empty($item)) {
+            return time() - 86400;
+        } else {
+            return intval($item['send_time']);
+        }
+    }
 }

+ 13 - 0
docker/compose/workcuda/sdatacalc/docker-compose.yml

@@ -0,0 +1,13 @@
+version: "3.7"
+
+services:
+  mamount:
+    image: pycpu:3.7.10
+    volumes:
+      - ../../../../:/var/www/html
+      - ../conf/etc/localtime:/etc/localtime:ro
+      - /mnt/upload:/var/www/html/data/upload
+      - /mnt/shoplog:/var/www/html/data/log
+      - /mnt/stdata:/var/www/html/data/stdata
+    container_name: "panda-mamount"
+    command: ['python','mamount.py']

+ 0 - 12
docker/compose/workcuda/statsec/docker-compose.yml

@@ -1,18 +1,6 @@
 version: "3.7"
 
 services:
-  flasksrv:
-    image: pycpu:3.7.10
-    volumes:
-      - ../../../../:/var/www/html
-      - ../conf/etc/localtime:/etc/localtime:ro
-      - /mnt/shoplog:/var/www/html/data/log
-      - /mnt/stdata:/var/www/html/data/stdata
-    ports:
-      - 5000:5000
-    container_name: "panda-flask"
-    command: ['python','plot_control.py']
-
   qreader:
     image: pycpu:3.7.10
     volumes:

+ 12 - 1
docker/compose/workcuda/slave-crond/docker-compose.yml

@@ -47,4 +47,15 @@ services:
     deploy:
       resources:
         limits:
-          cpus: '8'
+          cpus: '8'
+
+  statutil:
+    image: php-zts-debug:7.3.18
+    volumes:
+      - ../../../../:/var/www/html
+      - ../conf/etc/localtime:/etc/localtime:ro
+      - ../conf/php/php.ini:/usr/local/etc/php/php.ini
+      - /mnt/upload:/var/www/html/data/upload
+      - /mnt/shoplog:/var/www/html/data/log
+    container_name: "panda-statutil"
+    command: [php,"/var/www/html/crontab/index.php",'minutes','stat_util']

+ 16 - 0
docker/compose/yl/ylslave-crond/docker-compose.yml

@@ -47,4 +47,20 @@ services:
     deploy:
       resources:
         limits:
+          cpus: '8'
+
+  taskc:
+    image: php-zts-debug:7.3.18
+    volumes:
+      - ../../../../:/var/www/html
+      - ../conf/etc/localtime:/etc/localtime:ro
+      - ../conf/php/php.ini:/usr/local/etc/php/php.ini
+      - ../conf/crontab/slave_root:/var/spool/cron/crontabs/root
+      - /nfs/ylupload:/var/www/html/data/upload
+      - /mnt/yllog:/var/www/html/data/log
+    container_name: "yl-taskc"
+    command: [php,"/var/www/html/crontab/index.php",'minutes','task']
+    deploy:
+      resources:
+        limits:
           cpus: '8'

二进制
helper/refill/api/xyz/guochuang/20220705广东移动调价函.png


二进制
helper/refill/api/xyz/guochuang/20220706辽宁移动调价函.png


二进制
helper/refill/api/xyz/guochuang/20220708辽宁 青海 贵州调价函.png


二进制
helper/refill/api/xyz/guochuang/20220710河南移动调价函.png


二进制
helper/refill/api/xyz/guochuang/20220710辽宁移动调价函.png


二进制
helper/refill/api/xyz/guochuang/20220711吉林移动调价函.png


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

@@ -67,22 +67,22 @@ class config
         "4-10-6" => 9.84, "4-20-6" => 19.68, "4-30-6" => 29.52, "4-50-6" => 49.2, "4-100-6" => 98.4, "4-200-6" => 196.8, "4-300-6" => 295.2, "4-500-6" => 492,//辽宁 6
         "4-10-9" => 9.94, "4-20-9" => 19.88, "4-30-9" => 29.82, "4-50-9" => 49.7, "4-100-9" => 99.4,//上海 9
         "4-10-8" => 10.015, "4-20-8" => 20.03, "4-30-8" => 30.045, "4-50-8" => 50.075, "4-100-8" => 100.15, "4-200-8" => 200.3, "4-300-8" => 300.9, "4-500-8" => 501.5,//黑龙江 8
-        "4-10-29" => 9.755, "4-20-29" => 19.51, "4-30-29" => 29.265, "4-50-29" => 48.775, "4-100-29" => 97.55, "4-200-29" => 195.1, "4-300-29" => 292.65, "4-500-29" => 487.75,//青海 29
+        "4-10-29" => 9.765, "4-20-29" => 19.53, "4-30-29" => 29.295, "4-50-29" => 48.825, "4-100-29" => 97.65, "4-200-29" => 195.3, "4-300-29" => 292.95, "4-500-29" => 488.25,//青海 29
         "4-10-28" => 9.985, "4-20-28" => 19.97, "4-30-28" => 29.955, "4-50-28" => 49.925, "4-100-28" => 99.85, "4-200-28" => 199.7, "4-300-28" => 299.55, "4-500-28" => 499.25,//甘肃 28
         "4-10-13" => 10.22, "4-20-13" => 19.94, "4-30-13" => 29.91, "4-50-13" => 49.85, "4-100-13" => 99.7, "4-200-13" => 199.4, "4-300-13" => 300.9, "4-500-13" => 501.5,//福建 13
         "4-10-5" => 10.035, "4-20-5" => 20.07, "4-30-5" => 30.09, "4-50-5" => 50.15, "4-100-5" => 100.3, "4-200-5" => 200.4, "4-300-5" => 300.6, "4-500-5" => 501,//内蒙古 5
         "4-30-18" => 29.835, "4-50-18" => 49.725, "4-100-18" => 99.45, "4-200-18" => 198.3,//湖南 18
-        "4-10-19" => 9.975, "4-20-19" => 19.95, "4-30-19" => 29.985, "4-50-19" => 49.975, "4-100-19" => 99.95, "4-200-19" => 199.9, "4-300-19" => 299.85, "4-500-19" => 499.75,//广东 19
-        "4-10-7" => 9.82, "4-20-7" => 19.64, "4-30-7" => 29.46, "4-50-7" => 49.1, "4-100-7" => 98.2, "4-200-7" => 196.4, "4-300-7" => 294.6, "4-500-7" => 491,//吉林 7
+        "4-10-19" => 9.975, "4-20-19" => 19.95, "4-30-19" => 29.964, "4-50-19" => 49.94, "4-100-19" => 99.88, "4-200-19" => 199.76, "4-300-19" => 299.64, "4-500-19" => 499.4,//广东 19
+        "4-10-7" => 9.93, "4-20-7" => 19.86, "4-30-7" => 29.52, "4-50-7" => 49.2, "4-100-7" => 98.4, "4-200-7" => 196.8, "4-300-7" => 295.2, "4-500-7" => 492,//吉林 7
         "4-10-1" => 10.31, "4-20-1" => 20.32, "4-30-1" => 30.33, "4-50-1" => 50.35, "4-100-1" => 100.4, "4-200-1" => 200.3, "4-300-1" => 300.45, "4-500-1" => 500.75,//北京 1
         "4-10-22" => 10.015, "4-20-22" => 20.03, "4-30-22" => 30.045, "4-50-22" => 50.075, "4-100-22" => 100.15, "4-200-22" => 200.3, "4-300-22" => 300.45, "4-500-22" => 500.75,//重庆 22
         "4-10-15" => 9.945, "4-20-15" => 19.89, "4-30-15" => 29.835, "4-50-15" => 49.725, "4-100-15" => 99.45, "4-200-15" => 198.9, "4-300-15" => 298.35, "4-500-15" => 497.25,//山东 15
         "4-10-10" => 9.945, "4-20-10" => 19.89, "4-30-10" => 29.835, "4-50-10" => 49.725, "4-100-10" => 99.45, "4-200-10" => 198.9, "4-300-10" => 298.35, "4-500-10" => 497.25,//江苏 10
         "4-10-11" => 9.945, "4-20-11" => 19.89, "4-30-11" => 29.835, "4-50-11" => 49.725, "4-100-11" => 99.45, "4-200-11" => 198.9, "4-300-11" => 298.35, "4-500-11" => 497.25,//浙江 11
         "4-10-17" => 9.945, "4-20-17" => 19.89, "4-30-17" => 29.835, "4-50-17" => 49.725, "4-100-17" => 99.45, "4-200-17" => 198.9, "4-300-17" => 298.35, "4-500-17" => 497.25,//湖北 17
-        "4-10-16" => 10.14, "4-20-16" => 20.28, "4-30-16" => 30.21, "4-50-16" => 50.15, "4-100-16" => 100.3, "4-200-16" => 200.6, "4-300-16" => 300.9, "4-500-16" => 501.5,//河南 16
+        "4-10-16" => 10.19, "4-20-16" => 20.28, "4-30-16" => 30.21, "4-50-16" => 50.15, "4-100-16" => 100.3, "4-200-16" => 200.6, "4-300-16" => 300.9, "4-500-16" => 501.5,//河南 16
         "4-50-4" => 49.75, "4-100-4" => 99.5, "4-200-4" => 199,//山西 4
-        "4-10-24" => 10.21, "4-20-24" => 20.22, "4-30-24" => 30.24, "4-50-24" => 50.25, "4-100-24" => 100.3, "4-200-24" => 200.4, "4-300-24" => 300.6, "4-500-24" => 501,//贵州 24
+        "4-10-24" => 10.22, "4-20-24" => 20.44, "4-30-24" => 30.24, "4-50-24" => 50.25, "4-100-24" => 100.3, "4-200-24" => 200.4, "4-300-24" => 300.6, "4-500-24" => 501,//贵州 24
         "4-10-30" => 10.12, "4-20-30" => 20.24, "4-30-30" => 30.129, "4-50-30" => 50.15, "4-100-30" => 100.2, "4-200-30" => 200.4, "4-300-30" => 300.3, "4-500-30" => 500.5,//宁夏 30
         //联通
         "5-10-19" => 10.04, "5-20-19" => 20.08, "5-30-19" => 30.06, "5-50-19" => 50.1, "5-100-19" => 100.2, "5-200-19" => 200.4, "5-300-19" => 300.6, "5-500-19" => 501,//广东 19

+ 17 - 23
helper/refill/api/xyz/yamiao_high/config.php

@@ -6,37 +6,31 @@ namespace refill\yamiao_high;
 use mtopcard;
 class config
 {
-    const ORDER_URL = 'http://120.55.90.36:8911/api/hf/order/submit';
-    const QUERY_URL = 'http://120.55.90.36:8911/api/order/query';
-    const BALANCE_URL = 'http://120.55.90.36:8911/api/account/balance';
+    const ORDER_URL = 'http://121.196.43.130:8911/api/hf/order/submit';
+    const QUERY_URL = 'http://121.196.43.130:8911/api/order/query';
+    const BALANCE_URL = 'http://121.196.43.130:8911/api/account/balance';
 
-    const APP_ID = 'HHngfxQs6M';
-    const APP_SECRET = 'jToNycSIbofVwPSn';
+    const APP_ID = 'pNu4tRKL3B';
+    const APP_SECRET = 'CJGgKafirDZjPduS';
     const NOTIFY_URL = BASE_SITE_URL . "/mobile/callback/refill_yamiao_high.php";
     const PRODUCT = [
         mtopcard\ChinaMobileCard => [
-            30  => 100007,
-            50  => 100008,
-            100 => 100009,
-            200 => 100010,
-            300 => 100011,
-            500 => 100012
+            30  => 100000,
+            50  => 100001,
+            100 => 100002,
+            200 => 100003,
         ],
         mtopcard\ChinaUnicomCard => [
-            30  => 100013,
-            50  => 100014,
-            100 => 100015,
-            200 => 100016,
-            300 => 100017,
-            500 => 100018
+            30  => 100004,
+            50  => 100005,
+            100 => 100006,
+            200 => 100007,
         ],
         mtopcard\ChinaTelecomCard => [
-            30  => 100019,
-            50  => 100020,
-            100 => 100021,
-            200 => 100022,
-            300 => 100023,
-            500 => 100024
+            30  => 100008,
+            50  => 100009,
+            100 => 100010,
+            200 => 100011,
         ],
     ];
     const ExtHeaders = ['Content-Type:application/x-www-form-urlencoded;charset=utf-8'];

+ 23 - 30
helper/refill/api/xyz/yamiao_high/开户信息.txt

@@ -1,36 +1,29 @@
-后台地址:http://120.55.90.36:8888
-帐号:椰子
-密码:545795
-二级密码:eJMW5323
-appId:HHngfxQs6M
-appSecret:jToNycSIbofVwPSn
+后台地址:http://121.196.43.130:8888
+帐号:北京椰子高价
+密码:217032
+二级密码:Ujgb9100
+appId:pNu4tRKL3B
+appSecret:CJGgKafirDZjPduS
 后台-商品列表,可查看已配置商品信息
 后台-安全中心,可配置IP白名单
 接口文档:https://www.showdoc.com.cn/1686453783298366/7925312871840290
-话费直充接口:http://120.55.90.36:8911/api/hf/order/submit
-通用直充接口:http://120.55.90.36:8911/api/order/submit
-卡密提取接口:http://120.55.90.36:8911/api/card/get
-查单接口接口:http://120.55.90.36:8911/api/order/query
-余额接口接口:http://120.55.90.36:8911/api/account/balance
+话费直充接口:http://121.196.43.130:8911/api/hf/order/submit
+通用直充接口:http://121.196.43.130:8911/api/order/submit
+卡密提取接口:http://121.196.43.130:8911/api/card/get
+查询接口接口:http://121.196.43.130:8911/api/order/query
+余额查询接口:http://121.196.43.130:8911/api/account/balance
 
+100000  移动30
+100001  移动50
+100002  移动100
+100003  移动200
 
-100007   移动30
-100008   移动50
-100009   移动100
-100010   移动200
-100011   移动300
-100012   移动500
+100004	联通30
+100005	联通50
+100006	联通100
+100007	联通200
 
-100013   联通30
-100014   联通50
-100015   联通100
-100016   联通200
-100017   联通300
-100018	 联通500
-
-100019   电信30
-100020   电信50
-100021   电信100
-100022   电信200
-100023 	 电信300
-100024   电信500
+100008	电信30
+100009	电信50
+100010	电信100
+100011	电信200

+ 17 - 23
helper/refill/api/xyz/yamiao_normal/config.php

@@ -6,37 +6,31 @@ namespace refill\yamiao_normal;
 use mtopcard;
 class config
 {
-    const ORDER_URL = 'http://120.55.90.36:8911/api/hf/order/submit';
-    const QUERY_URL = 'http://120.55.90.36:8911/api/order/query';
-    const BALANCE_URL = 'http://120.55.90.36:8911/api/account/balance';
+    const ORDER_URL = 'http://121.196.43.130:8911/api/hf/order/submit';
+    const QUERY_URL = 'http://121.196.43.130:8911/api/order/query';
+    const BALANCE_URL = 'http://121.196.43.130:8911/api/account/balance';
 
-    const APP_ID = 'RvQe0E9q3S';
-    const APP_SECRET = 'OfVpRCIUBQGYSQUL';
+    const APP_ID = 'QhzfNgAIAn';
+    const APP_SECRET = 'mDewCnLyXBvdTFQs';
     const NOTIFY_URL = BASE_SITE_URL . "/mobile/callback/refill_yamiao_normal.php";
     const PRODUCT = [
         mtopcard\ChinaMobileCard => [
-            30  => 100007,
-            50  => 100008,
-            100 => 100009,
-            200 => 100010,
-            300 => 100011,
-            500 => 100012
+            30  => 100000,
+            50  => 100001,
+            100 => 100002,
+            200 => 100003,
         ],
         mtopcard\ChinaUnicomCard => [
-            30  => 100013,
-            50  => 100014,
-            100 => 100015,
-            200 => 100016,
-            300 => 100017,
-            500 => 100018
+            30  => 100004,
+            50  => 100005,
+            100 => 100006,
+            200 => 100007,
         ],
         mtopcard\ChinaTelecomCard => [
-            30  => 100019,
-            50  => 100020,
-            100 => 100021,
-            200 => 100022,
-            300 => 100023,
-            500 => 100024
+            30  => 100008,
+            50  => 100009,
+            100 => 100010,
+            200 => 100011,
         ],
     ];
     const ExtHeaders = ['Content-Type:application/x-www-form-urlencoded;charset=utf-8'];

+ 23 - 29
helper/refill/api/xyz/yamiao_normal/开户信息.txt

@@ -1,35 +1,29 @@
-后台地址:http://120.55.90.36:8888
-帐号:yezi
-密码:304641
-二级密码:tKDZ6725
-appId:RvQe0E9q3S
-appSecret:OfVpRCIUBQGYSQUL
+后台地址:http://121.196.43.130:8888
+帐号:北京椰子低价
+密码:067443
+二级密码:YeXD1760
+appId:QhzfNgAIAn
+appSecret:mDewCnLyXBvdTFQs
 后台-商品列表,可查看已配置商品信息
 后台-安全中心,可配置IP白名单
 接口文档:https://www.showdoc.com.cn/1686453783298366/7925312871840290
-话费直充接口:http://120.55.90.36:8911/api/hf/order/submit
-通用直充接口:http://120.55.90.36:8911/api/order/submit
-卡密提取接口:http://120.55.90.36:8911/api/card/get
-查单接口接口:http://120.55.90.36:8911/api/order/query
-余额接口接口:http://120.55.90.36:8911/api/account/balance
+话费直充接口:http://121.196.43.130:8911/api/hf/order/submit
+通用直充接口:http://121.196.43.130:8911/api/order/submit
+卡密提取接口:http://121.196.43.130:8911/api/card/get
+查询接口接口:http://121.196.43.130:8911/api/order/query
+余额查询接口:http://121.196.43.130:8911/api/account/balance
 
-100007   移动30
-100008   移动50
-100009   移动100
-100010   移动200
-100011   移动300
-100012   移动500
+100000  移动30
+100001  移动50
+100002  移动100
+100003  移动200
 
-100013   联通30
-100014   联通50
-100015   联通100
-100016   联通200
-100017   联通300
-100018	 联通500
+100004	联通30
+100005	联通50
+100006	联通100
+100007	联通200
 
-100019   电信30
-100020   电信50
-100021   电信100
-100022   电信200
-100023 	 电信300
-100024   电信500
+100008	电信30
+100009	电信50
+100010	电信100
+100011	电信200

+ 17 - 19
helper/refill/api/xyz/yunchonggong/config.php

@@ -6,33 +6,31 @@ namespace refill\yunchonggong;
 use mtopcard;
 class config
 {
-    const ORDER_URL = 'http://119.23.54.206:8911/api/order/submit';
-    const QUERY_URL = 'http://119.23.54.206:8911/api/order/query';
-    const BALANCE_URL = 'http://119.23.54.206:8911/api/account/balance';
+    const ORDER_URL = 'http://39.108.50.235:8911/api/order/submit';
+    const QUERY_URL = 'http://39.108.50.235:8911/api/order/query';
+    const BALANCE_URL = 'http://39.108.50.235:8911/api/account/balance';
 
-    const APP_ID = 'c4vuuOV43q';
-    const APP_SECRET = 'eyxARMYmpqkavQsS';
+    const APP_ID = 'ihAIbQsfqg';
+    const APP_SECRET = 'ydbSZsvAjHtxRGXu';
     const NOTIFY_URL = BASE_SITE_URL . "/mobile/callback/refill_yunchonggong.php";
     const PRODUCT = [
         mtopcard\ChinaMobileCard => [
-            30  => 100032,
-            50  => 100033,
-            100 => 100034,
-            200 => 100035
+            30  => 100000,
+            50  => 100001,
+            100 => 100002,
+            200 => 100003
         ],
         mtopcard\ChinaUnicomCard => [
-            30  => 100036,
-            50  => 100037,
-            100 => 100038,
-            200 => 100039,
-            300 => 100040
+            30  => 100004,
+            50  => 100005,
+            100 => 100006,
+            200 => 100007
         ],
         mtopcard\ChinaTelecomCard => [
-            30  => 100041,
-            50  => 100042,
-            100 => 100043,
-            200 => 100044,
-            300 => 100045
+            30  => 100008,
+            50  => 100009,
+            100 => 100010,
+            200 => 100011
         ],
     ];
     const ExtHeaders = ['Content-Type:application/x-www-form-urlencoded;charset=utf-8'];

+ 26 - 9
helper/refill/api/xyz/yunchonggong/开户信息.txt

@@ -1,12 +1,29 @@
-后台地址:http://119.23.54.206:8888
+后台地址:http://39.108.50.235:8888
 帐号:yezi
-密码:839926
-二级密码:yHNd0040
-appId:c4vuuOV43q
-appSecret:eyxARMYmpqkavQsS
-接口服务器:119.23.54.206
-http端口:8911,https端口:8443
-后台-接口文档,可查看及下载接口文档
+密码:033951
+二级密码:RADk5073
+appId:ihAIbQsfqg
+appSecret:ydbSZsvAjHtxRGXu
 后台-商品列表,可查看已配置商品信息
 后台-安全中心,可配置IP白名单
-接口地址:https://www.showdoc.com.cn/900133176881927/4798108582458838
+接口文档:https://www.showdoc.com.cn/1686453783298366/7925312871840290
+话费直充接口:http://39.108.50.235:8911/api/hf/order/submit
+通用直充接口:http://39.108.50.235:8911/api/order/submit
+卡密提取接口:http://39.108.50.235:8911/api/card/get
+查询接口接口:http://39.108.50.235:8911/api/order/query
+余额查询接口:http://39.108.50.235:8911/api/account/balance
+
+100000	全国移动30
+100001	全国移动50
+100002	全国移动100
+100003	全国移动200
+
+100004	全国联通30
+100005	全国联通50
+100006	全国联通100
+100007	全国联通200
+
+100008	全国电信30
+100009	全国电信50
+100010	全国电信100
+100011	全国电信200

+ 15 - 57
helper/refill/api/xyz/yunchonggongfs/config.php

@@ -5,75 +5,33 @@ namespace refill\yunchonggongfs;
 
 class config
 {
-    const ORDER_URL = 'http://119.23.54.206:8911/api/order/submit';
-    const QUERY_URL = 'http://119.23.54.206:8911/api/order/query';
-    const BALANCE_URL = 'http://119.23.54.206:8911/api/account/balance';
+    const ORDER_URL = 'http://39.108.50.235:8911/api/order/submit';
+    const QUERY_URL = 'http://39.108.50.235:8911/api/order/query';
+    const BALANCE_URL = 'http://39.108.50.235:8911/api/account/balance';
 
-    const APP_ID = 'Z1sU5unYK7';
-    const APP_SECRET = 'jaFAMZtZAiQFWYnL';
+    const APP_ID = 'dyipx0WORM';
+    const APP_SECRET = 'LSBNkvMPKoAMfDrt';
     const NOTIFY_URL = BASE_SITE_URL . "/mobile/callback/refill_yunchonggongfs.php";
 
     const ProvinceItemId = [
-        15	=> [
-                    30  => 100050,
-                    50  => 100051,
-                    100 => 100052,
-                    200 => 100053
-                ], //'山东',
         25	=> [
-                    30  => 100054,
-                    50  => 100055,
-                    100 => 100056,
-                    200 => 100057
+                    30  => 100012,
+                    50  => 100013,
+                    100 => 100014,
+                    200 => 100015
                 ], //'云南',
-        28	=> [
-                    30  => 100066,
-                    50  => 100067,
-                    100 => 100068,
-                    200 => 100069
-                ], //'甘肃',
         24	=> [
-                    30  => 100070,
-                    50  => 100071,
-                    100 => 100072,
-                    200 => 100073
+                    30  => 100016,
+                    50  => 100017,
+                    100 => 100018,
+                    200 => 100019
                 ], //'贵州',
-        4	=> [
-                    30  => 100074,
-                    50  => 100075,
-                    100 => 100076,
-                    200 => 100077
-                ], //'山西',
-        10	=> [
-                    30  => 100078,
-                    50  => 100079,
-                    100 => 100080,
-                    200 => 100081
-                ], //'江苏',
-        11	=> [
-                    30  => 100082,
-                    50  => 100083,
-                    100 => 100084,
-                    200 => 100085
-                ], //'浙江'
-        13	=> [
-                    30  => 100086,
-                    50  => 100087,
-                    100 => 100088,
-                    200 => 100089
-                ] //'福建'
     ];
     const ExtHeaders = ['Content-Type:application/x-www-form-urlencoded;charset=utf-8'];
     const ERRCODES = ['-10', '-12', '-13', '-14', '-15', '-16', '-18', '-21'];
     //key格式 卡类型-面值-regin_no
     const Price = [
-        "4-10-24" => 9.41, "4-20-24" => 18.82, "4-30-24" => 28.23, "4-50-24" => 47.05, "4-100-24" => 94.1, "4-200-24" => 188.2, "4-300-24" => 282.3, "4-500-24" => 470.5,//贵州 24
-        "4-10-15" => 9.47, "4-20-15" => 18.94, "4-30-15" => 28.41, "4-50-15" => 47.35, "4-100-15" => 94.7, "4-200-15" => 189.4, "4-300-15" => 284.1, "4-500-15" => 473.5,//山东 15
-        "4-10-25" => 9.47, "4-20-25" => 18.94, "4-30-25" => 28.41, "4-50-25" => 47.35, "4-100-25" => 94.7, "4-200-25" => 189.4, "4-300-25" => 284.1, "4-500-25" => 473.5,//云南 25
-        "4-10-28" => 9.47, "4-20-28" => 18.94, "4-30-28" => 28.41, "4-50-28" => 47.35, "4-100-28" => 94.7, "4-200-28" => 189.4, "4-300-28" => 284.1, "4-500-28" => 473.5,//甘肃 28
-        "4-10-4" => 9.47, "4-20-4" => 18.94, "4-30-4" => 28.41, "4-50-4" => 47.35, "4-100-4" => 94.7, "4-200-4" => 189.4, "4-300-4" => 284.1, "4-500-4" => 473.5,//山西 4
-        "4-10-10" => 9.47, "4-20-10" => 18.94, "4-30-10" => 28.41, "4-50-10" => 47.35, "4-100-10" => 94.7, "4-200-10" => 189.4, "4-300-10" => 284.1, "4-500-10" => 473.5,//江苏 10
-        "4-10-11" => 9.47, "4-20-11" => 18.94, "4-30-11" => 28.41, "4-50-11" => 47.35, "4-100-11" => 94.7, "4-200-11" => 189.4, "4-300-11" => 284.1, "4-500-11" => 473.5,//浙江 11
-        "4-10-13" => 9.47, "4-20-13" => 18.94, "4-30-13" => 28.41, "4-50-13" => 47.35, "4-100-13" => 94.7, "4-200-13" => 189.4, "4-300-13" => 284.1, "4-500-13" => 473.5,//福建 13
+        "4-30-24" => 28.23, "4-50-24" => 47.05, "4-100-24" => 94.1, "4-200-24" => 188.2,//贵州 24
+        "4-30-25" => 28.23, "4-50-25" => 47.05, "4-100-25" => 94.1, "4-200-25" => 188.2,//云南 25
     ];
 }

+ 22 - 11
helper/refill/api/xyz/yunchonggongfs/开户信息.txt

@@ -1,13 +1,24 @@
-后台地址:http://119.23.54.206:8888
-帐号:fenyezi
-密码:716081
-二级密码:UaVI4513
-appId:Z1sU5unYK7
-appSecret:jaFAMZtZAiQFWYnL
+后台地址:http://39.108.50.235:8888
+帐号:yezi11
+密码:494749
+二级密码:TpKM4298
+appId:dyipx0WORM
+appSecret:LSBNkvMPKoAMfDrt
 后台-商品列表,可查看已配置商品信息
 后台-安全中心,可配置IP白名单
-接口文档:https://www.showdoc.com.cn/900133176881927?page_id=4798465261069610
-下单接口地址:http://119.23.54.206:8911/api/order/submit
-查单接口地址:http://119.23.54.206:8911/api/order/query
-余额接口地址:http://119.23.54.206:8911/api/account/balance
-提卡接口地址:http://119.23.54.206:8911/api/card/get
+接口文档:https://www.showdoc.com.cn/1686453783298366/7925312871840290
+话费直充接口:http://39.108.50.235:8911/api/hf/order/submit
+通用直充接口:http://39.108.50.235:8911/api/order/submit
+卡密提取接口:http://39.108.50.235:8911/api/card/get
+查询接口接口:http://39.108.50.235:8911/api/order/query
+余额查询接口:http://39.108.50.235:8911/api/account/balance
+
+100012	云南移动30
+100013	云南移动50
+100014	云南移动100
+100015	云南移动200
+
+100016	贵州移动30
+100017	贵州移动50
+100018	贵州移动100
+100019	贵州移动200

+ 5 - 5
helper/refill/api/yl/guochuang/config.php

@@ -67,22 +67,22 @@ class config
         "4-10-6" => 9.84, "4-20-6" => 19.68, "4-30-6" => 29.52, "4-50-6" => 49.2, "4-100-6" => 98.4, "4-200-6" => 196.8, "4-300-6" => 295.2, "4-500-6" => 492,//辽宁 6
         "4-10-9" => 9.94, "4-20-9" => 19.88, "4-30-9" => 29.82, "4-50-9" => 49.7, "4-100-9" => 99.4,//上海 9
         "4-10-8" => 10.015, "4-20-8" => 20.03, "4-30-8" => 30.045, "4-50-8" => 50.075, "4-100-8" => 100.15, "4-200-8" => 200.3, "4-300-8" => 300.9, "4-500-8" => 501.5,//黑龙江 8
-        "4-10-29" => 9.755, "4-20-29" => 19.51, "4-30-29" => 29.265, "4-50-29" => 48.775, "4-100-29" => 97.55, "4-200-29" => 195.1, "4-300-29" => 292.65, "4-500-29" => 487.75,//青海 29
+        "4-10-29" => 9.765, "4-20-29" => 19.53, "4-30-29" => 29.295, "4-50-29" => 48.825, "4-100-29" => 97.65, "4-200-29" => 195.3, "4-300-29" => 292.95, "4-500-29" => 488.25,//青海 29
         "4-10-28" => 9.985, "4-20-28" => 19.97, "4-30-28" => 29.955, "4-50-28" => 49.925, "4-100-28" => 99.85, "4-200-28" => 199.7, "4-300-28" => 299.55, "4-500-28" => 499.25,//甘肃 28
         "4-10-13" => 10.22, "4-20-13" => 19.94, "4-30-13" => 29.91, "4-50-13" => 49.85, "4-100-13" => 99.7, "4-200-13" => 199.4, "4-300-13" => 300.9, "4-500-13" => 501.5,//福建 13
         "4-10-5" => 10.035, "4-20-5" => 20.07, "4-30-5" => 30.09, "4-50-5" => 50.15, "4-100-5" => 100.3, "4-200-5" => 200.4, "4-300-5" => 300.6, "4-500-5" => 501,//内蒙古 5
         "4-30-18" => 29.835, "4-50-18" => 49.725, "4-100-18" => 99.45, "4-200-18" => 198.3,//湖南 18
-        "4-10-19" => 9.975, "4-20-19" => 19.95, "4-30-19" => 29.985, "4-50-19" => 49.975, "4-100-19" => 99.95, "4-200-19" => 199.9, "4-300-19" => 299.85, "4-500-19" => 499.75,//广东 19
-        "4-10-7" => 9.82, "4-20-7" => 19.64, "4-30-7" => 29.46, "4-50-7" => 49.1, "4-100-7" => 98.2, "4-200-7" => 196.4, "4-300-7" => 294.6, "4-500-7" => 491,//吉林 7
+        "4-10-19" => 9.975, "4-20-19" => 19.95, "4-30-19" => 29.964, "4-50-19" => 49.94, "4-100-19" => 99.88, "4-200-19" => 199.76, "4-300-19" => 299.64, "4-500-19" => 499.4,//广东 19
+        "4-10-7" => 9.93, "4-20-7" => 19.86, "4-30-7" => 29.52, "4-50-7" => 49.2, "4-100-7" => 98.4, "4-200-7" => 196.8, "4-300-7" => 295.2, "4-500-7" => 492,//吉林 7
         "4-10-1" => 10.31, "4-20-1" => 20.32, "4-30-1" => 30.33, "4-50-1" => 50.35, "4-100-1" => 100.4, "4-200-1" => 200.3, "4-300-1" => 300.45, "4-500-1" => 500.75,//北京 1
         "4-10-22" => 10.015, "4-20-22" => 20.03, "4-30-22" => 30.045, "4-50-22" => 50.075, "4-100-22" => 100.15, "4-200-22" => 200.3, "4-300-22" => 300.45, "4-500-22" => 500.75,//重庆 22
         "4-10-15" => 9.945, "4-20-15" => 19.89, "4-30-15" => 29.835, "4-50-15" => 49.725, "4-100-15" => 99.45, "4-200-15" => 198.9, "4-300-15" => 298.35, "4-500-15" => 497.25,//山东 15
         "4-10-10" => 9.945, "4-20-10" => 19.89, "4-30-10" => 29.835, "4-50-10" => 49.725, "4-100-10" => 99.45, "4-200-10" => 198.9, "4-300-10" => 298.35, "4-500-10" => 497.25,//江苏 10
         "4-10-11" => 9.945, "4-20-11" => 19.89, "4-30-11" => 29.835, "4-50-11" => 49.725, "4-100-11" => 99.45, "4-200-11" => 198.9, "4-300-11" => 298.35, "4-500-11" => 497.25,//浙江 11
         "4-10-17" => 9.945, "4-20-17" => 19.89, "4-30-17" => 29.835, "4-50-17" => 49.725, "4-100-17" => 99.45, "4-200-17" => 198.9, "4-300-17" => 298.35, "4-500-17" => 497.25,//湖北 17
-        "4-10-16" => 10.14, "4-20-16" => 20.28, "4-30-16" => 30.21, "4-50-16" => 50.15, "4-100-16" => 100.3, "4-200-16" => 200.6, "4-300-16" => 300.9, "4-500-16" => 501.5,//河南 16
+        "4-10-16" => 10.19, "4-20-16" => 20.28, "4-30-16" => 30.21, "4-50-16" => 50.15, "4-100-16" => 100.3, "4-200-16" => 200.6, "4-300-16" => 300.9, "4-500-16" => 501.5,//河南 16
         "4-50-4" => 49.75, "4-100-4" => 99.5, "4-200-4" => 199,//山西 4
-        "4-10-24" => 10.21, "4-20-24" => 20.22, "4-30-24" => 30.24, "4-50-24" => 50.25, "4-100-24" => 100.3, "4-200-24" => 200.4, "4-300-24" => 300.6, "4-500-24" => 501,//贵州 24
+        "4-10-24" => 10.22, "4-20-24" => 20.44, "4-30-24" => 30.24, "4-50-24" => 50.25, "4-100-24" => 100.3, "4-200-24" => 200.4, "4-300-24" => 300.6, "4-500-24" => 501,//贵州 24
         "4-10-30" => 10.12, "4-20-30" => 20.24, "4-30-30" => 30.129, "4-50-30" => 50.15, "4-100-30" => 100.2, "4-200-30" => 200.4, "4-300-30" => 300.3, "4-500-30" => 500.5,//宁夏 30
         //联通
         "5-10-19" => 10.04, "5-20-19" => 20.08, "5-30-19" => 30.06, "5-50-19" => 50.1, "5-100-19" => 100.2, "5-200-19" => 200.4, "5-300-19" => 300.6, "5-500-19" => 501,//广东 19

+ 17 - 23
helper/refill/api/yl/yamiao_high/config.php

@@ -6,37 +6,31 @@ namespace refill\yamiao_high;
 use mtopcard;
 class config
 {
-    const ORDER_URL = 'http://120.55.90.36:8911/api/hf/order/submit';
-    const QUERY_URL = 'http://120.55.90.36:8911/api/order/query';
-    const BALANCE_URL = 'http://120.55.90.36:8911/api/account/balance';
+    const ORDER_URL = 'http://121.196.43.130:8911/api/hf/order/submit';
+    const QUERY_URL = 'http://121.196.43.130:8911/api/order/query';
+    const BALANCE_URL = 'http://121.196.43.130:8911/api/account/balance';
 
-    const APP_ID = 'ILo9IfHYg0';
-    const APP_SECRET = 'xjHkCgnJwxDgFbpK';
+    const APP_ID = 'LueEQKVnaR';
+    const APP_SECRET = 'GvmuGceMwWpPOTCe';
     const NOTIFY_URL = BASE_SITE_URL . "/mobile/callback/refill_yamiao_high.php";
     const PRODUCT = [
         mtopcard\ChinaMobileCard => [
-            30  => 100007,
-            50  => 100008,
-            100 => 100009,
-            200 => 100010,
-            300 => 100011,
-            500 => 100012
+            30  => 100000,
+            50  => 100001,
+            100 => 100002,
+            200 => 100003,
         ],
         mtopcard\ChinaUnicomCard => [
-            30  => 100013,
-            50  => 100014,
-            100 => 100015,
-            200 => 100016,
-            300 => 100017,
-            500 => 100018
+            30  => 100004,
+            50  => 100005,
+            100 => 100006,
+            200 => 100007,
         ],
         mtopcard\ChinaTelecomCard => [
-            30  => 100019,
-            50  => 100020,
-            100 => 100021,
-            200 => 100022,
-            300 => 100023,
-            500 => 100024
+            30  => 100008,
+            50  => 100009,
+            100 => 100010,
+            200 => 100011,
         ],
     ];
     const ExtHeaders = ['Content-Type:application/x-www-form-urlencoded;charset=utf-8'];

+ 23 - 30
helper/refill/api/yl/yamiao_high/开户信息.txt

@@ -1,36 +1,29 @@
-后台地址:http://120.55.90.36:8888
-帐号:椰林高价
-密码:168884
-二级密码:nuxc3785
-appId:ILo9IfHYg0
-appSecret:xjHkCgnJwxDgFbpK
+后台地址:http://121.196.43.130:8888
+帐号:北京椰林高价
+密码:797922
+二级密码:kBhZ9057
+appId:LueEQKVnaR
+appSecret:GvmuGceMwWpPOTCe
 后台-商品列表,可查看已配置商品信息
 后台-安全中心,可配置IP白名单
 接口文档:https://www.showdoc.com.cn/1686453783298366/7925312871840290
-话费直充接口:http://120.55.90.36:8911/api/hf/order/submit
-通用直充接口:http://120.55.90.36:8911/api/order/submit
-卡密提取接口:http://120.55.90.36:8911/api/card/get
-查单接口接口:http://120.55.90.36:8911/api/order/query
-余额接口接口:http://120.55.90.36:8911/api/account/balance
+话费直充接口:http://121.196.43.130:8911/api/hf/order/submit
+通用直充接口:http://121.196.43.130:8911/api/order/submit
+卡密提取接口:http://121.196.43.130:8911/api/card/get
+查询接口接口:http://121.196.43.130:8911/api/order/query
+余额查询接口:http://121.196.43.130:8911/api/account/balance
 
+100000  移动30
+100001  移动50
+100002  移动100
+100003  移动200
 
-100007   移动30
-100008   移动50
-100009   移动100
-100010   移动200
-100011   移动300
-100012   移动500
+100004	联通30
+100005	联通50
+100006	联通100
+100007	联通200
 
-100013   联通30
-100014   联通50
-100015   联通100
-100016   联通200
-100017   联通300
-100018	 联通500
-
-100019   电信30
-100020   电信50
-100021   电信100
-100022   电信200
-100023 	 电信300
-100024   电信500
+100008	电信30
+100009	电信50
+100010	电信100
+100011	电信200

+ 17 - 23
helper/refill/api/yl/yamiao_normal/config.php

@@ -6,37 +6,31 @@ namespace refill\yamiao_normal;
 use mtopcard;
 class config
 {
-    const ORDER_URL = 'http://120.55.90.36:8911/api/hf/order/submit';
-    const QUERY_URL = 'http://120.55.90.36:8911/api/order/query';
-    const BALANCE_URL = 'http://120.55.90.36:8911/api/account/balance';
+    const ORDER_URL = 'http://121.196.43.130:8911/api/hf/order/submit';
+    const QUERY_URL = 'http://121.196.43.130:8911/api/order/query';
+    const BALANCE_URL = 'http://121.196.43.130:8911/api/account/balance';
 
-    const APP_ID = 'Mxh2JUZocr';
-    const APP_SECRET = 'fKWyNeYlRZAimWXO';
+    const APP_ID = 'OSfxbC60NQ';
+    const APP_SECRET = 'yniMZxXwZAkAqkSp';
     const NOTIFY_URL = BASE_SITE_URL . "/mobile/callback/refill_yamiao_normal.php";
     const PRODUCT = [
         mtopcard\ChinaMobileCard => [
-            30  => 100007,
-            50  => 100008,
-            100 => 100009,
-            200 => 100010,
-            300 => 100011,
-            500 => 100012
+            30  => 100000,
+            50  => 100001,
+            100 => 100002,
+            200 => 100003,
         ],
         mtopcard\ChinaUnicomCard => [
-            30  => 100013,
-            50  => 100014,
-            100 => 100015,
-            200 => 100016,
-            300 => 100017,
-            500 => 100018
+            30  => 100004,
+            50  => 100005,
+            100 => 100006,
+            200 => 100007,
         ],
         mtopcard\ChinaTelecomCard => [
-            30  => 100019,
-            50  => 100020,
-            100 => 100021,
-            200 => 100022,
-            300 => 100023,
-            500 => 100024
+            30  => 100008,
+            50  => 100009,
+            100 => 100010,
+            200 => 100011,
         ],
     ];
     const ExtHeaders = ['Content-Type:application/x-www-form-urlencoded;charset=utf-8'];

+ 23 - 29
helper/refill/api/yl/yamiao_normal/开户信息.txt

@@ -1,35 +1,29 @@
-后台地址:http://120.55.90.36:8888
-帐号:椰林低价
-密码:260379
-二级密码:LFBU6725
-appId:Mxh2JUZocr
-appSecret:fKWyNeYlRZAimWXO
+后台地址:http://121.196.43.130:8888
+帐号:北京椰林低价
+密码:113610
+二级密码:BKWf3390
+appId:OSfxbC60NQ
+appSecret:yniMZxXwZAkAqkSp
 后台-商品列表,可查看已配置商品信息
 后台-安全中心,可配置IP白名单
 接口文档:https://www.showdoc.com.cn/1686453783298366/7925312871840290
-话费直充接口:http://120.55.90.36:8911/api/hf/order/submit
-通用直充接口:http://120.55.90.36:8911/api/order/submit
-卡密提取接口:http://120.55.90.36:8911/api/card/get
-查单接口接口:http://120.55.90.36:8911/api/order/query
-余额接口接口:http://120.55.90.36:8911/api/account/balance
+话费直充接口:http://121.196.43.130:8911/api/hf/order/submit
+通用直充接口:http://121.196.43.130:8911/api/order/submit
+卡密提取接口:http://121.196.43.130:8911/api/card/get
+查询接口接口:http://121.196.43.130:8911/api/order/query
+余额查询接口:http://121.196.43.130:8911/api/account/balance
 
-100007   移动30
-100008   移动50
-100009   移动100
-100010   移动200
-100011   移动300
-100012   移动500
+100000  移动30
+100001  移动50
+100002  移动100
+100003  移动200
 
-100013   联通30
-100014   联通50
-100015   联通100
-100016   联通200
-100017   联通300
-100018	 联通500
+100004	联通30
+100005	联通50
+100006	联通100
+100007	联通200
 
-100019   电信30
-100020   电信50
-100021   电信100
-100022   电信200
-100023 	 电信300
-100024   电信500
+100008	电信30
+100009	电信50
+100010	电信100
+100011	电信200

+ 17 - 17
helper/refill/api/yl/yunchonggong/config.php

@@ -6,31 +6,31 @@ namespace refill\yunchonggong;
 use mtopcard;
 class config
 {
-    const ORDER_URL = 'http://119.23.54.206:8911/api/order/submit';
-    const QUERY_URL = 'http://119.23.54.206:8911/api/order/query';
-    const BALANCE_URL = 'http://119.23.54.206:8911/api/account/balance';
+    const ORDER_URL = 'http://39.108.50.235:8911/api/order/submit';
+    const QUERY_URL = 'http://39.108.50.235:8911/api/order/query';
+    const BALANCE_URL = 'http://39.108.50.235:8911/api/account/balance';
 
-    const APP_ID = 'NCyHHJx9xf';
-    const APP_SECRET = 'vEqnmPrCcnazAzqK';
+    const APP_ID = 'lUdKnPz5cv';
+    const APP_SECRET = 'dIsQfAeVdvXRJLHO';
     const NOTIFY_URL = BASE_SITE_URL . "/mobile/callback/refill_yunchonggong.php";
     const PRODUCT = [
         mtopcard\ChinaMobileCard => [
-            30  => 100032,
-            50  => 100033,
-            100 => 100034,
-            200 => 100035
+            30  => 100000,
+            50  => 100001,
+            100 => 100002,
+            200 => 100003
         ],
         mtopcard\ChinaUnicomCard => [
-            30  => 100036,
-            50  => 100037,
-            100 => 100038,
-            200 => 100039
+            30  => 100004,
+            50  => 100005,
+            100 => 100006,
+            200 => 100007
         ],
         mtopcard\ChinaTelecomCard => [
-            30  => 100041,
-            50  => 100042,
-            100 => 100043,
-            200 => 100044
+            30  => 100008,
+            50  => 100009,
+            100 => 100010,
+            200 => 100011
         ],
     ];
     const ExtHeaders = ['Content-Type:application/x-www-form-urlencoded;charset=utf-8'];

+ 12 - 10
helper/refill/api/yl/yunchonggong/开户信息.txt

@@ -1,12 +1,14 @@
-后台地址:http://119.23.54.206:8888
-帐号:yelin
-密码:180394
-二级密码:Iaml0074
-appId:NCyHHJx9xf
-appSecret:vEqnmPrCcnazAzqK
-接口服务器:119.23.54.206
-http端口:8911,https端口:8443
-后台-接口文档,可查看及下载接口文档
+后台地址:http://39.108.50.235:8888
+帐号:yl11
+密码:934552
+二级密码:aqyy7481
+appId:lUdKnPz5cv
+appSecret:dIsQfAeVdvXRJLHO
 后台-商品列表,可查看已配置商品信息
 后台-安全中心,可配置IP白名单
-接口地址:https://www.showdoc.com.cn/900133176881927/4798108582458838
+接口文档:https://www.showdoc.com.cn/1686453783298366/7925312871840290
+话费直充接口:http://39.108.50.235:8911/api/hf/order/submit
+通用直充接口:http://39.108.50.235:8911/api/order/submit
+卡密提取接口:http://39.108.50.235:8911/api/card/get
+查询接口接口:http://39.108.50.235:8911/api/order/query
+余额查询接口:http://39.108.50.235:8911/api/account/balance

+ 17 - 59
helper/refill/api/yl/yunchonggongfs/config.php

@@ -5,75 +5,33 @@ namespace refill\yunchonggongfs;
 
 class config
 {
-    const ORDER_URL = 'http://119.23.54.206:8911/api/order/submit';
-    const QUERY_URL = 'http://119.23.54.206:8911/api/order/query';
-    const BALANCE_URL = 'http://119.23.54.206:8911/api/account/balance';
+    const ORDER_URL = 'http://39.108.50.235:8911/api/order/submit';
+    const QUERY_URL = 'http://39.108.50.235:8911/api/order/query';
+    const BALANCE_URL = 'http://39.108.50.235:8911/api/account/balance';
 
-    const APP_ID = 'rUKN5DzuzQ';
-    const APP_SECRET = 'uFDmKKqPFxEEZLLs';
+    const APP_ID = 'MEEJnMSL9H';
+    const APP_SECRET = 'cpWFarCEUDnCcMWQ';
     const NOTIFY_URL = BASE_SITE_URL . "/mobile/callback/refill_yunchonggongfs.php";
 
     const ProvinceItemId = [
-        15	=> [
-                    30  => 100050,
-                    50  => 100051,
-                    100 => 100052,
-                    200 => 100053
-                ], //'山东',
         25	=> [
-                    30  => 100054,
-                    50  => 100055,
-                    100 => 100056,
-                    200 => 100057
-                ], //'云南',
-        28	=> [
-                    30  => 100066,
-                    50  => 100067,
-                    100 => 100068,
-                    200 => 100069
-                ], //'甘肃',
+            30  => 100012,
+            50  => 100013,
+            100 => 100014,
+            200 => 100015
+        ], //'云南',
         24	=> [
-                    30  => 100070,
-                    50  => 100071,
-                    100 => 100072,
-                    200 => 100073
-                ], //'贵州',
-        4	=> [
-                    30  => 100074,
-                    50  => 100075,
-                    100 => 100076,
-                    200 => 100077
-                ], //'山西',
-        10	=> [
-                    30  => 100078,
-                    50  => 100079,
-                    100 => 100080,
-                    200 => 100081
-                ], //'江苏',
-        11	=> [
-                    30  => 100082,
-                    50  => 100083,
-                    100 => 100084,
-                    200 => 100085
-                ], //'浙江'
-        13	=> [
-                    30  => 100086,
-                    50  => 100087,
-                    100 => 100088,
-                    200 => 100089
-                ] //'福建'
+            30  => 100016,
+            50  => 100017,
+            100 => 100018,
+            200 => 100019
+        ], //'贵州',
     ];
     const ExtHeaders = ['Content-Type:application/x-www-form-urlencoded;charset=utf-8'];
     const ERRCODES = ['-10', '-12', '-13', '-14', '-15', '-16', '-18', '-21'];
     //key格式 卡类型-面值-regin_no
     const Price = [
-        "4-10-24" => 9.41, "4-20-24" => 18.82, "4-30-24" => 28.23, "4-50-24" => 47.05, "4-100-24" => 94.1, "4-200-24" => 188.2, "4-300-24" => 282.3, "4-500-24" => 470.5,//贵州 24
-        "4-10-15" => 9.47, "4-20-15" => 18.94, "4-30-15" => 28.41, "4-50-15" => 47.35, "4-100-15" => 94.7, "4-200-15" => 189.4, "4-300-15" => 284.1, "4-500-15" => 473.5,//山东 15
-        "4-10-25" => 9.47, "4-20-25" => 18.94, "4-30-25" => 28.41, "4-50-25" => 47.35, "4-100-25" => 94.7, "4-200-25" => 189.4, "4-300-25" => 284.1, "4-500-25" => 473.5,//云南 25
-        "4-10-28" => 9.47, "4-20-28" => 18.94, "4-30-28" => 28.41, "4-50-28" => 47.35, "4-100-28" => 94.7, "4-200-28" => 189.4, "4-300-28" => 284.1, "4-500-28" => 473.5,//甘肃 28
-        "4-10-4" => 9.47, "4-20-4" => 18.94, "4-30-4" => 28.41, "4-50-4" => 47.35, "4-100-4" => 94.7, "4-200-4" => 189.4, "4-300-4" => 284.1, "4-500-4" => 473.5,//山西 4
-        "4-10-10" => 9.47, "4-20-10" => 18.94, "4-30-10" => 28.41, "4-50-10" => 47.35, "4-100-10" => 94.7, "4-200-10" => 189.4, "4-300-10" => 284.1, "4-500-10" => 473.5,//江苏 10
-        "4-10-11" => 9.47, "4-20-11" => 18.94, "4-30-11" => 28.41, "4-50-11" => 47.35, "4-100-11" => 94.7, "4-200-11" => 189.4, "4-300-11" => 284.1, "4-500-11" => 473.5,//浙江 11
-        "4-10-13" => 9.47, "4-20-13" => 18.94, "4-30-13" => 28.41, "4-50-13" => 47.35, "4-100-13" => 94.7, "4-200-13" => 189.4, "4-300-13" => 284.1, "4-500-13" => 473.5,//福建 13
+        "4-30-24" => 28.23, "4-50-24" => 47.05, "4-100-24" => 94.1, "4-200-24" => 188.2,//贵州 24
+        "4-30-25" => 28.23, "4-50-25" => 47.05, "4-100-25" => 94.1, "4-200-25" => 188.2,//云南 25
     ];
 }

+ 12 - 11
helper/refill/api/yl/yunchonggongfs/开户信息.txt

@@ -1,13 +1,14 @@
-后台地址:http://119.23.54.206:8888
-帐号:linfen
-密码:449997
-二级密码:uxXx3131
-appId:rUKN5DzuzQ
-appSecret:uFDmKKqPFxEEZLLs
+后台地址:http://39.108.50.235:8888
+帐号:yf11
+密码:407453
+二级密码:yiMu5052
+appId:MEEJnMSL9H
+appSecret:cpWFarCEUDnCcMWQ
 后台-商品列表,可查看已配置商品信息
 后台-安全中心,可配置IP白名单
-接口文档:https://www.showdoc.com.cn/900133176881927?page_id=4798465261069610
-下单接口地址:http://119.23.54.206:8911/api/order/submit
-查单接口地址:http://119.23.54.206:8911/api/order/query
-余额接口地址:http://119.23.54.206:8911/api/account/balance
-提卡接口地址:http://119.23.54.206:8911/api/card/get
+接口文档:https://www.showdoc.com.cn/1686453783298366/7925312871840290
+话费直充接口:http://39.108.50.235:8911/api/hf/order/submit
+通用直充接口:http://39.108.50.235:8911/api/order/submit
+卡密提取接口:http://39.108.50.235:8911/api/card/get
+查询接口接口:http://39.108.50.235:8911/api/order/query
+余额查询接口:http://39.108.50.235:8911/api/account/balance

+ 20 - 18
plot/app.py

@@ -1,7 +1,3 @@
-from gevent import monkey
-from gevent.pywsgi import WSGIServer
-from gevent import signal as geventsig
-import gevent
 from flask import Flask
 import base64
 from io import BytesIO
@@ -28,9 +24,10 @@ logging.basicConfig(filename='/var/www/html/data/log/flask.log',
                     level=logging.DEBUG)
 logger = logging.getLogger('plot')
 
-from refill import ChannelPainter,MerchantPainter
+from refill import ChannelPainter, MerchantPainter
 from refill import filter_chname, filter_cardtype, filter_mchids, get_channels, get_mchids
 
+
 def parse_parmeter():
     end_time = request.args.get('end_time')
     end_time = None if end_time is None else int(end_time.strip())
@@ -49,12 +46,12 @@ def parse_parmeter():
     if filter_wave is not None:
         filter_wave = int(filter_wave.strip())
 
-    return start_time,end_time,card_types,spec,filter_wave
+    return start_time, end_time, card_types, spec, filter_wave
+
 
 def onError(ex):
     logger.error(ex)
-    data = base64.b64encode(b'').decode("ascii")
-    return f"<img src='data:image/png;base64,{data}'/>"
+    return jsonify({'state': 'fail'})
 
 
 @app.route('/plot/ch_ratio')
@@ -66,13 +63,14 @@ def ch_ratio():
         chnames = filter_chname(chnames)
 
         painter = ChannelPainter(start_time=start_time, end_time=end_time, chnames=chnames, card_types=card_types, spec=spec, filter_wave=filter_wave)
-        buf = painter.paint()
+        buf, ratios = painter.paint()
         data = base64.b64encode(buf.getbuffer()).decode("ascii")
 
-        return f"<img src='data:image/png;base64,{data}'/>"
+        return jsonify({'img': data, 'ratios': ratios, 'state': 'success'})
     except Exception as ex:
         return onError(ex)
 
+
 @app.route('/plot/channels')
 def channels():
     try:
@@ -82,6 +80,7 @@ def channels():
         logger.error(ex)
         return jsonify([])
 
+
 @app.route('/plot/mchids')
 def mchids():
     try:
@@ -91,6 +90,7 @@ def mchids():
         logger.error(ex)
         return jsonify([])
 
+
 @app.route('/plot/mch_ratio')
 def mch_ratio():
     try:
@@ -100,13 +100,14 @@ def mch_ratio():
         mchids = filter_mchids(mchids)
 
         painter = MerchantPainter(start_time=start_time, end_time=end_time, mchids=mchids, card_types=card_types, spec=spec, filter_wave=filter_wave)
-        buf = painter.paint_ratios()
+        buf, ratios = painter.paint_ratios()
         data = base64.b64encode(buf.getbuffer()).decode("ascii")
 
-        return f"<img src='data:image/png;base64,{data}'/>"
+        return jsonify({'img': data, 'ratios': ratios, 'state': 'success'})
     except Exception as ex:
         return onError(ex)
 
+
 @app.route('/plot/mch_order_send')
 def mch_order_send():
     try:
@@ -116,13 +117,13 @@ def mch_order_send():
         mchids = filter_mchids(mchids)
 
         painter = MerchantPainter(start_time=start_time, end_time=end_time, mchids=mchids, card_types=card_types, spec=spec, filter_wave=filter_wave)
-        buf = painter.paint_refilling()
+        buf, mchids = painter.paint_refilling()
         data = base64.b64encode(buf.getbuffer()).decode("ascii")
-
-        return f"<img src='data:image/png;base64,{data}'/>"
+        return jsonify({'img': data, 'mchids': mchids, 'state': 'success'})
     except Exception as ex:
         return onError(ex)
 
+
 @app.route('/plot/index')
 def index():
     app.logger.debug('start')
@@ -146,7 +147,7 @@ def index():
     else:
         interval = int(interval)
 
-    buf = dataCenter.draw_plot(time_stamp, 
+    buf = dataCenter.draw_plot(time_stamp,
                                interval=interval,
                                chname=chname,
                                quality=quality,
@@ -166,6 +167,7 @@ def days():
     dates = dates[0:30]
     return jsonify(dates)
 
+
 @app.route('/plot/paths')
 def paths():
     time_stamp = request.args.get('time_stamp')
@@ -219,7 +221,7 @@ def mchplot():
 
 
 if __name__ == "__main__":
-    debug_mode = False
+    debug_mode = True
     if debug_mode:
         app.run(debug=True, host='0.0.0.0', port=5000)
     else:
@@ -231,4 +233,4 @@ if __name__ == "__main__":
         http_server = WSGIServer(('0.0.0.0', 5000), app)
         geventsig.signal(sig.SIGTERM, lambda: http_server.stop())
         geventsig.signal(sig.SIGINT, lambda: http_server.stop())
-        http_server.serve_forever()
+        http_server.serve_forever()

+ 18 - 1
plot/plot_control.py

@@ -12,7 +12,7 @@ import signal as sig
 import sys, getopt
 
 from refill import ChannelPainter,MerchantPainter
-from refill import filter_chname,filter_cardtype,filter_mchids
+from refill import filter_chname, filter_cardtype, filter_mchids, get_channels, get_mchids
 
 logging.basicConfig(filename='/var/www/html/data/log/flask.log',
                     format='%(levelname)10s  %(asctime)s  %(name)10s %(thread)d %(message)s',
@@ -61,6 +61,23 @@ def ch_ratio():
     except Exception as ex:
         return onError(ex)
 
+@app.route('/plot/channels')
+def channels():
+    try:
+        channels = get_channels()
+        return jsonify(channels)
+    except Exception as ex:
+        logger.error(ex)
+        return jsonify([])
+
+@app.route('/plot/mchids')
+def mchids():
+    try:
+        mchids = get_mchids()
+        return jsonify(mchids)
+    except Exception as ex:
+        logger.error(ex)
+        return jsonify([])
 
 @app.route('/plot/mch_ratio')
 def mch_ratio():

+ 13 - 3
plot/refill/ChannelPainter.py

@@ -129,15 +129,25 @@ class ChannelPainter(object):
         else:
             window = None
 
+        chname_ratios = []
         for _chname, _card_type, _spec, _data in gen:
             succ, count, y = calc_chratios(_data, pos_map, self._start_time - day_stamp, self._end_time - day_stamp)
             y = np.convolve(y, window, 'same') if window is not None else y
-            ax.plot(x, y, ls='-', label=self._label(chname=_chname, succ=succ, count=count, card_type=_card_type, spec=_spec))
+            label, ratio = self._label(chname=_chname, succ=succ, count=count, card_type=_card_type, spec=_spec)
+            ax.plot(x, y, ls='-', label=label)
+            if _card_type is None and _spec is None and _chname != 'all':
+                chname_ratios.append((_chname, ratio))
 
         ticks = [d - self._start_time for d in range(self._start_time, self._end_time + 1, self._interval)]
         xlables = [time.strftime('%d-%H:%M:%S', time.localtime(d + self._start_time)) for d in ticks]
+        buf = fig_flush(ax, fig, ticks, xlables)
 
-        return fig_flush(ax, fig, ticks, xlables)
+        chname_ratios = sorted(chname_ratios, key=lambda x: (x[1], x[0]), reverse=True)
+        result = []
+        for name, ratio in chname_ratios:
+            result.append(f'{name}:{ratio}')
+
+        return buf, result
 
     def _label(self, chname, succ, count, card_type=None, spec=None):
         _card_type = None
@@ -167,4 +177,4 @@ class ChannelPainter(object):
             ratio = 0.00
         lable += f":{succ}/{count}={ratio}%"
 
-        return lable
+        return lable, ratio

+ 69 - 22
plot/refill/MerchantPainter.py

@@ -143,15 +143,26 @@ class MerchantPainter(object):
         else:
             window = None
 
+        mchid_ratios = []
         for _mchid, _card_type, _spec, _data in gen:
             succ, count, y = calc_mchratios(_data, pos_map, self._start_time - day_stamp, self._end_time - day_stamp)
             y = np.convolve(y, window, 'same') if window is not None else y
-            ax.plot(x, y, ls='-', label=self._label(chname=_mchid, succ=succ, count=count, card_type=_card_type, spec=_spec))
+            label, ratio = self._label(chname=_mchid, succ=succ, count=count, card_type=_card_type, spec=_spec)
+            ax.plot(x, y, ls='-', label=label)
+            if _card_type is None and _spec is None and type(_mchid) is int:
+                mchid_ratios.append((_mchid, ratio))
 
         xticks = [d - self._start_time for d in range(self._start_time, self._end_time + 1, self._interval)]
         xlables = [time.strftime('%d-%H:%M:%S', time.localtime(d + self._start_time)) for d in xticks]
 
-        return fig_flush(ax, fig, xticks=xticks, xlables=xlables)
+        buf = fig_flush(ax, fig, xticks=xticks, xlables=xlables)
+
+        mchid_ratios = sorted(mchid_ratios, key=lambda x: (x[1], x[0]), reverse=True)
+        result = []
+        for mchid,ratio in mchid_ratios:
+            result.append(f'{mchid}:{ratio}')
+
+        return buf, result
 
     def _label(self, chname, succ, count, card_type=None, spec=None):
         _card_type = None
@@ -181,18 +192,21 @@ class MerchantPainter(object):
             ratio = 0.00
         lable += f":{succ}/{count}={ratio}%"
 
-        return lable
+        return lable,ratio
 
     ##################################################################################################################################################
     def _fig_bar_funs(self):
         def create():
-            fig = Figure(figsize=(19, 8))
-            ax = fig.subplots()
-            ax.set_title('sending order count monitor')
-            ax.set(xlabel='merchant id', ylabel='count')
-            return ax, fig
+            fig = Figure(figsize=(19, 16))
+            ax_count, ax_amount = fig.subplots(2, 1)
+            ax_count.set_title('sending order count monitor')
+            ax_count.set(xlabel='merchant id', ylabel='count')
 
-        def flush(ax, fig, xticks=None, xlables=None, yticks=None, ylables=None):
+            ax_amount.set_title('sending order amount monitor')
+            ax_amount.set(xlabel='merchant id', ylabel='amount')
+            return ax_count, ax_amount, fig
+
+        def end(ax, xticks=None, xlables=None, yticks=None, ylables=None):
             if xticks is not None:
                 ax.set_xticks(ticks=xticks)
             if xlables is not None:
@@ -205,13 +219,14 @@ class MerchantPainter(object):
 
             ax.legend()
             ax.grid()
-            fig.autofmt_xdate()
 
+        def flush(fig):
+            fig.autofmt_xdate()
             buf = BytesIO()
             fig.savefig(buf, format="png")
             return buf
 
-        return create, flush
+        return create, end,flush
 
     def paint_refilling(self):
         tuple_pathes = self._reader.many_tuple_path(self._days, self._mchids, self._card_types, self._spec)
@@ -220,30 +235,62 @@ class MerchantPainter(object):
             return BytesIO()
 
         day_stamp = self._days[0]
-        fig_create, fig_flush = self._fig_bar_funs()
-        ax, fig = fig_create()
+        fig_create, fig_end, fig_flush = self._fig_bar_funs()
+        ax_count, ax_amount, fig = fig_create()
 
         lables = list()
         datas = list()
+        mchids = list()
         for _mchid, _card_type, _spec, _data in gen:
             lables.append(f"{_mchid}")
+            logger.debug(_mchid)
+            mchids.append(_mchid)
             ret = calc_morder_send(_data, pos_map, self._start_time - day_stamp, self._end_time - day_stamp)
             datas.append(ret)
-            send_count, submit_count, succ_count, fail_count, amounts, lack = ret
-            logger.debug("mchid=%d send=%d submit=%d succ=%d fail=%d",_mchid,send_count, submit_count, succ_count, fail_count)
+            send_count, submit_count, succ_count, fail_count, submit_amount, succ_amount, fail_amount, send_amount, lack = ret
+            logger.debug("send=%d submit=%d succ=%d fail=%d",send_count, submit_count, succ_count, fail_count)
+            cratio = succ_count / (succ_count + fail_count + 0.0001)
+            aratio = succ_amount / (succ_amount + fail_amount + 0.0001)
+            logger.debug("cratio=%.2f aratio=%.2f", cratio, aratio)
+
+        send_count, submit_count, succ_count, fail_count, submit_amount, succ_amount, fail_amount, send_amount, lack = zip(*datas)
+        self.draw_count(ax_count, lables, send_count, submit_count, succ_count, fail_count, fig_end)
+        self.draw_amount(ax_amount, lables, submit_amount, succ_amount, fail_amount, send_amount, lack, fig_end)
+
+        return fig_flush(fig), mchids
 
-        send_count, submit_count, succ_count, fail_count, amounts, lack = zip(*datas)
+    def draw_count(self, ax, lables, send_count, submit_count, succ_count, fail_count, fig_end):
         width = 0.24
         x_asix = np.arange(len(lables))
 
-        rect_send = ax.bar(x_asix - width * 0.5, list(send_count), width, label='send', align='center')
+        rect_send = ax.bar(x_asix - width * 0.5, list(send_count), width, label='sending', align='center')
         rect_submit = ax.bar(x_asix - width * 1.5, list(submit_count), width, label='summit',align='center')
         rect_succ = ax.bar(x_asix + width * 0.5, list(succ_count), width, label='succ',align='center')
         rect_fail = ax.bar(x_asix + width * 1.5, list(fail_count), width, label='fail', align='center')
 
-        ax.bar_label(rect_send, padding=0, rotation=270)
-        ax.bar_label(rect_submit, padding=0, rotation=270)
-        ax.bar_label(rect_succ, padding=0, rotation=270)
-        ax.bar_label(rect_fail, padding=0, rotation=270)
+        ax.bar_label(rect_send, padding=0, rotation=270, fmt='%d')
+        ax.bar_label(rect_submit, padding=0, rotation=270, fmt='%d')
+        ax.bar_label(rect_succ, padding=0, rotation=270, fmt='%d')
+        ax.bar_label(rect_fail, padding=0, rotation=270, fmt='%d')
+
+        fig_end(ax, xticks=x_asix, xlables=lables)
+        pass
+
+    def draw_amount(self, ax, lables, submit_amount, succ_amount, fail_amount, send_amount, lack, fig_end):
+        width = 0.18
+        x_asix = np.arange(len(lables))
+
+        rect_submit = ax.bar(x_asix - width * 2, list(submit_amount), width, label='summit',align='center')
+        rect_send = ax.bar(x_asix - width, list(send_amount), width, label='sending', align='center')
+        rect_msucc = ax.bar(x_asix, list(lack), width, label='may succ', align='center')
+        rect_succ = ax.bar(x_asix + width, list(succ_amount), width, label='succ',align='center')
+        rect_fail = ax.bar(x_asix + width * 2, list(fail_amount), width, label='fail', align='center')
 
-        return fig_flush(ax, fig, xticks=x_asix, xlables=lables)
+        ax.bar_label(rect_submit, padding=0, rotation=270, fmt='%.2f')
+        ax.bar_label(rect_send, padding=0, rotation=270, fmt='%.2f')
+        ax.bar_label(rect_msucc, padding=0, rotation=270, fmt='%.2f')
+        ax.bar_label(rect_succ, padding=0, rotation=270, fmt='%.2f')
+        ax.bar_label(rect_fail, padding=0, rotation=270, fmt='%.2f')
+
+        fig_end(ax, xticks=x_asix, xlables=lables)
+        pass

+ 5 - 3
plot/refill/algorithm.py

@@ -32,10 +32,12 @@ def calc_morder_send(data, pos_map: type(EMchPosmap), start: int, end: int):
     view = data[:, start:end]
     sums = np.sum(view, axis=1)
 
-    all_return = sums[pos_map.succ_count] + sums[pos_map.fail_count] + 0.0000001
-    ratio = sums[pos_map.succ_count] / all_return
+    all_return =  sums[pos_map.succ_mch_amounts] + sums[pos_map.fail_mch_amounts] + 0.0000001
+    ratio = sums[pos_map.succ_mch_amounts] / all_return
+
     send_count = sums[pos_map.submit_count] - sums[pos_map.succ_count] - sums[pos_map.fail_count]
     send_amounts = sums[pos_map.submit_amounts] - sums[pos_map.succ_mch_amounts] - sums[pos_map.fail_mch_amounts]
     lack_amounts = send_amounts * ratio
 
-    return send_count, sums[pos_map.submit_count], sums[pos_map.succ_count], sums[pos_map.fail_count], send_amounts, lack_amounts
+    return send_count, sums[pos_map.submit_count], sums[pos_map.succ_count], sums[pos_map.fail_count], sums[pos_map.submit_amounts], \
+           sums[pos_map.succ_mch_amounts], sums[pos_map.fail_mch_amounts], send_amounts, lack_amounts

+ 4 - 4
test/TestRefill.php

@@ -2619,12 +2619,12 @@ class TestRefill extends TestCase
     }
     public function testYunchonggong()
     {
-        $provider = $this->getProvider('yunchonggong');
+//        $provider = $this->getProvider('yunchonggong');
 //        $resp = $provider->balance();
-//        $resp = $provider->add(18500608333, 5, 30, ['order_sn' => $this->make_sn()]);
-        $resp = $provider->query(['order_sn' => '59901635220132734124']);
+//        $resp = $provider->add(13699279618, 4, 100, ['order_sn' => $this->make_sn()]);
+//        $resp = $provider->query(['order_sn' => '86941657084629542911']);
 
-        $body = '{"orderId":"211026114901000481","appId":"c4vuuOV43q","outOrderId":"59901635220132734124","sign":"4749539f129242a13f1f083dbc114f23","orderStatus":"3","completeTime":"20211026115027","orderDesc":"\u8ba2\u5355\u5931\u8d25"}';
+        $body = '{"orderId":"220706131710000002","appId":"ihAIbQsfqg","outOrderId":"86941657084629542911","sign":"0dcf571414e9d3e1eb371a90ad1f0b72","orderStatus":"3","completeTime":"20220706132031","orderDesc":"\u8ba2\u5355\u5931\u8d25"}';
         $params = json_decode($body, true);
         $provider = $this->getProvider('yunchonggong', 'RefillCallback');
         $ret = $provider->verify($params);