新增 获取检测机构合作医生列表 接口
This commit is contained in:
parent
548e0cb980
commit
33c7cb98c5
@ -77,8 +77,12 @@ class DetectionService extends BaseService
|
|||||||
*/
|
*/
|
||||||
public function getDetectionDoctorList(): array
|
public function getDetectionDoctorList(): array
|
||||||
{
|
{
|
||||||
$company_id = $this->request->input("company_id",1);
|
|
||||||
$user_info = $this->request->getAttribute("userInfo") ?? [];
|
$user_info = $this->request->getAttribute("userInfo") ?? [];
|
||||||
|
$company_id = $this->request->input("company_id",1);
|
||||||
|
$province_id = $this->request->input("province_id");
|
||||||
|
$city_id = $this->request->input("city_id");
|
||||||
|
$county_id = $this->request->input("county_id");
|
||||||
|
|
||||||
|
|
||||||
// 获取合作公司数据
|
// 获取合作公司数据
|
||||||
$params = array();
|
$params = array();
|
||||||
@ -104,15 +108,61 @@ class DetectionService extends BaseService
|
|||||||
// 搜索数据
|
// 搜索数据
|
||||||
$hospital_params = array();
|
$hospital_params = array();
|
||||||
|
|
||||||
// 获取用户定位地址数据
|
if (empty($province_id) && empty($city_id) && empty($county_id)){
|
||||||
$params = array();
|
// 获取用户定位地址数据
|
||||||
$params['user_id'] = $user_info['user_id'];
|
$params = array();
|
||||||
$user_location = UserLocation::getOne($params);
|
$params['user_id'] = $user_info['user_id'];
|
||||||
if (!empty($user_location)){
|
$user_location = UserLocation::getOne($params);
|
||||||
// 处理省市区对应
|
if (!empty($user_location)){
|
||||||
if (!empty($user_location['province']) && !empty($user_location['city'])){
|
// 处理省市区对应
|
||||||
|
if (!empty($user_location['province']) && !empty($user_location['city'])){
|
||||||
|
$params = array();
|
||||||
|
$params['area_name'] = $user_location['province'];
|
||||||
|
$params['area_type'] = 2;
|
||||||
|
$area_province = Area::getOne($params);
|
||||||
|
if (!empty($area_province)){
|
||||||
|
$response_data['area']['province_id'] = $area_province['area_id'];
|
||||||
|
$response_data['area']['province'] = $area_province['area_name'];
|
||||||
|
|
||||||
|
// 搜索条件
|
||||||
|
$hospital_params['province_id'] = $area_province['area_id'];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!empty($response_data['area']['province_id'])){
|
||||||
|
$params = array();
|
||||||
|
$params['area_name'] = $user_location['city'];
|
||||||
|
$params['parent_id'] = $response_data['area']['province_id'];
|
||||||
|
$params['area_type'] = 3;
|
||||||
|
$area_city = Area::getOne($params);
|
||||||
|
if (!empty($area_city)){
|
||||||
|
$response_data['area']['city_id'] = $area_city['area_id'];
|
||||||
|
$response_data['area']['city'] = $area_city['area_name'];
|
||||||
|
|
||||||
|
// 搜索条件
|
||||||
|
$hospital_params['city_id'] = $area_city['area_id'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!empty($response_data['area']['city_id']) && !empty($user_location['county'])){
|
||||||
|
$params = array();
|
||||||
|
$params['area_name'] = $user_location['county'];
|
||||||
|
$params['parent_id'] = $response_data['area']['city_id'];
|
||||||
|
$params['area_type'] = 4;
|
||||||
|
$area_county = Area::getOne($params);
|
||||||
|
if (!empty($area_county)){
|
||||||
|
$response_data['area']['county_id'] = $area_county['area_id'];
|
||||||
|
$response_data['area']['county'] = $area_county['area_name'];
|
||||||
|
|
||||||
|
// 搜索条件
|
||||||
|
$hospital_params['county_id'] = $area_county['area_id'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else{
|
||||||
|
if (!empty($province_id)){
|
||||||
$params = array();
|
$params = array();
|
||||||
$params['area_name'] = $user_location['province'];
|
$params['area_id'] = $province_id;
|
||||||
$params['area_type'] = 2;
|
$params['area_type'] = 2;
|
||||||
$area_province = Area::getOne($params);
|
$area_province = Area::getOne($params);
|
||||||
if (!empty($area_province)){
|
if (!empty($area_province)){
|
||||||
@ -122,26 +172,26 @@ class DetectionService extends BaseService
|
|||||||
// 搜索条件
|
// 搜索条件
|
||||||
$hospital_params['province_id'] = $area_province['area_id'];
|
$hospital_params['province_id'] = $area_province['area_id'];
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!empty($response_data['area']['province_id'])){
|
if (!empty($response_data['area']['province_id']) && !empty($city_id)){
|
||||||
$params = array();
|
$params = array();
|
||||||
$params['area_name'] = $user_location['city'];
|
$params['area_id'] = $city_id;
|
||||||
$params['parent_id'] = $response_data['area']['province_id'];
|
$params['parent_id'] = $response_data['area']['province_id'];
|
||||||
$params['area_type'] = 3;
|
$params['area_type'] = 3;
|
||||||
$area_city = Area::getOne($params);
|
$area_city = Area::getOne($params);
|
||||||
if (!empty($area_city)){
|
if (!empty($area_city)){
|
||||||
$response_data['area']['city_id'] = $area_city['area_id'];
|
$response_data['area']['city_id'] = $area_city['area_id'];
|
||||||
$response_data['area']['city'] = $area_city['area_name'];
|
$response_data['area']['city'] = $area_city['area_name'];
|
||||||
|
|
||||||
// 搜索条件
|
// 搜索条件
|
||||||
$hospital_params['city_id'] = $area_city['area_id'];
|
$hospital_params['city_id'] = $area_city['area_id'];
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($response_data['area']['city_id']) && !empty($user_location['county'])){
|
if (!empty($response_data['area']['city_id']) && !empty($county_id)){
|
||||||
$params = array();
|
$params = array();
|
||||||
$params['area_name'] = $user_location['county'];
|
$params['area_id'] = $county_id;
|
||||||
$params['parent_id'] = $response_data['area']['city_id'];
|
$params['parent_id'] = $response_data['area']['city_id'];
|
||||||
$params['area_type'] = 4;
|
$params['area_type'] = 4;
|
||||||
$area_county = Area::getOne($params);
|
$area_county = Area::getOne($params);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user