CheckCacheRackStorage.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  2. namespace App\Console\Commands;
  3. use App\Station;
  4. use App\StationTask;
  5. use Illuminate\Console\Command;
  6. class CheckCacheRackStorage extends Command
  7. {
  8. /**
  9. * The name and signature of the console command.
  10. *
  11. * @var string
  12. */
  13. protected $signature = 'check:cacheRack';
  14. /**
  15. * The console command description.
  16. *
  17. * @var string
  18. */
  19. protected $description = 'check cache rack storage info';
  20. /**
  21. * Create a new command instance.
  22. *
  23. * @return void
  24. */
  25. public function __construct()
  26. {
  27. parent::__construct();
  28. }
  29. /**
  30. * Execute the console command.
  31. *
  32. */
  33. public function handle()
  34. {
  35. $stations = Station::query()->select("id","code")->where("station_type_id",5)
  36. ->whereNotNull("parent_id")
  37. ->whereNotIn("id",StationTask::query()->select("station_id")
  38. ->where("status","!=","完成")->whereIn("station_id",Station::query()->select("id")->where("station_type_id",5)
  39. ->whereNotNull("parent_id"))->groupBy("station_id"))
  40. ->get();
  41. app("ForeignHaiRoboticsService")->paddingCacheShelf($stations);
  42. }
  43. }