Explorar o código

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

stanley-king %!s(int64=3) %!d(string=hai) anos
pai
achega
109198d253

+ 7 - 2
admin/control/order_search.php

@@ -41,8 +41,13 @@ class order_searchControl extends SystemControl
             foreach ($order_list as $order_id => $order_info) {
                 $order_list[$order_id]['card_type_text'] = $this->scard_type($order_info['card_type']);
                 $order_list[$order_id]['mch_name'] = $merchants[$order_info['mchid']]['company_name'];
-                $order_list[$order_id]['diff_time_text'] = $this->elapse_time(time() - $order_info['order_time']);
-                $order_list[$order_id]['diff_time'] = time() - $order_info['order_time'];
+                if ($order_info['notify_time'] > 0) {
+                    $diff_time = $order_info['notify_time'] - $order_info['order_time'];
+                } else {
+                    $diff_time = time() - $order_info['order_time'];
+                }
+                $order_list[$order_id]['diff_time_text'] = $this->elapse_time($diff_time);
+                $order_list[$order_id]['diff_time'] = $diff_time;
                 $order_list[$order_id]['quality_text'] = $this->quality_format($order_info['quality'],$order_info['card_type']);
             }
         }

+ 7 - 4
admin/control/ordersendlist.php

@@ -14,7 +14,7 @@ class ordersendlistControl extends SystemControl
         $condition['refill_order.inner_status'] = 0;
         $condition['vr_order.order_state'] = ORDER_STATE_SEND;
 
-        $condition['refill_order.order_time'] = ['lt', (time() - 300)];
+        $condition['refill_order.order_time'] = ['lt', (time() - 180)];
         if (!empty($_GET['mchid'])) {
             $condition['refill_order.mchid'] = $_GET['mchid'];
         }
@@ -63,7 +63,6 @@ class ordersendlistControl extends SystemControl
             $condition = $time_out_order(7200, $condition);
             $time_cond[] = ['lt', (time() - 7200)];
             $_GET['card_type'] = 'phone';
-            $_GET['quality'] = 5;
         }
 
         if (!empty($_GET['card_type'])) {
@@ -154,7 +153,7 @@ class ordersendlistControl extends SystemControl
         Tpl::showpage('refill.order.neterr.index');
     }
 
