소스 검색

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

stanley-king 3 년 전
부모
커밋
220f0421d7

+ 1 - 1
admin/control/order_search.php

@@ -39,7 +39,7 @@ class order_searchControl extends SystemControl
                 $start = strtotime(date('Y-m-d', time()));
                 $condition['refill_order.order_time'] = ['egt', $start];
             }
-            $order_list = $model_refill_order->getMerchantOrderList($condition, 50, 'refill_order.*,vr_order.order_state', 'refill_order.channel_name DESC ');
+            $order_list = $model_refill_order->getMerchantOrderList($condition, 200, 'refill_order.*,vr_order.order_state', 'refill_order.channel_name DESC ');
 
             $merchant_list = Model('')->table('merchant')->limit(1000)->select();
             foreach ($merchant_list as  $value) {

+ 1 - 1
admin/control/ordersendlist.php

@@ -93,7 +93,7 @@ class ordersendlistControl extends SystemControl
             exit;
         }
 
-        $order_list = $model_refill_order->getMerchantTimeOut($condition, 50, 'refill_order.*,vr_order.order_state', 'refill_order.quality asc,refill_order.order_time asc');
+        $order_list = $model_refill_order->getMerchantTimeOut($condition, 200, 'refill_order.*,vr_order.order_state', 'refill_order.quality asc,refill_order.order_time asc');
 //        $order_list = $model_refill_order->getMerchantOrderList($condition, 50, 'refill_order.*,vr_order.order_state', 'refill_order.order_time asc');
 
         $stat = Model('')->table('refill_order,vr_order,merchant')->join('inner,inner')

+ 25 - 15
admin/control/refill_detail.php

