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.
49 lines
1.1 KiB
49 lines
1.1 KiB
<?php
|
|
/**
|
|
* 预约门禁
|
|
*/
|
|
|
|
namespace App\Jobs;
|
|
|
|
use App\Models\Config;
|
|
use App\Repositories\DoorRepository;
|
|
use Illuminate\Bus\Queueable;
|
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
|
use Illuminate\Foundation\Bus\Dispatchable;
|
|
use Illuminate\Queue\InteractsWithQueue;
|
|
use Illuminate\Queue\SerializesModels;
|
|
|
|
class SendCourseDoor implements ShouldQueue
|
|
{
|
|
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
|
|
|
public $tries = 3;
|
|
|
|
public $courseSignsModel;
|
|
|
|
/**
|
|
* Create a new job instance.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function __construct($courseSignsModel)
|
|
{
|
|
$this->courseSignsModel = $courseSignsModel;
|
|
}
|
|
|
|
/**
|
|
* Execute the job.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function handle()
|
|
{
|
|
$doors = Config::getValueByKey('course_sign_door');
|
|
$doors = json_decode($doors, true);
|
|
$doorRepository = new DoorRepository();
|
|
foreach ($doors as $door) {
|
|
$doorRepository->generateEmpAuthorSet1ByCourse($this->courseSignsModel, $door, $out);
|
|
}
|
|
}
|
|
}
|