Browse Source

补单监控检索优化

lowkeyman 2 months ago
parent
commit
5e14fda478
2 changed files with 53 additions and 20 deletions
  1. 2 0
      admin/control/ordersendlist.php
  2. 51 20
      admin/templates/default/monitor_transfer.php

+ 2 - 0
admin/control/ordersendlist.php

@@ -262,11 +262,13 @@ class ordersendlistControl extends SystemControl
         }
 
         $cur_time = time();
+        $order_by = 'refill_order.order_time desc';
         $order_list = Model('')->table('refill_order,vr_order,merchant')
             ->join('inner,inner')
             ->on('refill_order.order_id=vr_order.order_id,refill_order.mchid=merchant.mchid')
             ->field("refill_order.*,vr_order.order_state,({$cur_time} - refill_order.order_time - merchant.time_out) as mtime_out")
             ->where($base_cond)
+            ->order($order_by)
             ->select();
 
 

+ 51 - 20
admin/templates/default/monitor_transfer.php

@@ -1,7 +1,7 @@
 <style>
     th label {
         display: inline-block;
-        width: 60px;
+        min-width: 60px;
     }
     .lineLi {
         display: inline-block;
@@ -113,6 +113,16 @@
                            id="endTime" name="query_end_time" autocomplete="off" style="width:120px" />
                 </td>
 
+                <th><label>近期时间(小时内)</label></th>
+                <td>
+                    <select name="time" class="querySelect">
+                        <option value=""><?php echo $lang['nc_please_choose']; ?></option>
+                        <?php for ($i = 1; $i<=3; $i++) { ?>
+                            <option value="<?php echo $i; ?>"<?php if ($_GET['time'] == $i){ ?>selected<?php } ?>><?php echo $i;?>小时</option>
+                        <?php } ?>
+                    </select>
+                </td>
+
                 <th><label>订单状态</label></th>
                 <td>
                     <select name="order_state" class="querySelect order_state">
@@ -354,6 +364,7 @@
         charset="utf-8"></script>
 <script type="text/javascript" src="<?php echo RESOURCE_SITE_URL;?>/refill/layer.js"></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/moment-with-locales.js"></script>
 <script type="text/javascript" src="<?php echo ADMIN_TEMPLATES_URL;?>/layui/layui.js"></script>
 <link rel="stylesheet" type="text/css" href="<?php echo ADMIN_TEMPLATES_URL; ?>/layui/css/layui.css"/>
 <link rel="stylesheet" type="text/css"
@@ -558,25 +569,45 @@
                 layer.close(ii);
             }, 800);
         });
-            // 导出
-    $('#ncexport').click(function () {
-        $('input[name="export"]').val('1');
-        $('input[name="op"]').val('index');
-        // 不包含客户
-        let selectArr = selest_nc.getValue();
-        let selectStr = ''
-        for (let i = 0; i < selectArr.length; i++) {
-            selectStr += selectArr[i].value+','
-        }
-        selectStr = selectStr.substr(0, selectStr.length-1)
-        $('input[name="no_mchid"]').val(selectStr);
-        $('#formSearch').submit();
-        $('input[name="export"]').val('');
-        let ii = layer.load();
-        setTimeout(function(){
-            layer.close(ii);
-        }, 800);
-    })
+
+        // 导出
+        $('#ncexport').click(function () {
+            $('input[name="export"]').val('1');
+            $('input[name="op"]').val('index');
+            // 不包含客户
+            let selectArr = selest_nc.getValue();
+            let selectStr = ''
+            for (let i = 0; i < selectArr.length; i++) {
+                selectStr += selectArr[i].value+','
+            }
+            selectStr = selectStr.substr(0, selectStr.length-1)
+            $('input[name="no_mchid"]').val(selectStr);
+            $('#formSearch').submit();
+            $('input[name="export"]').val('');
+            let ii = layer.load();
+            setTimeout(function(){
+                layer.close(ii);
+            }, 800);
+        });
+
+        //近期时间
+        $("select[name='time']").change(function () {
+            let startTime = "";
+
+            const selectedValue = $(this).val();
+            if (selectedValue === "") {
+                startTime = moment().startOf('day').format('YYYY-MM-DD HH:mm:ss');
+            } else {
+                const date = new Date();
+                const selectedValue = $(this).val();
+                const leftTime = parseInt(selectedValue);
+                const time = date.getTime() - 3600000 * leftTime;
+                startTime = moment(time).format("YYYY-M-DD HH:mm:ss");
+            }
+
+            $("input[name='query_start_time']").val(startTime);
+            $("input[name='query_end_time']").val("");
+        });
     });
     function hCopyOrder(e) {
         let str = ''