瀏覽代碼

admin refill order update

ayHaru 4 年之前
父節點
當前提交
52cd1941e1
共有 1 個文件被更改,包括 12 次插入10 次删除
  1. 12 10
      admin/control/merchant.php

+ 12 - 10
admin/control/merchant.php

@@ -658,10 +658,7 @@ class merchantControl extends SystemControl
     public function refill_orderOp()
     {
         $model_refill_order = Model('refill_order');
-        $condition['refill_order.inner_status'] = 0;
-        if(!empty($_GET['order_sn']) || !empty($_GET['mch_order']) || !empty($_GET['mchid']) || !empty($_GET['channel_name']) || !empty($_GET['ch_trade_no']) || !empty($_GET['card_no'])) {
-            $condition['refill_order.order_time'] = ['time', [strtotime(date("Y-m-d")), strtotime(date("Y-m-d"))]];
-        }
+        $condition = [];
         if (!empty($_GET['order_sn'])) {
             $condition['refill_order.order_sn'] = $_GET['order_sn'];
         }
@@ -674,6 +671,16 @@ class merchantControl extends SystemControl
         if (!empty($_GET['channel_name'])) {
             $condition['refill_order.channel_name'] = $_GET['channel_name'];
         }
+        if (!empty($_GET['ch_trade_no'])) {
+            $condition['refill_order.ch_trade_no'] = $_GET['ch_trade_no'];
+        }
+        if (!empty($_GET['card_no'])) {
+            $condition['refill_order.card_no'] = $_GET['card_no'];
+        }
+        if(empty($condition)) {
+            $condition['refill_order.order_time'] = ['time', [strtotime(date("Y-m-d")), strtotime(date("Y-m-d"))]];
+        }
+        $condition['refill_order.inner_status'] = 0;
         if (!empty($_GET['card_type'])) {
             if(in_array($_GET['card_type'] , ['1' , '2' , '4' , '5' , '6'])) {
                 $condition['refill_order.card_type'] = $_GET['card_type'];
@@ -685,15 +692,10 @@ class merchantControl extends SystemControl
                 $condition['refill_order.card_type'] = ['in' , ['4' , '5' , '6']];
             }
         }
-        if (!empty($_GET['ch_trade_no'])) {
-            $condition['refill_order.ch_trade_no'] = $_GET['ch_trade_no'];
-        }
-        if (!empty($_GET['card_no'])) {
-            $condition['refill_order.card_no'] = $_GET['card_no'];
-        }
         if (in_array($_GET['refill_amount'], ['10', '20', '30', '50' , '100', '200', '300', '500' , '1000', '20000'])) {
             $condition['refill_order.refill_amount'] = $_GET['refill_amount'];
         }
+
         $if_start_time = preg_match('/^20\d{2}-\d{2}-\d{2}$/', $_GET['query_start_time']);
         $if_end_time = preg_match('/^20\d{2}-\d{2}-\d{2}$/', $_GET['query_end_time']);
         $start_unixtime = $if_start_time ? strtotime($_GET['query_start_time']) : null;