songxingwei 2 лет назад
Родитель
Сommit
61713ff832
1 измененных файлов с 10 добавлено и 4 удалено
  1. 10 4
      application/api/controller/Timedtask.php

+ 10 - 4
application/api/controller/Timedtask.php

@@ -114,12 +114,18 @@ class Timedtask
      */
     public function SetFake(){
         $now_hour = date('H');
-        if ($now_hour>7 && $now_hour<16){
+        $min = date('i');
+        if (($now_hour>7 && $now_hour<10) || ($now_hour>14 && $now_hour<17)){
+            if ($now_hour==16 && $min>30){
+                die();
+            }
             $all = Db::name('system_day')->where('date',date('Y-m-d'))->value('now_value');
             if ($all>0){
-                $now_time = date('Y-m-d H:i:s');
-                $end_time = date('Y-m-d 16:00:00');
-                $strto = strtotime($end_time)-strtotime($now_time);
+                $now_time = date('Y-m-d 07:00:00');
+                $end_time = date('Y-m-d 10:00:00');
+                $now_time1 = date('Y-m-d 14:00:00');
+                $end_time1 = date('Y-m-d 16:30:00');
+                $strto = (strtotime($end_time)-strtotime($now_time))+(strtotime($end_time1)-strtotime($now_time1));
                 $num = ceil($all/($strto/5));
                 $num_array =array();
                 for ($i=$num-2;$i<=$num+2;$i++){