diff --git a/Laravel/app/Http/Controllers/API/H5/OrderController.php b/Laravel/app/Http/Controllers/API/H5/OrderController.php index 22efb12..70363d2 100644 --- a/Laravel/app/Http/Controllers/API/H5/OrderController.php +++ b/Laravel/app/Http/Controllers/API/H5/OrderController.php @@ -4,6 +4,7 @@ namespace App\Http\Controllers\API\H5; use App\Http\Controllers\Controller; use App\Http\Controllers\API\PEISApiController; +use App\Lib\Tools; use App\Services\ConfigService; use DateTime; use Illuminate\Http\Request; @@ -350,6 +351,7 @@ class OrderController extends Controller 'plan_number'=>$planInfo->plan_number, 'appointment_date'=>$planInfo->date, 'appointment_time'=>$planInfo->time, + 'doctor'=>isset($doctor)?$doctor:null, ]); } return \Yz::Return(true,"操作完成",[]); @@ -470,10 +472,14 @@ class OrderController extends Controller ]; $info = $peis::Post('预约时段修改', $order_info->hospital_id,$dat); } - DB::table('orders')->where(['order_number' => $order_number])->update([ + $u=DB::table('orders')->where(['order_number' => $order_number])->update([ 'appointment_number' => $create_appointment['data'][0][0], 'appointment_back_info' => json_encode($appointment_info['data'][0], JSON_UNESCAPED_UNICODE) ]); + $is_sendMsg=DB::table('configs')->where(['label' => '预约完成短信通知'])->first(); + if(!!$is_sendMsg and $is_sendMsg->value==1){ + Tools::SendMsg($cha->hospital_id,$cha->phone,$cha->name,$cha->appointment_date.' '.substr($cha->appointment_time, 0, 5)); + } return ['status' => true, 'msg' => "完成"]; } diff --git a/Laravel/app/Lib/Tools.php b/Laravel/app/Lib/Tools.php index ada4127..80c7bea 100644 --- a/Laravel/app/Lib/Tools.php +++ b/Laravel/app/Lib/Tools.php @@ -2,6 +2,9 @@ namespace App\Lib; +use Illuminate\Support\Facades\Http; +use Illuminate\Support\Facades\Log; + class Tools { //查询某天是星期几 @@ -36,4 +39,18 @@ class Tools } return $weekname; } + public static function SendMsg($yyid,$tel,$name,$time){ + if($yyid==1){ + $yyid=6; + } + + $content="时间:".$time.";科室:健康管理中心1区。温馨提醒:您的预约已成功,请在预约时间前 30 分钟达到科室,凭身份证原件开单。建议您体检前3天清淡饮食、禁烟酒"; + $url="http://220.174.210.111:82/tuisong.aspx?yyid=".$yyid."&type=8&mobile=".$tel."&msg1=".urlencode($name)."&msg2=".urlencode($content); + $response = Http::get($url); + if ($response->successful()) { + + }else{ + Log::info("短信发送失败"); + } + } }