Kernel.php 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <?php
  2. namespace App\Console;
  3. use App\Models\Code;
  4. use App\Models\Enroll;
  5. use Illuminate\Console\Scheduling\Schedule;
  6. use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
  7. use Illuminate\Support\Facades\DB;
  8. use Illuminate\Support\Facades\Log;
  9. class Kernel extends ConsoleKernel
  10. {
  11. /**
  12. * The Artisan commands provided by your application.
  13. *
  14. * @var array
  15. */
  16. protected $commands = [
  17. //
  18. ];
  19. /**
  20. * Define the application's command schedule.
  21. *
  22. * @param \Illuminate\Console\Scheduling\Schedule $schedule
  23. * @return void
  24. */
  25. protected function schedule(Schedule $schedule)
  26. {
  27. // $schedule->command('inspire')
  28. // ->hourly();
  29. $schedule->call(function (){
  30. // $monolog = Log::getMonolog();
  31. // $monolog->popHandler();
  32. // Log::useFiles(storage_path('logs/job/error.log'));
  33. // Log::info('test');
  34. // $data=DB::table('fail')->where('season','=',20)
  35. // ->where('status','=',1)
  36. // ->where('type','=',1)
  37. // ->select('number','id')
  38. // ->get();
  39. // foreach ($data as $k=>$v){
  40. // $re=DB::table('inte_review')->where('season','=',20)
  41. // ->where('number',$v->number)->first();
  42. // if (!$re){
  43. // DB::table('review_log')->insert(['number'=>$v->number,'inte_id'=>$v->id]);
  44. // }
  45. // }
  46. })->everyMinute();
  47. }
  48. /**
  49. * Register the commands for the application.
  50. *
  51. * @return void
  52. */
  53. protected function commands()
  54. {
  55. $this->load(__DIR__.'/Commands');
  56. require base_path('routes/console.php');
  57. }
  58. }