diff --git a/application/common/Logic/NoticeLogic.php b/application/common/Logic/NoticeLogic.php index d6cb024..8f95ad4 100644 --- a/application/common/Logic/NoticeLogic.php +++ b/application/common/Logic/NoticeLogic.php @@ -51,18 +51,25 @@ class NoticeLogic $log->status = -1; $log->content = 'TTSID为空'; $log->save(); + return; } - $reponse = DyvmsService::getInstance()->call($dispatch->worker_tel, $ttsCode, md5(time())); + $status = config('alibaba_dyvms.status'); - if($reponse->statusCode == 200 && $reponse->body->code == 'OK'){ - $log->status = 1; - $log->callId = $reponse->body->callId; - $log->save(); + if($status){ + $reponse = DyvmsService::getInstance()->call($dispatch->worker_tel, $ttsCode, md5(time())); + + if($reponse->statusCode == 200 && $reponse->body->code == 'OK'){ + $log->status = 1; + $log->callId = $reponse->body->callId; + $log->save(); + }else{ + $log->status = -1; + $log->content = $reponse->body->message; + $log->save(); + } }else{ - $log->status = -1; - $log->content = $reponse->body->message; - $log->save(); + throw new Exception('语音通知服务未开启'); } }catch (Exception $exception){ $log->status = -1;