stanley-king 3 năm trước cách đây
mục cha
commit
f4172c2256
2 tập tin đã thay đổi với 29 bổ sung3 xóa
  1. 2 1
      admin/control/control.php
  2. 27 2
      admin/control/refill_order.php

+ 2 - 1
admin/control/control.php

@@ -492,7 +492,8 @@ class SystemControl
         foreach ($merchant_list as  $value) {
             $merchants[$value['mchid']] = $value;
         }
-        foreach ($order_list as $order_id => $order) {
+        foreach ($order_list as $order_id => $order)
+        {
             $order_list[$order_id]['card_type_text'] = $this->scard_type($order['card_type']);
             $order_list[$order_id]['mch_name'] = $merchants[$order['mchid']]['company_name'];
             if ($order['notify_time'] > 0) {

+ 27 - 2
admin/control/refill_order.php

@@ -145,16 +145,41 @@ class refill_orderControl extends SystemControl
             $this->updateOrderSend($cond);
             return;
         }
+
         $merchant_list = $this->merchants();
         $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();
 
+
+        $periodor = function ($start, $end) {
+            $delta = $end - $start;
+            if($delta < 0) return 300;
+
+            if($delta / 86400 >= 5) {
+                $ret = 12 * 3600;
+            }
+            elseif($delta / 86400 >= 1) {
+                $ret = 2 * 3600;
+            }
+            elseif($delta / 3600 > 12) {
+                $ret = 1800;
+            }
+            elseif($delta / 3600 > 3) {
+                $ret = 1200;
+            }
+            else {
+                $ret = 300;
+            }
+
+            return $ret;
+        };
+
         if ($fShowStat)
         {
+            $period = $periodor($start_unixtime,$end_unixtime);
             $manager = new task\manager();
-            $task = $manager->add_task('refill_order_stat',$cond,0,600);
+            $task = $manager->add_task('refill_order_stat',$cond,0,$period);
             if($task->completed() && $task->success())
             {
                 $stat = $task->result();