海南旅游SAAS
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

50 lines
978 B

4 years ago
4 years ago
4 years ago
4 years ago
  1. <?php
  2. namespace App\Console\Commands;
  3. use App\Models\Demand;
  4. use App\Traits\DemandTraits;
  5. use Illuminate\Console\Command;
  6. use Illuminate\Support\Facades\Log;
  7. class DemandTimeout extends Command
  8. {
  9. /**
  10. * The name and signature of the console command.
  11. *
  12. * @var string
  13. */
  14. protected $signature = 'demand:timeout';
  15. /**
  16. * The console command description.
  17. *
  18. * @var string
  19. */
  20. protected $description = '需求市场 流拍';
  21. /**
  22. * Create a new command instance.
  23. *
  24. * @return void
  25. */
  26. public function __construct()
  27. {
  28. parent::__construct();
  29. }
  30. /**
  31. * Execute the console command.
  32. *
  33. * @return int
  34. */
  35. public function handle()
  36. {
  37. Log::info(now().'竞标');
  38. //Log::info('定时任务');
  39. Demand::query()
  40. ->where('deadline','<=' ,now())
  41. ->where('status',DemandTraits::$stateKey[0])
  42. ->update(['status' => DemandTraits::$stateKey[2]]);
  43. }
  44. }