UpdateHkList.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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. class UpdateHkList extends Command
  7. {
  8. /**
  9. * The name and signature of the console command.
  10. *
  11. * @var string
  12. */
  13. protected $signature = 'hklist:update';
  14. /**
  15. * The console command description.
  16. *
  17. * @var string
  18. */
  19. protected $description = '同步海康区域及摄像头列表';
  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. * @return mixed
  33. */
  34. public function handle()
  35. {
  36. $this->updateAreaList();
  37. }
  38. //同步区域列表
  39. public function updateAreaList()
  40. {
  41. //查询使用海康服务器的矿区id
  42. $mine_id_list = MineListExt::where('is_hak', 1)->pluck('id')->all();
  43. foreach ($mine_id_list as $key => $val) {
  44. $result = MineServices::getHaiKangArea($val, CameraEnum::REQUEST_TYPE_LOCAL);
  45. if ($result['status']) {
  46. }
  47. }
  48. }
  49. }