-    public function orderFormat($order_list, $merchant_list)
+    public function orderFormat($order_list, $merchant_list): array
     {
         $merchants = [];
         foreach ($merchant_list as $value) {
@@ -171,8 +170,12 @@ class ordersendlistControl extends SystemControl
 
             $order_list[$order_id]['diff_time'] = $diff_time;
             $order_list[$order_id]['diff_time_text'] = $this->elapse_time($diff_time);
-
             $order_list[$order_id]['quality_text'] = $this->quality_format($order_info['quality'],$order_info['card_type']);
+            if($diff_time > $merchants[$order_info['mchid']]['time_out']) {
+                $order_list[$order_id]['time_out_state'] = 1;
+            }else{
+                $order_list[$order_id]['time_out_state'] = 0;
+            }
         }
 
         return $order_list;

+ 23 - 2
admin/templates/default/refill.order.send.index.php

@@ -279,7 +279,7 @@
         <?php if (count($output['order_list']) > 0) { ?>
             <?php
             foreach ($output['order_list'] as $key => $order) { ?>
-                <tr class="hover trFlex">
+                <tr class="hover trFlex" id="dataColor" data-timeout_State="<?php echo $order['time_out_state'];?>">
                     <td class="align-center"><?php echo $key + 1; ?></td>
                     <td class="align-left"><?php echo $order['order_sn']; ?></td>
                     <td class="align-center"><?php echo $order['mchid']; ?></td>
@@ -353,6 +353,16 @@
         });
         $('#query_start_time').datepicker({dateFormat: 'yy-mm-dd'});
         $('#query_end_time').datepicker({dateFormat: 'yy-mm-dd'});
+    //  $('#dataColor').each(function () {
+    //      console.log($('#dataColor').attr('data-timeout_State'));
+    //      let data_color = $('#dataColor').attr('data-timeout_State');
+    //      if (data_color == 1) {
+    //         $(this).css('background', '#f1dde6')
+    //      } else {
+    //         $(this).css('background', '#fff')
+    //      }
+    //  })
+        
         // 日期选择器
         laydate.render({
             elem: '#startTime',
@@ -438,10 +448,21 @@
         }
         // 表格hover时背景
         $('.trFlex').each(function () {
+            let data_color = $(this).attr('data-timeout_State');
+         if (data_color == 1) {
+            $(this).css('background', '#f1dde6')
+         } else {
+            $(this).css('background', '#fff')
+         }
             $(this).hover(function () {
                 $(this)[0].style.backgroundColor = '#cbe9f3'
             }, function () {
-                $(this)[0].style.backgroundColor = '#fff'
+                let data_color = $(this).attr('data-timeout_State');
+         if (data_color == 1) {
+            $(this).css('background', '#f1dde6')
+         } else {
+            $(this).css('background', '#fff')
+         }
             })
         })
         // 供方名称颜色

+ 10 - 1
helper/refill/api/xyz/lingzhman/RefillPhone.php

@@ -80,7 +80,16 @@ class RefillPhone extends refill\IRefillPhone
                 $save['official_sn'] = strtolower($resp['voucherNo']) == 'null' ? '' : $resp['voucherNo'];
                 Model('refill_order')->edit($refill_info['order_id'], $save);
             } elseif (in_array($status,config::QueryErrCodes)) {
-                $order_state = ORDER_STATE_CANCEL;
+                if ($status === '026') {
+                    //订单不存在状态,三小时内查询可失败,超过则返回充值中
+                    if (time() - $refill_info['commit_time'] <= 10800) {
+                        $order_state = ORDER_STATE_CANCEL;
+                    } else {
+                        $order_state = ORDER_STATE_SEND;
+                    }
+                } else {
+                    $order_state = ORDER_STATE_CANCEL;
+                }
             } elseif ($status === '002') {
                 $order_state = ORDER_STATE_SEND;
             } else {

+ 12 - 3
helper/refill/api/xyz/lingzhman48/RefillPhone.php

@@ -24,7 +24,7 @@ class RefillPhone extends refill\IRefillPhone
         return $params;
     }
 
-    public function add($card_no, $card_type, $amount, $params,&$net_errno = 0)
+    public function add($card_no, $card_type, $amount, $params,&$net_errno = 0): array
     {
         $params = $this->req_params($card_no, $params['order_sn']);
         $params['flowCode'] = config::ProductIDS[$card_type][$amount];
@@ -55,7 +55,7 @@ class RefillPhone extends refill\IRefillPhone
         }
     }
 
-    public function query($refill_info)
+    public function query($refill_info): array
     {
         $params['account'] = config::ACCOUNT;
         $params['consumerNo'] = $refill_info['order_sn'];
@@ -80,7 +80,16 @@ class RefillPhone extends refill\IRefillPhone
                 $save['official_sn'] = strtolower($resp['voucherNo']) == 'null' ? '' : $resp['voucherNo'];
                 Model('refill_order')->edit($refill_info['order_id'], $save);
             } elseif (in_array($status,config::QueryErrCodes)) {
-                $order_state = ORDER_STATE_CANCEL;
+                if ($status === '026') {
+                    //订单不存在状态,三小时内查询可失败,超过则返回充值中
+                    if (time() - $refill_info['commit_time'] <= 10800) {
+                        $order_state = ORDER_STATE_CANCEL;
+                    } else {
+                        $order_state = ORDER_STATE_SEND;
+                    }
+                } else {
+                    $order_state = ORDER_STATE_CANCEL;
+                }
             } elseif ($status === '002') {
                 $order_state = ORDER_STATE_SEND;
             } else {