短信增加日志

main
yanzai 1 year ago
parent 59e6e5b260
commit ba9db6bdc9

@ -48,6 +48,16 @@ class AspNetZhuanController extends Controller
return $res['data'];
}
//发送短信
public static function SendMsg($yyid,$tel,$name,$time){
if($yyid==1){
$yyid=6;
}
$content="时间:".$time.";科室:健康管理中心1区。温馨提醒:您的预约已成功,请在预约时间前 30 分钟达到科室凭身份证原件开单。建议您体检前3天清淡饮食、禁烟酒";
$url=self::$BaseUrl."/tuisong.aspx?yyid=".$yyid."&type=8&mobile=".$tel."&msg1=".urlencode($name)."&msg2=".urlencode($content);
self::get($url,"短信发送");
}
public static function Get($url,$mark)
@ -56,14 +66,14 @@ class AspNetZhuanController extends Controller
$response = Http::get($url);
if ($response->successful()) {
$res = $response->json();
Log::info($res);
self::$request->response_data = json_encode($res, JSON_UNESCAPED_UNICODE);
self::$request->save();
if ($res['code'] == "200") {
return $res;
} else {
throw new HttpResponseException(\Yz::echoError1("查询用户积分预存款失败:" . $res['msg']));
throw new HttpResponseException(\Yz::echoError1("调用".$mark."接口失败:" . $res['msg']));
}
} else {
$status = $response->status();
@ -73,7 +83,7 @@ class AspNetZhuanController extends Controller
self::$request->response_data = $body;
self::$request->save();
throw new HttpResponseException(\Yz::echoError1("查询用户积分预存款失败,status:" . $status . "body:" . $body));
throw new HttpResponseException(\Yz::echoError1("调用".$mark."接口失败:" . $status . "body:" . $body));
}
}
public static function Post($url,$data,$mark)
@ -93,7 +103,7 @@ class AspNetZhuanController extends Controller
if ($res['code'] == "200") {
return $res;
} else {
throw new HttpResponseException(\Yz::echoError1("查询用户积分预存款失败:" . $res['msg']));
throw new HttpResponseException(\Yz::echoError1("调用".$mark."接口失败:" . $res['msg']));
}
} else {
$status = $response->status();
@ -103,7 +113,7 @@ class AspNetZhuanController extends Controller
self::$request->response_data = $body;
self::$request->save();
throw new HttpResponseException(\Yz::echoError1("查询用户积分预存款失败,status:" . $status . "body:" . $body));
throw new HttpResponseException(\Yz::echoError1("调用".$mark."接口失败:" . $status . "body:" . $body));
}
}

@ -593,6 +593,7 @@ class OrderController extends Controller
]);
$is_sendMsg=DB::table('configs')->where(['label' => '预约完成短信通知'])->first();
if(!!$is_sendMsg and $is_sendMsg->value==1){
$asp=new AspNetZhuanController();
Tools::SendMsg($cha->hospital_id,$cha->phone,$cha->name,$cha->appointment_date.' '.substr($cha->appointment_time, 0, 5));
}
return ['status' => true, 'msg' => "完成"];

@ -281,7 +281,7 @@
</view>
</view>
</view>
<view class="botm_blank_wrapper" style="font-size: 18rpx;color: #ccc;">10221910</view>
<view class="botm_blank_wrapper" style="font-size: 18rpx;color: #ccc;">10231704</view>
</view>
</view>
</template>

Loading…
Cancel
Save