Browse Source

admin refill order index 1hour order and refill detail order handled

xiaoyu 3 years ago
parent
commit
1ace2277f8

+ 5 - 2
admin/control/refill_detail.php

@@ -16,11 +16,12 @@ class refill_detailControl extends SystemControl
         $_GET['query_start_time'] = $_GET['query_start_time'] ?? date("Y-m-d 00:00:00");
         $order_state_send = ORDER_STATE_SEND;
         $order_state_queue = ORDER_STATE_QUEUE;
-        $condition['order_state'] = ['in',"{$order_state_send},{$order_state_queue}"];
+        $order_state_handled = ORDER_STATE_HANDLED;
+        $condition['order_state'] = ['in',"{$order_state_send},{$order_state_queue},{$order_state_handled}"];
         if(!empty($_GET['mchid'])) {
             $condition['mchid'] = $_GET['mchid'];
         }
-        if(in_array($_GET['order_state'], [$order_state_send,$order_state_queue])) {
+        if(in_array($_GET['order_state'], [$order_state_send,$order_state_queue,$order_state_handled])) {
             $condition['order_state'] = $_GET['order_state'];
         }
         if (!empty($_GET['mch_orders'])) {
@@ -71,6 +72,8 @@ class refill_detailControl extends SystemControl
                 $list[$key]['order_state_text'] = '待收货';
             } elseif ($value['order_state'] == ORDER_STATE_QUEUE) {
                 $list[$key]['order_state_text'] = '队列中';
+            } elseif ($value['order_state'] == ORDER_STATE_HANDLED) {
+                $list[$key]['order_state_text'] = '已处理';
             } else {
                 $list[$key]['order_state_text'] = '/';
             }

+ 2 - 2
admin/control/refill_order.php

@@ -20,7 +20,7 @@ class refill_orderControl extends SystemControl
     {
         $model_refill_order = Model('refill_order');
         $condition['inner_status'] = 0;
-        $_GET['query_start_time'] = $_GET['query_start_time'] ?? date("Y-m-d H:i:s", strtotime("-10 minutes"));
+        $_GET['query_start_time'] = $_GET['query_start_time'] ?? date("Y-m-d H:i:s", strtotime("-1 hours"));
 
         if (!empty($_GET['order_sn'])) {
             $condition['refill_order.order_sn'] = $_GET['order_sn'];
@@ -89,7 +89,7 @@ class refill_orderControl extends SystemControl
         } elseif ($end_unixtime > 0) {
             $condition['refill_order.order_time'] = ['lt', $end_unixtime];
         } else {
-            $start = time() - 600;
+            $start = time() - 3600;
             $_GET['query_start_time'] = date("Y-m-d H:i:s",$start);
             $condition['refill_order.order_time'] = ['egt', $start];
             $fToday = true;

+ 3 - 0
admin/templates/default/refill.detail.php

@@ -119,6 +119,9 @@
                         <option value="<?php echo ORDER_STATE_QUEUE;?>"
                                 <?php if ($_GET['order_state'] == ORDER_STATE_QUEUE){ ?>selected<?php } ?>>队列中
                         </option>
+                        <option value="<?php echo ORDER_STATE_HANDLED;?>"
+                                <?php if ($_GET['order_state'] == ORDER_STATE_HANDLED){ ?>selected<?php } ?>>已处理
+                        </option>
                     </select>
                 </td>
                 <td>

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

@@ -286,6 +286,9 @@
                     <a href="#" class="btns" id="30_rder">
                         <span><i class="icon-edit"></i>半小时订单</span>
                     </a>
+                    <a href="#" class="btns" id="60_rder">
+                        <span><i class="icon-edit"></i>一小时订单</span>
+                    </a>
                 </td>
                 <td></td>
                 <td>
@@ -810,6 +813,21 @@
             // console.log(formatdate) 
             $('#startTime').val(formatdate)
         })
+        // 60分钟订单
+        $('#60_rder').click(function () {
+            let date=new Date();
+            let min=date.getMinutes();
+            date.setMinutes(min-60);
+            let y = date.getFullYear();
+            let m = (date.getMonth() + 1) < 10 ? ("0" + (date.getMonth() + 1)) : (date.getMonth() + 1);
+            let d = date.getDate() < 10 ? ("0" + date.getDate()) : date.getDate();
+            let h = date.getHours() < 10 ? ('0' + date.getHours()) : date.getHours()
+            let f = date.getMinutes() < 10 ? ('0' + date.getMinutes()) : date.getMinutes()
+            let s = date.getSeconds() < 10 ? ('0' + date.getseconds()) : date.getSeconds()
+            let formatdate = y+'-'+m+'-'+d + " " + h + ":" + f + ":" + s;
+            // console.log(formatdate)
+            $('#startTime').val(formatdate)
+        })
     });
     function hCopyChannel(e) {
         let str = ''