1
This commit is contained in:
parent
90a0777cc3
commit
6c3d364a6f
@ -67,6 +67,22 @@ class PatientFollow extends Model
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 远程关联用户表
|
||||||
|
* @return HasOneThrough
|
||||||
|
*/
|
||||||
|
public function User(): HasOneThrough
|
||||||
|
{
|
||||||
|
return $this->hasOneThrough(
|
||||||
|
User::class,
|
||||||
|
UserDoctor::class,
|
||||||
|
"doctor_id",
|
||||||
|
"user_id",
|
||||||
|
"doctor_id",
|
||||||
|
"user_id",
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取是否存在
|
* 获取是否存在
|
||||||
* @param array $params
|
* @param array $params
|
||||||
@ -109,8 +125,9 @@ class PatientFollow extends Model
|
|||||||
$query = self::with([
|
$query = self::with([
|
||||||
'DoctorExpertise:doctor_expertise_id,doctor_id,expertise_id',
|
'DoctorExpertise:doctor_expertise_id,doctor_id,expertise_id',
|
||||||
'DoctorExpertise.DiseaseClassExpertise:expertise_id,expertise_name',
|
'DoctorExpertise.DiseaseClassExpertise:expertise_id,expertise_name',
|
||||||
"UserDoctor:doctor_id,user_name,avatar,doctor_title,hospital_id,multi_point_status,department_custom_name,be_good_at",
|
"UserDoctor:doctor_id,user_id,user_name,avatar,doctor_title,hospital_id,multi_point_status,department_custom_name,be_good_at",
|
||||||
"UserDoctor.Hospital:hospital_id,hospital_name,hospital_level_name"
|
"UserDoctor.Hospital:hospital_id,hospital_name,hospital_level_name",
|
||||||
|
"UserDoctor.User:user_id,is_online"
|
||||||
])
|
])
|
||||||
->where($params)
|
->where($params)
|
||||||
->paginate($per_page, $fields, "page", $page);
|
->paginate($per_page, $fields, "page", $page);
|
||||||
|
|||||||
@ -66,6 +66,22 @@ class PatientHistoryInquiry extends Model
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 远程关联用户表
|
||||||
|
* @return HasOneThrough
|
||||||
|
*/
|
||||||
|
public function User(): HasOneThrough
|
||||||
|
{
|
||||||
|
return $this->hasOneThrough(
|
||||||
|
User::class,
|
||||||
|
UserDoctor::class,
|
||||||
|
"doctor_id",
|
||||||
|
"user_id",
|
||||||
|
"doctor_id",
|
||||||
|
"user_id",
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 关联医生专长表
|
* 关联医生专长表
|
||||||
* @return HasMany
|
* @return HasMany
|
||||||
@ -191,8 +207,9 @@ class PatientHistoryInquiry extends Model
|
|||||||
$query = self::with([
|
$query = self::with([
|
||||||
'DoctorExpertise:doctor_expertise_id,doctor_id,expertise_id',
|
'DoctorExpertise:doctor_expertise_id,doctor_id,expertise_id',
|
||||||
'DoctorExpertise.DiseaseClassExpertise:expertise_id,expertise_name',
|
'DoctorExpertise.DiseaseClassExpertise:expertise_id,expertise_name',
|
||||||
"UserDoctor:doctor_id,user_name,avatar,doctor_title,hospital_id,multi_point_status,department_custom_name,be_good_at",
|
"UserDoctor:doctor_id,user_id,user_name,avatar,doctor_title,hospital_id,multi_point_status,department_custom_name,be_good_at",
|
||||||
"UserDoctor.Hospital:hospital_id,hospital_name,hospital_level_name"
|
"UserDoctor.Hospital:hospital_id,hospital_name,hospital_level_name",
|
||||||
|
"UserDoctor.User:user_id,is_online"
|
||||||
])
|
])
|
||||||
->where($params)
|
->where($params)
|
||||||
->groupBy('doctor_id')
|
->groupBy('doctor_id')
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user