orderId,'生成处方通知药师短信息发送队列start'); try { $this->setRequest(); $prescription = Prescription::find()->where([ 'id' => $this->orderId, 'status' => PrescriptionEnum::WAIT_CHECK ])->one(); if (!$prescription) { throw new Exception('处方不存在'); } $serviceUser = ServiceUser::find()->where([ 'role' => 2, //药师 'status' => 2, //已审核 'is_delete' => 0 ])->asArray()->all(); if(!$serviceUser || count($serviceUser)==0){ throw new Exception('获取药师数据错误'); } foreach($serviceUser as $v){ (new SmsService())->sendWaitApproval($v['mobile']); PrescriptionLog::saveLog($this->orderId,'生成处方通知药师短信息发送队列:'.$v['mobile']); } PrescriptionLog::saveLog($this->orderId,'生成处方通知药师短信息发送队列end'); } catch (\Exception $exception) { PrescriptionLog::saveLog($this->orderId,'生成处方通知药师短信息发送队列异常:'.$exception->getMessage()); return; } } }