瀏覽代碼

admin refill order update where card_type

ayHaru 4 年之前
父節點
當前提交
371107be10
共有 2 個文件被更改,包括 14 次插入1 次删除
  1. 10 1
      admin/control/merchant.php
  2. 4 0
      admin/templates/default/refill.order.index.php

+ 10 - 1
admin/control/merchant.php

@@ -552,7 +552,15 @@ class merchantControl extends SystemControl
             $condition['refill_order.mchid'] = $_GET['mchid'];
         }
         if (!empty($_GET['card_type'])) {
-            $condition['refill_order.card_type'] = $_GET['card_type'];
+            if(in_array($_GET['card_type'] , ['1' , '2' , '4' , '5' , '6'])) {
+                $condition['refill_order.card_type'] = $_GET['card_type'];
+            }
+            if($_GET['card_type'] == 'oil') {
+                $condition['refill_order.card_type'] = ['in' , ['1' , '2']];
+            }
+            if($_GET['card_type'] == 'phone') {
+                $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'];
@@ -572,6 +580,7 @@ class merchantControl extends SystemControl
         $end_unixtime = $if_end_time ? strtotime($_GET['query_end_time']) : null;
         if ($start_unixtime || $end_unixtime) {
             $condition['refill_order.order_time'] = array('time', array($start_unixtime, $end_unixtime));
+            $condition['refill_order.order_time'] = ['time', [$start_unixtime, $end_unixtime]];
         }
         $merchant_list = Model('')->table('merchant')->select();
         foreach ($merchant_list as $key =>$value) {

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

@@ -62,6 +62,10 @@
                                 <?php if ($_GET['card_type'] == '5'){ ?>selected<?php } ?>>中国联通</option>
                         <option value="6"
                                 <?php if ($_GET['card_type'] == '6'){ ?>selected<?php } ?>>中国电信</option>
+                        <option value="oil"
+                                <?php if ($_GET['card_type'] == 'oil'){ ?>selected<?php } ?>>油卡</option>
+                        <option value="phone"
+                                <?php if ($_GET['card_type'] == 'phone'){ ?>selected<?php } ?>>手机卡</option>
                     </select>
                 </td>
                 <th><label>充值额度</label></th>