Browse Source

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

stanley-king 4 năm trước cách đây
mục cha
commit
6e05ee87fd

+ 1 - 1
admin/control/merchant.php

@@ -698,7 +698,7 @@ class merchantControl extends SystemControl
         foreach ($merchant_list as $key =>$value) {
             $merchants[$value['mchid']] = $value;
         }
-        $order_list = $model_refill_order->getMerchantOrderList($condition, 30, 'refill_order.*,vr_order.order_state');
+        $order_list = $model_refill_order->getMerchantOrderList($condition, 30, 'refill_order.*,vr_order.order_state', 'refill_order.order_time desc');
 
         $stat = Model('')->table('refill_order,vr_order')->join('inner')
             ->on('refill_order.order_id=vr_order.order_id')

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

@@ -1,3 +1,7 @@
+<style>
+    th label { display: inline-block;width: 60px; }
+</style>
+
 <?php defined('InShopNC') or exit('Access Invalid!'); ?>
 <div class="page">
     <div class="fixed-bar">
@@ -108,10 +112,16 @@
                        title="<?php echo $lang['nc_query']; ?>">&nbsp;
                     </a>
                 </td>
+            </tr>
+            <tr>
+                <td></td>
                 <td>
                     <a href="#" class="btns" onclick="hCopyChannel(event)">
                         <span><i class="icon-edit"></i>拷贝渠道单号</span>
                     </a>
+                    <a href="#" class="btns" onclick="hCopyCardNo(event)">
+                        <span><i class="icon-edit"></i>拷贝充值卡号</span>
+                    </a>
                 </td>
             </tr>
             </tbody>
@@ -244,4 +254,19 @@
         document.execCommand("Copy"); // 执行浏览器复制命令
         oInput.parentNode.removeChild(oInput)
     }
+    function hCopyCardNo(e) {
+        let str = ''
+        $('#tbody tr').each(function () {
+            let res = $(this).find('td').eq(4).text()
+            str += res + '\n'
+        })
+        let oInput = document.createElement("textarea");
+        oInput.style.border = "0 none";
+        oInput.style.color = "transparent";
+        oInput.value = str;
+        document.body.appendChild(oInput);
+        oInput.select(); // 选择对象
+        document.execCommand("Copy"); // 执行浏览器复制命令
+        oInput.parentNode.removeChild(oInput)
+    }
 </script> 

+ 3 - 1
helper/refill/RefillFactory.php

@@ -435,6 +435,7 @@ class RefillFactory
         $checker = function ($refill, $order) {
             $state = intval($order['order_state']);
             if ($state !== ORDER_STATE_SEND) {
+                Log::record("retry false:order_state != send", Log::DEBUG);
                 return false;
             }
 
@@ -445,6 +446,7 @@ class RefillFactory
 
             $period = time() - $refill['order_time'];
             if ($period >= 15 * 60) {
+                Log::record("retry false:time > 15m", Log::DEBUG);
                 return false;
             }
 
@@ -469,7 +471,7 @@ class RefillFactory
         $card_name = $refill_info['card_name'] ?? '';
 
         [$success, $err] = $this->add($mchid, $buyer_id, $amount, $card_no, $mch_order, $idcard, $card_name, $notify_url, $order_time, $commit_times);
-
+        Log::record("retry result:{$success}", Log::DEBUG);
         return ($success === true);
     }
 

+ 25 - 7
mobile/control/merchant_order.php

@@ -14,9 +14,16 @@ class merchant_orderControl extends mbMerchantControl
 
         $cond['mchid'] = $this->mchid();
         $cond['inner_status'] = 0;
-        $cond['refill_order.order_time'] = ['time', [strtotime(date("Y-m-d")), strtotime(date("Y-m-d"))]];
         if (!empty($_GET['card_type'])) {
-            $cond['refill_order.card_type'] = $_GET['card_type'];
+            if(in_array($_GET['card_type'] , ['1' , '2' , '4' , '5' , '6'])) {
+                $cond['refill_order.card_type'] = $_GET['card_type'];
+            }
+            if($_GET['card_type'] == 'oil') {
+                $cond['refill_order.card_type'] = ['in' , ['1' , '2']];
+            }
+            if($_GET['card_type'] == 'phone') {
+                $cond['refill_order.card_type'] = ['in' , ['4' , '5' , '6']];
+            }
         }
         if (!empty($_GET['card_no'])) {
             $cond['refill_order.card_no'] = $_GET['card_no'];
@@ -37,7 +44,7 @@ class merchant_orderControl extends mbMerchantControl
             }
         }
         if ($_GET['start_time'] > 0 && $_GET['end_time'] > 0) {
-            $cond['refill_order.order_time'] = ['between', [$_GET['start_time'], $_GET['end_time']]];
+            $cond['refill_order.order_time'] = ['time', [$_GET['start_time'], $_GET['end_time']]];
         }
         $fields = 'refill_order.*,vr_order.order_state';
         $order_list = $model_vr_order->getMerchantOrderList($cond, $this->page, $fields, 'refill_order.order_id desc');
@@ -137,10 +144,21 @@ class merchant_orderControl extends mbMerchantControl
     {
         $minutes = intval($seconds / 60);
         $second = intval($seconds % 60);
-        if($minutes > 0){
-            $result = "{$minutes}:{$second}s";
-        }else{
-            $result = "{$second}s";
+        if($minutes >= 60) {
+            $minute = $minutes % 60;
+            $hours = intval($minutes / 60);
+            $result = "{$minute}:{$second}";
+        }
+        else {
+            if($minutes > 0){
+                $result = "{$minutes}:{$second}";
+            }else{
+                $result = "{$second}";
+            }
+        }
+        if(isset($hours))
+        {
+            $result = "{$hours}:" . $result;
         }
         return $result;
     }