UpdateHkList.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <?php
  2. namespace App\Console\Commands;
  3. use Illuminate\Console\Command;
  4. use Modules\Camera\Enum\CameraEnum;
  5. use Modules\Mine\Entities\MineListExt;
  6. use Modules\Mine\Services\MineServices;
  7. class UpdateHkList extends Command
  8. {
  9. /**
  10. * The name and signature of the console command.
  11. *
  12. * @var string
  13. */
  14. protected $signature = 'hklist:update';
  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 mixed
  34. */
  35. public function handle()
  36. {
  37. $this->updateAreaList();
  38. }
  39. //同步区域列表
  40. public function updateAreaList()
  41. {
  42. //查询使用海康服务器的矿区id
  43. // $mine_id_list = MineListExt::where('is_hak', 1)->pluck('mine_id')->all();
  44. $mine_id_list = MineListExt::where('mine_id', 5)->pluck('mine_id')->all();
  45. foreach ($mine_id_list as $key => $val) {
  46. $result = MineServices::getHaiKangArea($val, CameraEnum::REQUEST_TYPE_LOCAL);
  47. }
  48. }
  49. }