浏览代码

admin update

xiaoyu 3 年之前
父节点
当前提交
da46bd9293

+ 8 - 0
admin/control/control.php

@@ -376,4 +376,12 @@ class SystemControl
         }
         return $result;
     }
+
+    protected function check_fetch_order($order_sn): bool
+    {
+        $mod = Model('fetch_order');
+        $cond['order_sn'] = $order_sn;
+        $res = $mod->order_info($cond);
+        return empty($res);
+    }
 }

+ 3 - 2
admin/control/merchant.php

@@ -787,8 +787,9 @@ class merchantControl extends SystemControl
         $mod_order = Model('vr_order');
         $order_info = $mod_order->getOrderInfo(['order_id' => $order_id]);
 
-        if ((time() - $order_info['order_time']) < 3600) {
-            showMessage('订单时间未超过1小时', 'index.php?act=refill_order&op=index');
+        $check_fetch_order = $this->check_fetch_order($order_info['order_sn']);
+        if($check_fetch_order == false) {
+            showMessage('此订单不可手动操作,请联系抢单人员操作!');
         }
         if ($type == 'success') {
             refill\util::manual_success($order_id);

+ 8 - 4
admin/control/refill_order_manual.php

@@ -50,14 +50,14 @@ class refill_order_manualControl extends SystemControl
         $mod_order = Model('vr_order');
         $order_info = $mod_order->getOrderInfo(['order_id' => $order_id]);
 
-        if ((time() - $order_info['order_time']) < 3600) {
-            showMessage('订单时间未超过1小时', 'index.php?act=refill_order&op=index');
-        }
-
         $mod_refill = Model('refill_order');
         $logic_vr_order = Logic("vr_order");
         $refill_info = Model('refill_order')->getOrderInfo(['order_id' => $order_id]);
 
+        $check_fetch_order = $this->check_fetch_order($order_info['order_sn']);
+        if($check_fetch_order == false) {
+            showMessage('此订单不可手动操作,请联系抢单人员操作!');
+        }
         if ($type == 'success') {
             $logic_vr_order->changeOrderStateSuccess($order_id,true);
         } elseif ($type == 'cancel') {
@@ -91,10 +91,14 @@ class refill_order_manualControl extends SystemControl
             $order_list = $model_refill_order->getMerchantOrderList($condition,'','refill_order.*,vr_order.order_state');
             if($type == 'success') {
                 foreach ($order_list as $order) {
+                    $check_fetch_order = $this->check_fetch_order($order['order_sn']);
+                    if($check_fetch_order == false) continue;
                     refill\util::manual_success($order['order_id']);
                 }
             } elseif ($type == 'cancel') {
                 foreach ($order_list as $order) {
+                    $check_fetch_order = $this->check_fetch_order($order['order_sn']);
+                    if($check_fetch_order == false) continue;
                     refill\util::manual_cancel($order['order_id']);
                 }
             } elseif ($type == 'notify'){

+ 60 - 1
admin/templates/default/refill.order.search.php

@@ -86,7 +86,11 @@
                     <td class="align-left"><?php echo $order['card_no']; ?></td>
                     <td class="align-center"><?php echo $order['card_type_text']; ?></td>
                     <td class="align-center"><?php echo $order['refill_amount']; ?></td>
-                    <td class="align-right"><?php echo date('Y-m-d H:i:s', $order['order_time']); ?></td>
+                    <td class="align-right">
+                        <span class="doubleclick"  data-order="<?php echo $order['order_sn'];?>">
+                            <?php echo date('Y-m-d H:i:s', $order['order_time']); ?>
+                        </span>
+                    </td>
                     <td class="align-right">
                         <?php if (empty($order['notify_time'])) {
                             if ($order['diff_time'] >= 1800 && $order['diff_time'] <= 3600) {
@@ -165,6 +169,61 @@
                 window.location.reload();
             }, 60000);
         }
+                //双击
+                $('.doubleclick').dblclick(function() {
+            let db_click = $(this).attr('data-order')
+            $.get('index.php?act=refill_order&op=showOrders', {
+                order_sn:db_click
+            }, function(data) {
+                data = JSON.parse(data)
+                if (data.state == 1) {
+                    
+                var dbclick = data.data
+                let ConentArr = [];
+                let html = ''; 
+                for (let i = 0; i < dbclick.length; i++) {
+                    var item = dbclick[i];
+                    html += `
+                    <tr>
+                         <td class="db-center">${item.order_sn}</td>
+                         <td class="db-center">${item.commit_time_text}</td>
+                         <td class="db-center">${item.notify_time_text}</td>
+                         <td class="db-center">${item.diff_time_text}</td>
+                         <td class="db-center">${item.order_state_text}</td>
+                         <td class="db-center">${item.channel_name}</td>
+                         <td class="db-center">${item.err_msg}</td>
+                    <tr>
+                    `
+                }
+                layer.open({
+                   title: `<span>共${data.count}单</span> <span class="db-top">回调状态:${data.mch_notify_state}</span> <span>回调次数:${data.mch_notify_times}</span>` ,
+                   content: `<table>
+                   <thead>
+                             <tr>
+                                 <th class="db-right">订单号</th>
+                                 <th class="db-right">下单日期</th>
+                                 <th class="db-right">回调日期</th>
+                                 <th class="db-right">耗时</th>
+                                 <th class="db-right">订单状态</th>
+                                 <th class="db-right">供方名称</th>
+                                 <th class="db-right">错误原因</th>
+                             </tr>
+                    </thead>
+                             <tbody>
+                             ${html}
+                             </tbody>
+                            </table>`,
+                            
+
+                        });
+                } else {
+                    alert("没有此订单");
+
+                }
+                
+            })
+
+        })
         // 表格hover时背景
         $('.trFlex').each(function () {
             $(this).hover(function () {