diff --git a/Laravel/app/Http/Controllers/API/Web/OrderController.php b/Laravel/app/Http/Controllers/API/Web/OrderController.php index 2a40393..15e56d9 100644 --- a/Laravel/app/Http/Controllers/API/Web/OrderController.php +++ b/Laravel/app/Http/Controllers/API/Web/OrderController.php @@ -25,6 +25,15 @@ class OrderController extends Controller $doctor = request('doctor');//预约的医生名字 $appdoctor = request('appdoctor');//协助预约的医生名字 $person= request('person'); //sex,birthday,married,name,id_number,phone + $married_array=["未婚","已婚","丧偶","离婚","其他"]; + if(isset($person['married'])){ + $key= array_search($person['married'], $married_array); + if ($key !== false) { + $person['married']=$key; + } else { + $person['married']=4; + } + } if (!isset($hospital_id)) return \Yz::echoError1('医院id不能为空'); if (!isset($type)) return \Yz::echoError1('type体检类型不能为空'); @@ -253,6 +262,15 @@ class OrderController extends Controller $doctor = request('doctor');//预约的医生名字 $appdoctor = request('appdoctor');//协助预约的医生名字 $person= request('person'); //sex,birthday,married,name,id_number,phone + $married_array=["未婚","已婚","丧偶","离婚","其他"]; + if(isset($person['married'])){ + $key= array_search($person['married'], $married_array); + if ($key !== false) { + $person['married']=$key; + } else { + $person['married']=4; + } + } if (!isset($hospital_id)) return \Yz::echoError1('医院id不能为空'); if (!isset($type)) return \Yz::echoError1('type体检类型不能为空');