| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- <?php
- namespace App\Console\Commands;
- use Illuminate\Console\Command;
- use Modules\Camera\Enum\CameraEnum;
- use Modules\Mine\Entities\MineListExt;
- use Modules\Mine\Services\MineServices;
- class UpdateHkList extends Command
- {
- /**
- * The name and signature of the console command.
- *
- * @var string
- */
- protected $signature = 'hklist:update';
- /**
- * The console command description.
- *
- * @var string
- */
- protected $description = '同步海康区域及摄像头列表';
- /**
- * Create a new command instance.
- *
- * @return void
- */
- public function __construct()
- {
- parent::__construct();
- }
- /**
- * Execute the console command.
- *
- * @return mixed
- */
- public function handle()
- {
- $this->updateAreaList();
- }
- //同步区域列表
- public function updateAreaList()
- {
- //查询使用海康服务器的矿区id
- // $mine_id_list = MineListExt::where('is_hak', 1)->pluck('mine_id')->all();
- $mine_id_list = MineListExt::where('mine_id', 5)->pluck('mine_id')->all();
- foreach ($mine_id_list as $key => $val) {
- $result = MineServices::getHaiKangArea($val, CameraEnum::REQUEST_TYPE_LOCAL);
- }
- }
- }
|