Browse Source

admin update

xiaoyu 3 years ago
parent
commit
c84e2ff10e
2 changed files with 10 additions and 2 deletions
  1. 4 2
      admin/control/ordersendlist.php
  2. 6 0
      data/model/refill_order.model.php

+ 4 - 2
admin/control/ordersendlist.php

@@ -17,7 +17,8 @@ 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() - 180)];
+        $time = time();
+        $condition['refill_order.order_time'] = ['exp', "refill_order.order_time < ({$time} - merchant.time_out)"];
         if (!empty($_GET['mchid'])) {
             $condition['refill_order.mchid'] = $_GET['mchid'];
         }
@@ -83,7 +84,7 @@ class ordersendlistControl extends SystemControl
             $condition['refill_order.quality'] = $_GET['quality'];
         }
 
-        $order_list = $model_refill_order->getMerchantOrderList($condition, 50, 'refill_order.*,vr_order.order_state', 'refill_order.order_time asc');
+        $order_list = $model_refill_order->getMerchantTimeOut($condition, 50, 'refill_order.*,vr_order.order_state', 'refill_order.order_time asc');
 
         $stat = Model('')->table('refill_order,vr_order')->join('inner')
             ->on('refill_order.order_id=vr_order.order_id')
@@ -200,6 +201,7 @@ class ordersendlistControl extends SystemControl
 
     public function orderFormat($order_list, $merchant_list): array
     {
+        if(empty($order_list)) return [];
         $merchants = [];
         foreach ($merchant_list as $value) {
             $merchants[$value['mchid']] = $value;

+ 6 - 0
data/model/refill_order.model.php

@@ -36,6 +36,12 @@ class refill_orderModel extends Model
         return $list;
     }
 
+    public function getMerchantTimeOut($condition, $pagesize = '', $field = '*', $order = 'refill_order.order_id desc', $limit = '', $master = false)
+    {
+        $list = $this->table('refill_order,vr_order,merchant')->field($field)
+            ->where($condition)->join('inner')->on('refill_order.order_id=vr_order.order_id,refill_order.mchid=merchant.mchid')->page($pagesize)->order($order)->limit($limit)->master($master)->select();
+    }
+
     public function getOrderStatsList($condition, $pagesize = '', $field = '*', $order = 'time_stamp desc', $limit = '')
     {
         $list = $this->table('refill_stats')->field($field)