stanley-king 3 tahun lalu
induk
melakukan
99bdfa7f72

+ 1 - 1
admin/control/order_search.php

@@ -60,7 +60,7 @@ class order_searchControl extends SystemControl
                 $start = strtotime(date('Y-m-d', time()));
                 $condition['refill_order.order_time'] = ['egt', $start];
             }
-            $order_list = $model_refill_order->getMerchantOrderList($condition, 200, 'refill_order.*,vr_order.order_state', 'refill_order.channel_name DESC ');
+            $order_list = $model_refill_order->getMerchantOrderList($condition, 200, 0,'refill_order.*,vr_order.order_state', 'refill_order.channel_name DESC ');
 
             $merchant_list = Model('')->table('merchant')->limit(1000)->select();
             foreach ($merchant_list as  $value) {

+ 3 - 3
admin/control/ordersendlist.php

@@ -357,7 +357,7 @@ class ordersendlistControl extends SystemControl
             $this->RefillOrderExport($condition);
             return;
         }
-        $order_list = $model_refill_order->getMerchantOrderList($condition, 200, 'refill_order.*,vr_order.order_state', 'refill_order.order_time asc');
+        $order_list = $model_refill_order->getMerchantOrderList($condition, 200, 0,'refill_order.*,vr_order.order_state', 'refill_order.order_time asc');
         $merchant_list = Model('')->table('merchant')->limit(1000)->order('name asc')->select();
         $order_list = $this->orderFormat($order_list, $merchant_list);
 
@@ -491,7 +491,7 @@ class ordersendlistControl extends SystemControl
             $condition['refill_order.notify_time'] = [['gt', $start_day], ['lt', ($cur_time - $notify_time)], 'and'];
         }
 
-        $order_list = $model_refill_order->getMerchantOrderList($condition, 200, 'refill_order.*,vr_order.order_state', 'refill_order.notify_time asc', 1000);
+        $order_list = $model_refill_order->getMerchantOrderList($condition, 200, 0,'refill_order.*,vr_order.order_state', 'refill_order.notify_time asc', 1000);
         $merchant_list = Model('')->table('merchant')->limit(1000)->order('name asc')->select();
         $order_list = $this->orderFormat($order_list, $merchant_list);
 
@@ -519,7 +519,7 @@ class ordersendlistControl extends SystemControl
         $notify_time = $_GET['notify_time'];
         $condition['refill_order.notify_time'] = ['lt', (time() - $notify_time)];
 
-        $order_list = $model_refill_order->getMerchantOrderList($condition, '', 'refill_order.*,vr_order.order_state', 'refill_order.notify_time asc', 1000);
+        $order_list = $model_refill_order->getMerchantOrderList($condition, '', 0,'refill_order.*,vr_order.order_state', 'refill_order.notify_time asc', 1000);
 
         foreach ($order_list as $order) {
             QueueClient::push("NotifyMerchantComplete", ['order_id' => $order['order_id'], 'manual' => true]);

+ 17 - 13
admin/control/refill_order.php

@@ -146,7 +146,7 @@ class refill_orderControl extends SystemControl
             return;
         }
         $merchant_list = $this->merchants();
-        $order_list = $model_refill_order->getMerchantOrderList($cond, 200, 'refill_order.*,vr_order.order_state', 'refill_order.order_time desc');
+        $order_list = $model_refill_order->getMerchantOrderList($cond, 200, 5000,'refill_order.*,vr_order.order_state', 'refill_order.order_time desc');
         $order_list = $this->OrderDataFormat($order_list, $merchant_list);
 
         $provider_list = $this->providers();
@@ -293,13 +293,15 @@ class refill_orderControl extends SystemControl
         $condition['refill_order.mchid'] = $mchid;
 
         $field = 'refill_order.order_sn,refill_order.commit_time,refill_order.notify_time,refill_order.channel_name,vr_order.order_state,refill_order.err_msg,vr_order.close_reason';
-        $order_list = $model_refill_order->getMerchantOrderList($condition, 1000, $field);
+        $order_list = $model_refill_order->getMerchantOrderList($condition, 1000,0, $field);
 
