修改首页接口
This commit is contained in:
parent
16a6e6dfcd
commit
226e3530b6
@ -156,6 +156,17 @@ class PatientHistoryInquiry extends Model
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取信息-多条
|
||||||
|
* @param array $params
|
||||||
|
* @param array $fields
|
||||||
|
* @return object|null
|
||||||
|
*/
|
||||||
|
public static function getListOrder(array $params, array $fields = ['*']): object|null
|
||||||
|
{
|
||||||
|
return self::where($params)->orderBy('created_at','desc')->get($fields);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改
|
* 修改
|
||||||
* @param array $params
|
* @param array $params
|
||||||
|
|||||||
@ -177,11 +177,11 @@ class IndexService extends BaseService
|
|||||||
defer(function() use ($wg) {
|
defer(function() use ($wg) {
|
||||||
$wg->done();
|
$wg->done();
|
||||||
});
|
});
|
||||||
// $PatientDoctorService = new PatientDoctorService();
|
$PatientDoctorService = new PatientDoctorService();
|
||||||
//
|
|
||||||
// if (!empty($user_info)) {
|
if (!empty($user_info)) {
|
||||||
// $my_doctor = $PatientDoctorService->getIndexPatientDoctorLimit($user_info['client_user_id']);
|
$my_doctor = $PatientDoctorService->getIndexPatientDoctorLimit($user_info['client_user_id']);
|
||||||
// }
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// 推荐医生
|
// 推荐医生
|
||||||
|
|||||||
@ -758,11 +758,11 @@ class PatientDoctorService extends BaseService
|
|||||||
$params = array();
|
$params = array();
|
||||||
$params['patient_id'] = $patient_id;
|
$params['patient_id'] = $patient_id;
|
||||||
$params['history_status'] = 1;
|
$params['history_status'] = 1;
|
||||||
$patient_history_doctors = PatientHistoryInquiryModel::getIndexHistoryDoctorList($params);
|
$patient_history_doctors = PatientHistoryInquiryModel::getListOrder($params);
|
||||||
if (!empty($patient_history_doctors)) {
|
if (!empty($patient_history_doctors)) {
|
||||||
foreach ($patient_history_doctors as $patient_history_doctor) {
|
foreach ($patient_history_doctors as $patient_history_doctor) {
|
||||||
if (empty($patient_history_doctor['userDoctor'])) {
|
if (count($results) >= 5){
|
||||||
continue;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($results as $item){
|
foreach ($results as $item){
|
||||||
@ -771,17 +771,33 @@ class PatientDoctorService extends BaseService
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 组合数据
|
// 获取医生数据
|
||||||
$data = array();
|
$params = array();
|
||||||
$data['doctor_id'] = $patient_history_doctor['userDoctor']['doctor_id'];
|
$params['doctor_id'] = $patient_history_doctor['doctor_id'];
|
||||||
$data['user_name'] = $patient_history_doctor['userDoctor']['user_name'];
|
$user_doctor = UserDoctor::getOne($params);
|
||||||
$data['avatar'] = addAliyunOssWebsite($patient_history_doctor['userDoctor']['avatar']);
|
if (empty($user_doctor)){
|
||||||
$data['hospital_name'] = "";
|
continue;
|
||||||
if (!empty($patient_history_doctor['userDoctor']['Hospital'])) {
|
|
||||||
$data['hospital_name'] = $patient_history_doctor['userDoctor']['Hospital']['hospital_name'];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$data['doctor_title'] = empty($patient_history_doctor['userDoctor']['doctor_title']) ? "" : DoctorTitleCode::getMessage($patient_history_doctor['userDoctor']['doctor_title']);
|
// 获取医生医院
|
||||||
|
$hospital_name = "";
|
||||||
|
if (!empty($user_doctor['hospital_id'])){
|
||||||
|
$params = array();
|
||||||
|
$params['hospital_id'] = $user_doctor['hospital_id'];
|
||||||
|
$hospital = Hospital::getOne($params);
|
||||||
|
if (!empty($hospital)){
|
||||||
|
$hospital_name = $hospital['hospital_name'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 组合数据
|
||||||
|
$data = array();
|
||||||
|
$data['doctor_id'] = $user_doctor['doctor_id'];
|
||||||
|
$data['user_name'] = $user_doctor['user_name'];
|
||||||
|
$data['avatar'] = addAliyunOssWebsite($user_doctor['avatar']);
|
||||||
|
$data['hospital_name'] = $hospital_name;
|
||||||
|
|
||||||
|
$data['doctor_title'] = empty($user_doctor['doctor_title']) ? "" : DoctorTitleCode::getMessage($user_doctor['doctor_title']);
|
||||||
|
|
||||||
// 按照天来计算,当日为1,前一天为2 未服务过为0
|
// 按照天来计算,当日为1,前一天为2 未服务过为0
|
||||||
if (empty($patient_history_doctor['created_at'])) {
|
if (empty($patient_history_doctor['created_at'])) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user