预约完成,接入短信提醒

main
yanzai 1 year ago
parent 24d2f1ce25
commit ab9dbdc5d7

@ -138,10 +138,7 @@ class Tools
curl_setopt($ch, CURLOPT_POSTFIELDS, $xml_data);
$r = curl_exec($ch);
\Illuminate\Support\Facades\Log::info($r);
$r = '<?xml version="1.0" encoding="UTF-8" ?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV=\'http://schemas.xmlsoap.org/soap/envelope/\' xmlns:xsi=\'http://www.w3.org/2001/XMLSchema-instance\' xmlns:s=\'http://www.w3.org/2001/XMLSchema\'>
<SOAP-ENV:Body><SendResponse xmlns="http://bjgoodwillcis.com"><SendResult><![CDATA[{"resultCode": 0, "resultMsg": "登记成功", "resultDatas": [{"videoRoom": "", "extNo": "41656268!2", "extParam": "", "checkNo": "USFF1604109", "imageNo": "0000000053", "patientUrl": "https://nanshan-jk.yizhen.cn/yizhen-patient/login?p=ODQwMDA2&amp;itemFkBase=MTg5OTA5MDE", "currentNum": 0, "isStudyGroupRegistration": "Y", "queueNo": "A516"}], "isSuccess": true}]]></SendResult></SendResponse></SOAP-ENV:Body>
</SOAP-ENV:Envelope>';
try {
$xml = simplexml_load_string($r, 'SimpleXMLElement', LIBXML_NOCDATA);

@ -2,6 +2,7 @@
namespace App\Services\Admin\YeWu;
use App\Services\SendMessgeService;
use DateInterval;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
@ -309,6 +310,7 @@ WHERE
if ($u_mainList) {
DB::commit();
$this->SendMsg($oldMainInfos,$do_type);
return \Yz::Return(true, '预约成功', ['planid' => $planid, 'mainlistids' => $mainlistids]);
} else {
DB::rollBack();
@ -380,4 +382,16 @@ WHERE
}
//短信提醒
public function SendMsg($infos,$dotype=1)
{
$s=new SendMessgeService();
foreach ($infos as $key => $info) {
$mainInfo = DB::table('s_list as a')
->select('a.*', 'b.period_begin_time', 'b.period_end_time')
->leftJoin('s_period as b', 'a.reservation_time', '=', 'b.id')
->where(['a.id' => $info->id])->first();
$s->sendMessage($info->user_phone,'测试短信,项目:'.$mainInfo->entrust.',时间:'.$mainInfo->reservation_date.' '.substr($mainInfo->period_begin_time,0,5).'-'.substr($mainInfo->period_end_time,0,5));
}
}
}

@ -51,7 +51,13 @@ class SendMessgeService
'cntx' => $encryptedBody,
'custid' => $this->timestamp // For example purposes, use timestamp as custid
]);
$res=$response->json();
// if(isset($res['result']) and $res['result']==="0"){
//
// }
return $response->json();
return $res;
}
}

Loading…
Cancel
Save