@@ -13,23 +13,24 @@ class refill_detailControl extends SystemControl
     {
         $mod = Model('refill_detail');
         $condition = [];
-        $_GET['query_start_time'] = $_GET['query_start_time'] ?? date("Y-m-d 00:00:00");
+        $_POST['query_start_time'] = $_POST['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}"];
-        if(!empty($_GET['mchid'])) {
-            $condition['mchid'] = $_GET['mchid'];
+        $order_state_handled = ORDER_STATE_HANDLED;
+        $condition['order_state'] = ['in',"{$order_state_send},{$order_state_queue},{$order_state_handled}"];
+        if(!empty($_POST['mchid'])) {
+            $condition['mchid'] = $_POST['mchid'];
         }
-        if(in_array($_GET['order_state'], [$order_state_send,$order_state_queue])) {
-            $condition['order_state'] = $_GET['order_state'];
+        if(in_array($_POST['order_state'], [$order_state_send,$order_state_queue,$order_state_handled])) {
+            $condition['order_state'] = $_POST['order_state'];
         }
-        if (!empty($_GET['mch_orders'])) {
-            $mch_orders = rtrim($_GET['mch_orders'],',');
+        if (!empty($_POST['mch_orders'])) {
+            $mch_orders = rtrim($_POST['mch_orders'],',');
             $condition['mch_order'] = ['in', $mch_orders];
         }
 
-        $start_unixtime = intval(strtotime($_GET['query_start_time']));
-        $end_unixtime = intval(strtotime($_GET['query_end_time']));
+        $start_unixtime = intval(strtotime($_POST['query_start_time']));
+        $end_unixtime = intval(strtotime($_POST['query_end_time']));
         if ($start_unixtime > 0 && $end_unixtime > $start_unixtime) {
             $condition['order_time'] = [['egt', $start_unixtime], ['lt', $end_unixtime], 'and'];
         } elseif ($start_unixtime > 0) {
@@ -47,11 +48,11 @@ class refill_detailControl extends SystemControl
             $merchants[$value['mchid']] = $value;
         }
 
-        if($_GET['export'] == 1) {
+        if($_POST['export'] == 1) {
             $this->RefillDetailExport($condition,$merchants);
             exit;
         }else{
-            $list = $mod->getRefillDetailList($condition,30);
+            $list = $mod->getRefillDetailList($condition,200);
             $list = $this->DataFormat($list,$merchants);
         }
 
@@ -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'] = '/';
             }
@@ -139,7 +142,10 @@ class refill_detailControl extends SystemControl
         $id = $_GET['id'];
         $type = $_GET['type'];
         $condition['detail_id'] = ['in',$id];
-        $condition['order_state'] = ORDER_STATE_QUEUE;
+
+        $order_state_send = ORDER_STATE_SEND;
+        $order_state_queue = ORDER_STATE_QUEUE;
+        $condition['order_state'] = ['in',"{$order_state_send},{$order_state_queue}"];
         $refill_detail = Model('refill_detail')->where($condition)->select();
         $mod = Model('refill_order');
         foreach ($refill_detail as $detail)
@@ -155,7 +161,11 @@ class refill_detailControl extends SystemControl
                 if ($type == 'cancel') {
                     //零元订单失败
                     Log::record("cancel",Log::DEBUG);
-                    util::push_add_zero($params);
+                    if ($detail['order_state'] == ORDER_STATE_SEND) {
+                        util::pop_queue_order($mchid, $mch_order);
+                    } elseif ($detail['order_state'] == ORDER_STATE_QUEUE) {
+                        util::push_add_zero($params);
+                    }
                 } elseif ($type == 'anew') {
                     //重新补充
                     Log::record("anew",Log::DEBUG);
@@ -168,6 +178,6 @@ class refill_detailControl extends SystemControl
                 util::pop_queue_order($mchid,$mch_order);
             }
         }
-        showMessage('操作成功');
+        showMessage('操作成功','index.php?act=refill_detail&op=index');
     }
 }

+ 3 - 3
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;
@@ -126,7 +126,7 @@ class refill_orderControl extends SystemControl
         foreach ($merchant_list as $value) {
             $merchants[$value['mchid']] = $value;
         }
-        $order_list = $model_refill_order->getMerchantOrderList($condition, 50, 'refill_order.*,vr_order.order_state', 'refill_order.order_time desc');
+        $order_list = $model_refill_order->getMerchantOrderList($condition, 200, 'refill_order.*,vr_order.order_state', 'refill_order.order_time desc');
 
         foreach ($order_list as $order_id => $order_info) {
             $order_list[$order_id]['card_type_text'] = $this->scard_type($order_info['card_type']);

+ 1 - 1
admin/control/refill_order_manual.php

@@ -91,7 +91,7 @@ class refill_order_manualControl extends SystemControl
             if($type != 'notify') {
                 $condition['vr_order.order_state'] = ORDER_STATE_SEND;
             }
-            $order_list = $model_refill_order->getMerchantOrderList($condition,'','refill_order.*,vr_order.order_state');
+            $order_list = $model_refill_order->getMerchantOrderList($condition,'','refill_order.*,vr_order.order_state','refill_order.order_id desc',2000);
             if($type == 'success') {
                 foreach ($order_list as $order) {
                     $check_fetch_order = $this->check_fetch_order($order['order_sn']);

+ 10 - 7
admin/templates/default/refill.detail.php

@@ -79,7 +79,7 @@
         </div>
     </div>
     <div class="fixed-empty"></div>
-    <form method="get" action="index.php" name="formSearch" id="formSearch">
+    <form method="post" action="index.php" name="formSearch" id="formSearch">
         <input type="hidden" name="act" value="refill_detail"/>
         <input type="hidden" name="op" value="index"/>
         <table class="tb-type1 noborder search">
@@ -90,7 +90,7 @@
                         <option value=""><?php echo $lang['nc_please_choose']; ?></option>
                         <?php foreach ($output['merchant_list'] as $merchant) { ?>
                             <option value="<?php echo $merchant['mchid'] ?>"
-                                    <?php if ($_GET['mchid'] == $merchant['mchid']){ ?>selected<?php } ?>><?php echo $merchant['company_name'] == '' ? $merchant['name'] : $merchant['company_name']; ?>
+                                    <?php if ($_POST['mchid'] == $merchant['mchid']){ ?>selected<?php } ?>><?php echo $merchant['company_name'] == '' ? $merchant['name'] : $merchant['company_name']; ?>
                             </option>
                         <?php } ?>
                     </select>
@@ -98,15 +98,15 @@
 
                 <th><label for="query_start_time">下单时间</label></th>
                 <td>
-                    <input class="txt date" type="text" value="<?php echo $_GET['query_start_time']; ?>"
+                    <input class="txt date" type="text" value="<?php echo $_POST['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']; ?>"
+                    <input class="txt date" type="text" value="<?php echo $_POST['query_end_time']; ?>"
                            id="endTime" name="query_end_time" autocomplete="off" style="width:120px" />
                 </td>
 
                 <th><label class="query_ors">商家单号(多行查询)</label></th>
-                <td><textarea name="mch_orders" id="mch_orders" cols="30" rows="10"><?php echo $_GET['mch_orders'];?></textarea></td>
+                <td><textarea name="mch_orders" id="mch_orders" cols="30" rows="10"><?php echo $_POST['mch_orders'];?></textarea></td>
 
                 <th><label>订单状态</label></th>
                 <td>
@@ -114,10 +114,13 @@
                     <select name="order_state" class="querySelect">
                         <option value=""><?php echo $lang['nc_please_choose']; ?></option>
                         <option value="<?php echo ORDER_STATE_SEND;?>"
-                                <?php if ($_GET['order_state'] == ORDER_STATE_SEND){ ?>selected<?php } ?>>待收货
+                                <?php if ($_POST['order_state'] == ORDER_STATE_SEND){ ?>selected<?php } ?>>待收货
                         </option>
                         <option value="<?php echo ORDER_STATE_QUEUE;?>"
-                                <?php if ($_GET['order_state'] == ORDER_STATE_QUEUE){ ?>selected<?php } ?>>队列中
+                                <?php if ($_POST['order_state'] == ORDER_STATE_QUEUE){ ?>selected<?php } ?>>队列中
+                        </option>
+                        <option value="<?php echo ORDER_STATE_HANDLED;?>"
+                                <?php if ($_POST['order_state'] == ORDER_STATE_HANDLED){ ?>selected<?php } ?>>已处理
                         </option>
                     </select>
                 </td>

+ 3 - 2
admin/templates/default/refill.order.batch.php

@@ -68,14 +68,15 @@
         //按钮先执行验证再提交表单
         $(".submitBtn").click(function () {
             const txt = $(this).text();
+            const val = $('#order_sn').val();
+            const  number =val.split("\n").length - 1;
             const type = $(this).attr('data-type');
 
             layer.confirm('您确定要'+txt+'吗?', {
                 btn: ['确定', '取消'],
-                title: txt
+                title: '共' +number+ '单'
             }, function () {
                 if ($("#user_form").valid()) {
-                    console.log(type);
                     $("input[name='type']").val(type)
                     $("#user_form").submit();
                 }

+ 19 - 1
admin/templates/default/refill.order.index.php

@@ -278,7 +278,7 @@
                         <span><i class="icon-edit"></i>拷贝充值卡号</span>
                     </a>
                     <a href="#" class="btns" onclick="hCopyOrderSn(event)">
-                        <span><i class="icon-edit"></i>拷贝订单号</span>
+                        <span><i class="icon-edit"></i>拷贝订单号</span>
                     </a>
                     <a href="#" class="btns" id="10_rder">
                         <span><i class="icon-edit"></i>10分钟订单</span>
@@ -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 = ''

+ 2 - 2
data/model/refill_detail.model.php

@@ -9,9 +9,9 @@ class refill_detailModel extends Model
         parent::__construct('refill_detail');
     }
 
-    public function getRefillDetailList($condition, $pagesize = '', $field = '*', $order = 'order_time desc', $limit = '')
+    public function getRefillDetailList($condition, $pagesize = '', $field = '*', $order = 'order_time desc', $limit = '', $master = false)
     {
-        $list = $this->field($field)->where($condition)->page($pagesize)->order($order)->limit($limit)->select();
+        $list = $this->field($field)->where($condition)->page($pagesize)->order($order)->limit($limit)->master($master)->select();
         if (empty($list)) return [];
         return $list;
     }