Browse Source

book_uodate

zz 5 years ago
parent
commit
9a0a3aca66
1 changed files with 9 additions and 2 deletions
  1. 9 2
      app/Console/Kernel.php

+ 9 - 2
app/Console/Kernel.php

@@ -35,9 +35,16 @@ class Kernel extends ConsoleKernel
      */
     protected function schedule(Schedule $schedule)
     {
-        $schedule->command('book:update')->dailyAt('06:00');
+        //$schedule->command('book:update')->dailyAt('06:00');
 
-        $schedule->command('book:update')->dailyAt('18:00');
+        //$schedule->command('book:update')->dailyAt('18:00');
+        $schedule->command('book:update')->hourly()->when(function (){
+            $now_hour = date('G');
+            if($now_hour %4 ==0){
+                return true;
+            }
+            return false;
+        });
 
         //$schedule->command('checkOrderStatus')->everyMinute();
     }