<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace Module\Vendor\Sms; use ModStart\Core\Exception\BizException; use ModStart\Core\Job\BaseJob; use Module\Vendor\Log\Logger; use Module\Vendor\Provider\SmsSender\SmsSenderProvider; class SmsSendJob extends BaseJob { public $phone; public $template; public $templateData; public static function create($ffJmI, $np9vN, $DlEFb) { goto OHW7R; UJizq: app('Illuminate\\Contracts\\Bus\\Dispatcher')->dispatch($bicx_); goto aGaUG; zXTNh: $bicx_->templateData = $DlEFb; goto UJizq; mGARZ: $bicx_->template = $np9vN; goto zXTNh; OHW7R: $bicx_ = new static(); goto TOTdd; TOTdd: $bicx_->phone = $ffJmI; goto mGARZ; aGaUG: } public function handle() { goto VPpQs; QK1gv: try { goto XMlnd; XMlnd: BizException::throwsIfEmpty('短信发送未设置', $kHDkQ); goto Eg2Tx; Eg2Tx: $ZrjxR = SmsSenderProvider::get($kHDkQ)->send($this->phone, $this->template, $this->templateData); goto NxOLT; DWakW: Logger::info('Sms', 'End', $this->phone . ' - ' . json_encode($ZrjxR, JSON_UNESCAPED_UNICODE)); goto jc4ea; NxOLT: BizException::throwsIfResponseError($ZrjxR); goto DWakW; jc4ea: } catch (BizException $RWZxh) { Logger::error('Sms', 'Error', $this->phone . ' - ' . $RWZxh->getMessage()); } goto zPdFZ; dDBne: $kHDkQ = app()->config->get('SmsSenderProvider'); goto QK1gv; YXSkL: Logger::info('Sms', 'Start', $aUqbq); goto dDBne; VPpQs: $aUqbq = $this->phone . ' - ' . $this->template . ' - ' . json_encode($this->templateData, JSON_UNESCAPED_UNICODE); goto YXSkL; zPdFZ: } }