修改患者端医生列表
This commit is contained in:
@@ -4,7 +4,9 @@ namespace App\Services;
|
||||
|
||||
use App\Constants\DoctorTitleCode;
|
||||
use App\Constants\HttpEnumCode;
|
||||
use App\Model\DiseaseClassExpertise;
|
||||
use App\Model\DoctorExpertise;
|
||||
use App\Model\DoctorInquiryConfig;
|
||||
use App\Model\DoctorInquiryConfig as DoctorInquiryConfigModel;
|
||||
use App\Model\Hospital;
|
||||
use App\Model\OrderEvaluation;
|
||||
@@ -36,24 +38,7 @@ class PatientDoctorService extends BaseService
|
||||
$per_page = $this->request->input('per_page',10);
|
||||
|
||||
// 组合条件
|
||||
$hospital_params = array();// 医院搜索
|
||||
$doctor_params = array();// 医生搜索
|
||||
$doctor_expertise_params = array();// 医生专长搜索
|
||||
|
||||
// 省市区
|
||||
if (!empty($province_id)) {
|
||||
if (empty($city_id)) {
|
||||
// 省份存在时需和城市在一块
|
||||
return fail(HttpEnumCode::CLIENT_HTTP_ERROR);
|
||||
}
|
||||
$hospital_params[] = ['province_id', '=', $province_id];
|
||||
$hospital_params[] = ['city_id', '=', $city_id];
|
||||
}
|
||||
|
||||
// 医生专长
|
||||
if (!empty($expertise_id)) {
|
||||
$doctor_expertise_params['expertise_id'] = $expertise_id;
|
||||
}
|
||||
|
||||
// 固定医生查询条件
|
||||
$doctor_params['status'] = 1; // 状态(0:禁用 1:正常 2:删除)
|
||||
@@ -88,28 +73,41 @@ class PatientDoctorService extends BaseService
|
||||
"be_good_at",
|
||||
];
|
||||
|
||||
$user_doctors = UserDoctor::getInquiryDoctorPage($keyword, $hospital_params, $doctor_params, $doctor_expertise_params, $sort_order, $fields,$page,$per_page);
|
||||
$user_doctors = UserDoctor::getInquiryDoctorPage($keyword, $doctor_params, $sort_order, $fields,$page,$per_page);
|
||||
|
||||
// 处理数据
|
||||
if (!empty($user_doctors['data'])) {
|
||||
foreach ($user_doctors['data'] as &$user_doctor) {
|
||||
$user_doctor['doctor_title_name'] = empty($user_doctor['doctor_title']) ? "" : DoctorTitleCode::getMessage($user_doctor['doctor_title']);
|
||||
|
||||
// 医生专长
|
||||
if (!empty($user_doctor['DoctorExpertise'])) {
|
||||
foreach ($user_doctor['DoctorExpertise'] as &$data) {
|
||||
if (!empty($data['DiseaseClassExpertise'])) {
|
||||
$data['expertise_name'] = $data['DiseaseClassExpertise']['expertise_name'];
|
||||
// 处理医生专长
|
||||
$user_doctor['doctor_expertises'] = [];
|
||||
|
||||
$params = array();
|
||||
$params['doctor_id'] = $user_doctor['doctor_id'];
|
||||
$doctor_expertises = DoctorExpertise::getList($params);
|
||||
if (!empty($doctor_expertises)){
|
||||
foreach ($doctor_expertises as &$doctor_expertise){
|
||||
$params = array();
|
||||
$params['expertise_id'] = $doctor_expertise['expertise_id'];
|
||||
$disease_class_expertise = DiseaseClassExpertise::getOne($params);
|
||||
if (!empty($disease_class_expertise)){
|
||||
$doctor_expertise['expertise_name'] = $disease_class_expertise['expertise_name'];
|
||||
}
|
||||
unset($data['DiseaseClassExpertise']);
|
||||
}
|
||||
|
||||
$user_doctor['doctor_expertises'] = $doctor_expertises;
|
||||
}
|
||||
|
||||
// 问诊价格
|
||||
// 处理问诊价格
|
||||
$user_doctor['price'] = 0;
|
||||
$user_doctor['free_clinic_price'] = 0;
|
||||
if (!empty($user_doctor['DoctorInquiryConfig'])) {
|
||||
foreach ($user_doctor['DoctorInquiryConfig'] as $doctor_inquiry_config) {
|
||||
|
||||
$params = array();
|
||||
$params['inquiry_mode'] = 1;
|
||||
$doctor_inquiry_configs = DoctorInquiryConfig::getInquiryConfigList($params,['*']);
|
||||
if (!empty($doctor_inquiry_configs)) {
|
||||
foreach ($doctor_inquiry_configs as $doctor_inquiry_config) {
|
||||
if ($doctor_inquiry_config['inquiry_mode'] == 1) {
|
||||
if ($doctor_inquiry_config['inquiry_type'] == 1) {
|
||||
// 专家
|
||||
@@ -121,7 +119,26 @@ class PatientDoctorService extends BaseService
|
||||
}
|
||||
}
|
||||
}
|
||||
unset($user_doctor['DoctorInquiryConfig']);
|
||||
unset($doctor_inquiry_configs);
|
||||
}
|
||||
|
||||
// 处理医生医院
|
||||
$user_doctor['hospital'] = [];
|
||||
|
||||
$params = array();
|
||||
$params['hospital_id'] = $user_doctor['hospital_id'];
|
||||
|
||||
$fields = [
|
||||
'hospital_id',
|
||||
'hospital_name',
|
||||
'hospital_status',
|
||||
'hospital_level_name',
|
||||
'province_id',
|
||||
'city_id'
|
||||
];
|
||||
$hospital = Hospital::getOne($params,$fields);
|
||||
if (!empty($hospital)){
|
||||
$user_doctor['hospital'] = $hospital;
|
||||
}
|
||||
|
||||
// 好评率-超过5个已结束的订单后展示
|
||||
|
||||
Reference in New Issue
Block a user