-        foreach ($order_list as $order_id => $order_info) {
+        foreach ($order_list as $order_id => $order_info)
+        {
             $order_list[$order_id]['order_state_text'] = orderState($order_info);
             $order_list[$order_id]['notify_time_text'] = '/';
             $order_list[$order_id]['commit_time_text'] = date("Y-m-d H:i:s", $order_info['commit_time']);
-            if ($order_info['notify_time'] > 0) {
+            if ($order_info['notify_time'] > 0)
+            {
                 if($order_info['commit_time'] == 0) {
                     $diff_time = 0;
                     $order_list[$order_id]['order_state_text'] = '提交失败';
@@ -308,19 +310,21 @@ class refill_orderControl extends SystemControl
                     $diff_time = $order_info['notify_time'] - $order_info['commit_time'];
                     $order_list[$order_id]['notify_time_text'] = date("Y-m-d H:i:s", $order_info['notify_time']);
                 }
-            } else {
-                if($order_info['commit_time'] == 0) {
+            }
+            elseif($order_info['commit_time'] == 0) {
+                $diff_time = 0;
+                $order_list[$order_id]['order_state_text'] = '提交失败';
+                $order_list[$order_id]['commit_time_text'] = '/';
+            }
+            else
+            {
+                $diff_time = time() - $order_info['commit_time'];
+                if($order_info['order_state'] != ORDER_STATE_SEND) {
                     $diff_time = 0;
                     $order_list[$order_id]['order_state_text'] = '提交失败';
-                    $order_list[$order_id]['commit_time_text'] = '/';
-                } else {
-                    $diff_time = time() - $order_info['commit_time'];
-                    if($order_info['order_state'] != ORDER_STATE_SEND) {
-                        $diff_time = 0;
-                        $order_list[$order_id]['order_state_text'] = '提交失败';
-                    }
                 }
             }
+
             if($diff_time != 0) {
                 $order_list[$order_id]['diff_time_text'] = $this->elapse_time($diff_time);
             } else {

+ 5 - 5
admin/control/refill_order_manual.php

@@ -19,7 +19,7 @@ class refill_order_manualControl extends SystemControl
         if (!empty($_GET['order_sn'])) {
             $condition['refill_order.order_sn'] = $_GET['order_sn'];
             $merchant_list = $this->merchants();
-            $order_list = $model_refill_order->getMerchantOrderList($condition, 50, 'refill_order.*,vr_order.order_state', 'refill_order.order_time desc','',true);
+            $order_list = $model_refill_order->getMerchantOrderList($condition, 50,0, 'refill_order.*,vr_order.order_state', 'refill_order.order_time desc','',true);
             $order_list = $this->OrderDataFormat($order_list, $merchant_list);
         }
         Tpl::output('order_list', $order_list);
@@ -130,7 +130,7 @@ class refill_order_manualControl extends SystemControl
                 return $ids;
             };
 
-            $orders = $model_refill_order->getMerchantOrderList($condition, 400, 'refill_order.*,vr_order.order_state', 'refill_order.channel_name DESC ');
+            $orders = $model_refill_order->getMerchantOrderList($condition, 400, 0,'refill_order.*,vr_order.order_state', 'refill_order.channel_name DESC ');
             $orders = $this->OrderDataFormat($orders, $merchant_list);
             $order_ids = array_column($orders,'order_id');
             $order_ids = $unique_array($order_ids);
@@ -198,7 +198,7 @@ class refill_order_manualControl extends SystemControl
         }
 
         $model_refill_order = Model('refill_order');
-        $orders = $model_refill_order->getMerchantOrderList($cond,'','refill_order.*,vr_order.order_state','refill_order.order_id desc',2000);
+        $orders = $model_refill_order->getMerchantOrderList($cond,'',0,'refill_order.*,vr_order.order_state','refill_order.order_id desc',2000);
 
         if($oper_type == 'success')
         {
@@ -270,7 +270,7 @@ class refill_order_manualControl extends SystemControl
         $merchant_list = $this->merchants();
         if(!empty($condition)) {
             $condition['inner_status'] = 0;
-            $order_list = $mod->getMerchantOrderList($condition, 200, 'refill_order.*,vr_order.order_state', 'refill_order.order_time desc');
+            $order_list = $mod->getMerchantOrderList($condition, 200, 0,'refill_order.*,vr_order.order_state', 'refill_order.order_time desc');
             $order_list = $this->OrderDataFormat($order_list, $merchant_list);
             if(empty($mch_orders)) {
                 $mch_orderData = [];
@@ -298,7 +298,7 @@ class refill_order_manualControl extends SystemControl
         $order_id = $_GET['order_id'];
         $condition['refill_order.order_id'] = ['in',$order_id];
 
-        $order_list = Model('refill_order')->getMerchantOrderList($condition,1000,'refill_order.*,vr_order.order_state');
+        $order_list = Model('refill_order')->getMerchantOrderList($condition,1000,0,'refill_order.*,vr_order.order_state');
         foreach ($order_list as $order) {
             if($this->can_cancel_order($order)) {
                 $mchid = $order['mchid'];

+ 1 - 1
admin/control/refill_order_show.php

@@ -13,7 +13,7 @@ class refill_order_showControl extends SystemControl
         $model_refill_order = Model('refill_order');
         $condition['inner_status'] = 0;
 
-        $order_list = $model_refill_order->getMerchantOrderList($condition, 50, 'refill_order.*,vr_order.order_state', 'refill_order.order_time desc');
+        $order_list = $model_refill_order->getMerchantOrderList($condition, 50,0, 'refill_order.*,vr_order.order_state', 'refill_order.order_time desc');
 
         $merchant_list = Model('')->table('merchant')->limit(1000)->select();
         $provider_list = Model('')->table('refill_provider,store')

+ 1 - 1
crontab/control/minutes.php

@@ -657,7 +657,7 @@ class minutesControl extends BaseCronControl
         $model_refill_order = Model('refill_order');
         $condition['order_state'] = ORDER_STATE_SEND;
         $condition['refill_order.order_time'] = ['lt', (time() - 300)];
-        $orders = $model_refill_order->getMerchantOrderList($condition, 1000, 'refill_order.order_id');
+        $orders = $model_refill_order->getMerchantOrderList($condition, 1000, 0,'refill_order.order_id');
         if(!empty($orders)) {
             foreach ($orders as $order) {
                 $order_id = $order['order_id'];

+ 2 - 2
data/model/refill_order.model.php

@@ -28,12 +28,12 @@ class refill_orderModel extends Model
         return $this->table('refill_order')->where(['order_id' => $order_id])->update($data);
     }
 
-    public function getMerchantOrderList($condition, $pagesize = '', $field = '*', $order = 'refill_order.order_id desc', $limit = '', $master = false)
+    public function getMerchantOrderList($condition, $pagesize = '', $total = 0, $field = '*', $order = 'refill_order.order_id desc', $limit = '', $master = false)
     {
         $list = $this->table('refill_order,vr_order')
             ->field($field)
             ->where($condition)->join('inner')->on('refill_order.order_id=vr_order.order_id')
-            ->page($pagesize)
+            ->page($pagesize,$total)
             ->order($order)
             ->limit($limit)
             ->master($master)

+ 1 - 1
mchsrv/control/merchant_order.php

@@ -70,7 +70,7 @@ class merchant_orderControl extends mbMerchantControl
         }
 
         $fields = 'refill_order.*,vr_order.order_state';
-        $order_list = $model_vr_order->getMerchantOrderList($cond, $this->page, $fields, 'refill_order.order_time desc');
+        $order_list = $model_vr_order->getMerchantOrderList($cond, $this->page, 0, $fields, 'refill_order.order_time desc');
         $order_list = $this->merchant_order_format($order_list);
         $result['data'] = $order_list;
         $result['total'] = $model_vr_order->gettotalpage();

+ 2 - 2
mobile/control/merchant_order.php

@@ -47,7 +47,7 @@ class merchant_orderControl extends mbMerchantControl
             $cond['refill_order.order_time'] = ['between', [$_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');
+        $order_list = $model_vr_order->getMerchantOrderList($cond, $this->page,0, $fields, 'refill_order.order_id desc');
         $order_list = $this->merchant_order_format($order_list);
         $result['data'] = $order_list;
         $result['total'] = $model_vr_order->gettotalpage();
@@ -241,7 +241,7 @@ class merchant_orderControl extends mbMerchantControl
             $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, '10000', $fields, 'refill_order.order_id desc');
+        $order_list = $model_vr_order->getMerchantOrderList($cond, '10000',0, $fields, 'refill_order.order_id desc');
         $order_list = $this->merchant_order_format($order_list);
 
         $result = $this->export_order_exec($order_list);