浏览代码

商户超时订单监控 手动指定耗时时间

lowkeyman 1 月之前
父节点
当前提交
7241122e5b
共有 2 个文件被更改,包括 16 次插入2 次删除
  1. 8 2
      admin/control/ordersendlist.php
  2. 8 0
      admin/templates/default/refill.order.send.index.php

+ 8 - 2
admin/control/ordersendlist.php

@@ -13,7 +13,7 @@ class ordersendlistControl extends SystemControl
         parent::__construct();
         parent::__construct();
     }
     }
 
 
-    private function time_cond($timeout_type,$card_type,$cur_time)
+    private function time_cond($timeout_type, $card_type, $cur_time, $manual_time)
     {
     {
         $mintime_getter = function ()
         $mintime_getter = function ()
         {
         {
@@ -91,6 +91,11 @@ class ordersendlistControl extends SystemControl
             else {
             else {
                 $time_cond = [];
                 $time_cond = [];
             }
             }
+        } else if ($manual_time && $manual_time < 24) {
+            $end_offset = intval($manual_time * 3600);
+            $start_offset = intval($end_offset + 1800);
+            $time_cond['refill_order.order_time'] = ['between', [$cur_time - $start_offset, $cur_time - $end_offset]];
+            $time_cond['vr_order.add_time'] = ['between', [$cur_time - $start_offset, $cur_time]];
         }
         }
         else
         else
         {
         {
@@ -115,13 +120,14 @@ class ordersendlistControl extends SystemControl
 
 
         $timeout_type = intval($_GET['time']);
         $timeout_type = intval($_GET['time']);
         $card_type = $_GET['card_type'];
         $card_type = $_GET['card_type'];
+        $manual_time = $_GET['manual_time'];
 
 
         if (!empty($_GET['store_id'])) {
         if (!empty($_GET['store_id'])) {
             $base_cond['vr_order.store_id'] = $_GET['store_id'];
             $base_cond['vr_order.store_id'] = $_GET['store_id'];
         }
         }
 
 
         $cur_time = time();
         $cur_time = time();
-        [$time_cond,$mch_cond,$card_type] = $this->time_cond($timeout_type,$card_type,$cur_time);
+        [$time_cond, $mch_cond, $card_type] = $this->time_cond($timeout_type, $card_type, $cur_time, $manual_time);
 
 
         if (!empty($_GET['mchid'])) {
         if (!empty($_GET['mchid'])) {
             $base_cond['refill_order.mchid'] = $_GET['mchid'];
             $base_cond['refill_order.mchid'] = $_GET['mchid'];

+ 8 - 0
admin/templates/default/refill.order.send.index.php

@@ -235,6 +235,8 @@
                         </option>
                         </option>
                     </select>
                     </select>
                 </td>
                 </td>
+                <th><label>订单耗时(手动)</label></th>
+                <td><input type="text" name="manual_time" value="<?php echo $_GET['manual_time']; ?>" oninput="validateTimeInput(this)"></td>
                 <th><label style="width: 73px;">不包含客户</label></th>
                 <th><label style="width: 73px;">不包含客户</label></th>
                 <td>
                 <td>
                     <div id="selest_nc"></div>
                     <div id="selest_nc"></div>
@@ -725,4 +727,10 @@
         document.execCommand("Copy"); // 执行浏览器复制命令
         document.execCommand("Copy"); // 执行浏览器复制命令
         oInput.parentNode.removeChild(oInput)
         oInput.parentNode.removeChild(oInput)
     }
     }
+
+    function validateTimeInput(input) {
+        if (!/^\d*(\.\d{0,1})?$/.test(input.value)) {
+            input.value = input.value.slice(0, -1);
+        }
+    }
 </script>
 </script>