Merge branch 'dev'
This commit is contained in:
commit
516eee9738
@ -311,21 +311,24 @@ class UserDoctor extends Model
|
||||
* @param array $hospital_params 医院搜索条件
|
||||
* @param array $doctor_params 医生搜索条件
|
||||
* @param array $doctor_expertise_params
|
||||
* @param array $inquiry_type
|
||||
* @param int $is_search_welfare_reception 是否搜索公益问诊
|
||||
* @param string|int $sort_order
|
||||
* @param array $fields
|
||||
* @param int|null $page
|
||||
* @param int|null $per_page
|
||||
* @return array
|
||||
*/
|
||||
public static function getInquiryDoctorPage(string $keyword = "", array $hospital_params = [], array $doctor_params = [], array $doctor_expertise_params = [],array $inquiry_type = [1,3], string|int $sort_order = 1, array $fields = ["*"], int $page = null, ?int $per_page = 10): array
|
||||
public static function getInquiryDoctorPage(string $keyword = "", array $hospital_params = [], array $doctor_params = [], array $doctor_expertise_params = [],int $is_search_welfare_reception = 0, string|int $sort_order = 1, array $fields = ["*"], int $page = null, ?int $per_page = 10): array
|
||||
{
|
||||
$query = self::with([
|
||||
"Hospital:hospital_id,hospital_name,hospital_status,hospital_level_name,province_id,city_id",
|
||||
"DoctorExpertise",
|
||||
"DoctorInquiryConfig" => function ($query) use ($inquiry_type) {
|
||||
$query->whereIn('inquiry_type', $inquiry_type)
|
||||
->where('inquiry_mode', 1);
|
||||
"DoctorInquiryConfig" => function ($query) use ($is_search_welfare_reception) {
|
||||
$query->where('inquiry_mode', 1);
|
||||
if (!empty($is_search_welfare_reception)){
|
||||
$query->where('inquiry_type', 3);
|
||||
$query->where('is_enable', 1);
|
||||
}
|
||||
},
|
||||
])
|
||||
->where($doctor_params)
|
||||
@ -344,10 +347,18 @@ class UserDoctor extends Model
|
||||
->whereHas('DoctorExpertise', function ($query) use ($doctor_expertise_params) {
|
||||
$query->where($doctor_expertise_params);
|
||||
})
|
||||
->whereHas('DoctorInquiryConfig', function ($query) use ($inquiry_type) {
|
||||
->whereHas('DoctorInquiryConfig', function ($query) use ($is_search_welfare_reception) {
|
||||
$params = array();
|
||||
$params['inquiry_mode'] = 1;// 接诊方式:图文
|
||||
$query->where($params)->whereIn('inquiry_type', $inquiry_type);
|
||||
if (!empty($is_search_welfare_reception)){
|
||||
$params['is_enable'] = 1;
|
||||
}
|
||||
|
||||
$query->where($params);
|
||||
|
||||
if (!empty($is_search_welfare_reception)){
|
||||
$query->where('inquiry_type', 3);
|
||||
}
|
||||
});
|
||||
|
||||
if (!empty($sort_order)){
|
||||
|
||||
@ -186,12 +186,6 @@ class PatientDoctorService extends BaseService
|
||||
$doctor_params["iden_auth_status"] = 1;// 身份认证状态(0:未认证 1:认证通过 2:审核中 3:认证失败)
|
||||
$doctor_params["is_bind_bank"] = 1;// 是否已绑定结算银行卡(0:否 1:是)
|
||||
|
||||
// 问诊类型
|
||||
$inquiry_type = [1,3,4];
|
||||
if (!empty($is_search_welfare_reception)){
|
||||
$inquiry_type = [3,4];
|
||||
}
|
||||
|
||||
$fields = [
|
||||
"doctor_id",
|
||||
"user_id",
|
||||
@ -212,7 +206,7 @@ class PatientDoctorService extends BaseService
|
||||
"be_good_at",
|
||||
];
|
||||
|
||||
$user_doctors = UserDoctor::getInquiryDoctorPage($keyword,$hospital_params, $doctor_params,$doctor_expertise_params,$inquiry_type, $sort_order, $fields,$page,$per_page);
|
||||
$user_doctors = UserDoctor::getInquiryDoctorPage($keyword,$hospital_params, $doctor_params,$doctor_expertise_params,$is_search_welfare_reception, $sort_order, $fields,$page,$per_page);
|
||||
|
||||
if (!empty($user_doctors['data'])) {
|
||||
foreach ($user_doctors['data'] as &$user_doctor) {
|
||||
@ -243,14 +237,23 @@ class PatientDoctorService extends BaseService
|
||||
// 公益
|
||||
$user_doctor['free_clinic_price'] = $doctor_inquiry_config['inquiry_price'];
|
||||
}
|
||||
if ($doctor_inquiry_config['inquiry_type'] == 4 && $doctor_inquiry_config['is_enable'] == 1) {
|
||||
// 问诊购药
|
||||
$user_doctor['multi_point_enable'] = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 处理可处方字段
|
||||
$user_doctor['multi_point_enable'] = 0;
|
||||
|
||||
$params = array();
|
||||
$params['doctor_id'] = $user_doctor["doctor_id"];
|
||||
$params['inquiry_type'] = 4;
|
||||
$params['inquiry_mode'] = 1;
|
||||
$params['is_enable'] = 1;
|
||||
$result = DoctorInquiryConfig::getOne($params);
|
||||
if (!empty($result)){
|
||||
$user_doctor['multi_point_enable'] = 1;
|
||||
}
|
||||
|
||||
// 好评率-超过5个已结束的订单后展示
|
||||
$user_doctor['praise_rate'] = floor($user_doctor['praise_rate'] * 0.05 * 100) / 100;
|
||||
// 响应时间-超过5个已结束的订单后展示
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user