فهرست منبع

Merge branch 'rprofit' of 39.97.239.116:gyfl/xyzshop into rprofit

stanley-king 2 سال پیش
والد
کامیت
da5509deac
2فایلهای تغییر یافته به همراه93 افزوده شده و 116 حذف شده
  1. 12 0
      admin/control/refill_order.php
  2. 81 116
      admin/templates/default/analysis.new_version.php

+ 12 - 0
admin/control/refill_order.php

@@ -350,6 +350,18 @@ class refill_orderControl extends SystemControl
         echo json_encode($result);
     }
 
+    public function card_type_dataOp()
+    {
+        $result = [
+            ['name' => '中石油', 'value' => mtopcard\PetroChinaCard],
+            ['name' => '中石化', 'value' => mtopcard\SinopecCard],
+            ['name' => '中国移动', 'value' => mtopcard\ChinaMobileCard],
+            ['name' => '中国联通', 'value' => mtopcard\ChinaUnicomCard],
+            ['name' => '中国电信', 'value' => mtopcard\ChinaTelecomCard],
+        ];
+        echo json_encode($result);
+    }
+
     public function refill_third_infoOp()
     {
         $order_id = $_GET['order_id'];

+ 81 - 116
admin/templates/default/analysis.new_version.php

@@ -6,7 +6,7 @@
                 <li><a href="?index.php&act=refill_analysis&op=index&type=provider"><span>通道成功率监控</span></a></li>
                 <li><a href="?index.php&act=refill_analysis&op=index&type=system"><span>平台成功率监控</span></a></li>
                 <li><a href="?index.php&act=refill_analysis&op=merchant_ratios"><span>机构成功率统计</span></a></li>
-                <li><a href="JavaScript:void(0);"><span>新版成功率监控</span></a></li>
+                <li><a href="JavaScript:void(0);" class="current"><span>新版成功率监控</span></a></li>
             </ul>
         </div>
     </div>
@@ -17,32 +17,13 @@
     <form method="get" action="index.php" name="formSearch" id="formSearch" style="min-width: 1200px;">
         <table class="tb-type1 noborder search tableFixed">
             <tr>
-                <th><label>起始日期</label></th>
+                <th><label for="query_start_time">统计时间</label></th>
                 <td>
-                    <select name="time_stamp" id="timeSelect">
-                        <option value=""><?php echo $lang['nc_please_choose']; ?></option>
-                        <?php foreach ($output['days'] as $day => $txt) {?>
-                            <option value="<?php echo $day; ?>"><?php echo $txt; ?></option>
-                        <?php }?>
-                    </select>
-                </td>
-                <th><label>起始时间</label></th>
-                <td>
-                    <select name="time_hour">
-                        <option value=""><?php echo $lang['nc_please_choose']; ?></option>
-                        <?php for ($i = 0; $i <= 23; $i++) {?>
-                            <option value="<?php echo $i; ?>"><?php echo sprintf("%02d",$i); ?>点</option>
-                        <?php }?>
-                    </select>
-                </td>
-                <th><label>起始分钟</label></th>
-                <td>
-                    <select name="minute">
-                        <option value=""><?php echo $lang['nc_please_choose']; ?></option>
-                        <?php for ($i = 0; $i <= 59; $i++) {?>
-                            <option value="<?php echo $i; ?>"><?php echo sprintf("%02d",$i); ?>分</option>
-                        <?php }?>
-                    </select>
+                    <input class="txt date" type="text" value="<?php echo $_GET['query_start_time']; ?>"
+                           id="startTime" name="query_start_time" autocomplete="off" style="width:120px" />
+                    <label for="query_start_time">~</label>
+                    <input class="txt date" type="text" value="<?php echo $_GET['query_end_time']; ?>"
+                           id="endTime" name="query_end_time" autocomplete="off" style="width:120px" />
                 </td>
                 <th><label>间隔</label></th>
                 <td>
@@ -56,32 +37,32 @@
                         <option value="60" selected>1分钟</option>
                     </select>
                 </td>
-                <th><label>通道</label></th>
+                <th><label>通道名称</label></th>
                 <td>
-                    <select name="chname">
-                        <option value=""><?php echo $lang['nc_please_choose']; ?></option>
-                    </select>
+                    <div id="selest_chnames"></div>
                 </td>
-                <th><label>质量</label></th>
+                <th><label>面额</label></th>
                 <td>
-                    <select name="quality">
+                    <select name="amount">
                         <option value=""><?php echo $lang['nc_please_choose']; ?></option>
+                        <option value="10" <?php if ($_GET['refill_amount'] == '10') { ?>selected<?php } ?>>10</option>
+                        <option value="20" <?php if ($_GET['refill_amount'] == '20') { ?>selected<?php } ?>>20</option>
+                        <option value="30" <?php if ($_GET['refill_amount'] == '30') { ?>selected<?php } ?>>30</option>
+                        <option value="50" <?php if ($_GET['refill_amount'] == '50') { ?>selected<?php } ?>>50</option>
+                        <option value="100" <?php if ($_GET['refill_amount'] == '100') { ?>selected<?php } ?>>100</option>
+                        <option value="200" <?php if ($_GET['refill_amount'] == '200') { ?>selected<?php } ?>>200</option>
+                        <option value="300" <?php if ($_GET['refill_amount'] == '300') { ?>selected<?php } ?>>300</option>
+                        <option value="500" <?php if ($_GET['refill_amount'] == '500') { ?>selected<?php } ?>>500</option>
+                        <option value="1000" <?php if ($_GET['refill_amount'] == '1000') { ?>selected<?php } ?>>1000</option>
+                        <option value="2000" <?php if ($_GET['refill_amount'] == '2000') { ?>selected<?php } ?>>2000</option>
                     </select>
                 </td>
                 <th><label>卡类型</label></th>
                 <td>
-                    <select name="card_type">
-                        <option value=""><?php echo $lang['nc_please_choose']; ?></option>
-                    </select>
+                    <div id="select_cardtype"></div>
                 </td>
-                <th><label>面额</label></th>
                 <td>
-                    <select name="amount">
-                        <option value=""><?php echo $lang['nc_please_choose']; ?></option>
-                    </select>
-                </td>
-                <td>
-                    <a href="javascript:void(0);" id="ncsubmit" class="btn-search "
+                    <a href="javascript:void(0);" id="ncsubmit" class="btn-search"
                        title="<?php echo $lang['nc_query']; ?>">&nbsp;
                     </a>
                 </td>
@@ -97,96 +78,80 @@
 <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">
     $(function () {
-        // 前15分钟
-        let time = Date.parse(new Date());
-        time = time - 900000;
-        let hour = moment(time).format("H")
-        let minute = moment(time).format("m")
-        time = time / 1000;
+        laydate.render({
+            elem: '#startTime',
+            type: 'datetime'
+        });
+        laydate.render({
+            elem: '#endTime',
+            type: 'datetime'
+        });
 
-        let interval = $("select[name=interval]").val()
-        let s = window.location.origin + "/plot/index?time_stamp=" + time + "&interval=" + interval
-        let timestamp = new Date(new Date().toLocaleDateString()).getTime() / 1000;
+        let selest_chnames
+        $.get('index.php?act=refill_order&op=provider_data', function (data) {
+            data = JSON.parse(data)
+            selest_chnames = xmSelect.render({
+                el: '#selest_chnames',
+                size: 'mini',
+                filterable: true,
+                style: {
+                    minHeight: '27px',
+                    lineHeight: '27px',
+                    marginLeft: '4px',
+                    width: '250px'
+                },
+                language: 'zn',
+                data: data
+            })
+        })
 
-        $("select[name=time_stamp]").val(timestamp)
-        $("select[name=time_hour]").val(hour)
-        $("select[name=minute]").val(minute)
-        TimeGetWhere(timestamp)
-        $.get( s, function (data){
-            if (!data) {
-                return
-            }
-            $('#box').html(data)
-        });
+        let select_cardtype
+        $.get('index.php?act=refill_order&op=card_type_data', function (data) {
+            data = JSON.parse(data)
+            select_cardtype = xmSelect.render({
+                el: '#select_cardtype',
+                size: 'mini',
+                filterable: true,
+                style: {
+                    minHeight: '27px',
+                    lineHeight: '27px',
+                    marginLeft: '4px',
+                    width: '250px'
+                },
+                language: 'zn',
+                data: data
+            })
+        })
 
-        function TimeGetWhere(time){
-            $.get("index.php?act=refill_analysis&op=analysis_time_get_where&type=provider&timestamp="+time, function (data){
-                if (!data) {
-                    return
-                }
-                data = JSON.parse(data)
-                $("select[name=chname]").find('.chnameOption').remove();
-                $("select[name=quality]").find('.qualityOption').remove();
-                $("select[name=card_type]").find('.ctOption').remove();
-                $("select[name=amount]").find('.amountOption').remove();
-                // 通道
-                for (const key in data.chname) {
-                    $("select[name=chname]").append("<option class='chnameOption' value='"+key+"'>"+data.chname[key]+"</option>")
-                }
-                // 质量
-                for (const key in data.quality) {
-                    $("select[name=quality]").append("<option class='qualityOption' value='"+key+"'>"+data.quality[key]+"</option>")
-                }
-                // 卡类型
-                for (const key in data.card_type) {
-                    $("select[name=card_type]").append("<option class='ctOption' value='"+key+"'>"+data.card_type[key]+"</option>")
-                }
-                // 面额
-                for (const key in data.amount) {
-                    $("select[name=amount]").append("<option class='amountOption' value='"+data.amount[key]+"'>"+data.amount[key]+"</option>")
-                }
-            });
+        function select_set(e){
+            let selectArr = e.getValue();
+            let selectStr = ''
+            for (let i = 0; i < selectArr.length; i++) {
+                selectStr += selectArr[i].value+','
+            }
+            selectStr = selectStr.substr(0, selectStr.length-1)
+            return selectStr
         }
-        $('#timeSelect').change(function () {
-            let val = $(this).val()
-            TimeGetWhere(val);
-        })
+
         $('#ncsubmit').click(function () {
-            let time_stamp = $("select[name=time_stamp]").val()
-            let time_hour = $("select[name=time_hour]").val()
-            let minute = $("select[name=minute]").val()
-            let time = Number(time_stamp) + Number(time_hour)*3600 + Number(minute)*60
+            let start_time = $("select[name=query_start_time]").val()
+            let end_time = $("select[name=query_end_time]").val()
             let interval = $("select[name=interval]").val()
-            let chname = $("select[name=chname]").val()
-            let quality = $("select[name=quality]").val()
-            let card_type = $("select[name=card_type]").val()
+            let chnames = select_set('selest_chnames')
+            let card_types = select_set('select_cardtype')
             let amount = $("select[name=amount]").val()
-            if (!time_stamp) {
+            if (!startTime || !endTime) {
                 layer.msg('请选择时间');
                 return
             }
-            let src = window.location.origin + "/plot/index?time_stamp=" + time + "&interval=" + interval + "&chname=" + chname + "&quality=" + quality + "&card_type=" + card_type + "&amount=" + amount
-            if (!interval) {
-                src = src.replace("&interval=", "")
-            }
-            if (!chname) {
-                src = src.replace("&chname=", "")
-            }
-            if (!quality) {
-                src = src.replace("&quality=", "")
-            }
-            if (!card_type) {
-                src = src.replace("&card_type=", "")
-            }
-            if (!amount) {
-                src = src.replace("&amount=", "")
-            }
+            let src = window.location.origin + "/plot/index?start_time=" + start_time + "&end_time=" + end_time + "&interval=" + interval + "&chnames=" + chnames  + "&card_types=" + card_types + "&amount=" + amount
 
             $.get(src, function (data){
                 if (!data) {