appointmentModel = $appointmentModel; $this->appointmentConfig = $AppointmentConfig; } /** * Execute the job. * * @return void */ public function handle() { // 预约车牌(有成功的就不会再次预约) $carResult = Appointment::sendAppoinCar($this->appointmentModel); // 预约会议室(有成功的就不会再次预约) $meetResult = (new Appointment())->appointMeet($this->appointmentModel, $this->appointmentConfig); // 预约门禁(每个学员一定会预约门禁) $doorResult = (new Appointment())->appointDoor($this->appointmentModel, $this->appointmentConfig); if ($doorResult) { // 门禁预约成功 $this->appointmentModel->status = 1; } else { // 预约失败 $this->appointmentModel->status = 4; } $this->appointmentModel->save(); // 预约门禁 // $result = (new Appointment())->appointDoor($this->appointmentModel, $this->appointmentConfig); // if ($result) { // // 成功预约会议室 // $result = (new Appointment())->appointMeet($this->appointmentModel, $this->appointmentConfig); // } // if ($result) { // // 门禁会议预约成功,预约车牌 // Appointment::sendAppoinCar($this->appointmentModel); // // 预约成功 // $this->appointmentModel->status = 1; // } else { // // 预约失败 // $this->appointmentModel->status = 4; // } // $this->appointmentModel->save(); } }