Parcourir la source

卡单补充 分页

lowkeyman il y a 1 mois
Parent
commit
887a0bc8d1
2 fichiers modifiés avec 27 ajouts et 8 suppressions
  1. 10 8
      admin/control/ordersendlist.php
  2. 17 0
      data/model/refill_order.model.php

+ 10 - 8
admin/control/ordersendlist.php

@@ -312,14 +312,16 @@ class ordersendlistControl extends SystemControl
         }
         else
         {
-            $order_by = 'refill_order.order_time desc';
-            $order_list = Model('')->table('refill_order,vr_order,merchant')
-                ->join('inner,inner')
-                ->on('refill_order.order_id=vr_order.order_id,refill_order.mchid=merchant.mchid')
-                ->field("refill_order.*,vr_order.order_state,({$cur_time} - refill_order.order_time - merchant.time_out) as mtime_out")
-                ->where($base_cond)
-                ->order($order_by)
-                ->select();
+//            $order_by = 'refill_order.order_time desc';
+//            $order_list = Model('')->table('refill_order,vr_order,merchant')
+//                ->join('inner,inner')
+//                ->on('refill_order.order_id=vr_order.order_id,refill_order.mchid=merchant.mchid')
+//                ->field("refill_order.*,vr_order.order_state,({$cur_time} - refill_order.order_time - merchant.time_out) as mtime_out")
+//                ->where($base_cond)
+//                ->order($order_by)
+//                ->select();
+            $order_list = $model_refill_order->getOrderMonitorTransfer($base_cond, 200, 5000,
+                "refill_order.*,vr_order.order_state,({$cur_time} - refill_order.order_time - merchant.time_out) as mtime_out");
 
             $merchant_list = $merchants_getter($all_mchids);
             if(!empty($order_list))

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

@@ -113,6 +113,23 @@ class refill_orderModel extends Model
         return $orders;
     }
 
+    public function getOrderMonitorTransfer($condition, $pagesize = '', $total = 0, $field = '*', $order = 'refill_order.order_time desc', $limit = '', $master = false)
+    {
+        $cur_time = time();
+
+        $list = $this->table('refill_order,vr_order,merchant')
+            ->join('inner,inner')
+            ->on('refill_order.order_id=vr_order.order_id,refill_order.mchid=merchant.mchid')
+            ->field("refill_order.*,vr_order.order_state,({$cur_time} - refill_order.order_time - merchant.time_out) as mtime_out")
+            ->where($condition)
+            ->page($pagesize, $total)
+            ->order($order)
+            ->select();
+
+        if (empty($list)) return [];
+        return $list;
+    }
+
     public function first_item()
     {
         return $this->table('refill_order')->field('order_time')->where(['order_id' => ['gt',0]])->order('order_id asc')->find();