修改专家详情服务天书
This commit is contained in:
parent
9acd823317
commit
2e56ddf700
@ -86,6 +86,17 @@ class PatientHistoryInquiry extends Model
|
|||||||
return self::where($params)->first($fields);
|
return self::where($params)->first($fields);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取信息-单条
|
||||||
|
* @param array $params
|
||||||
|
* @param array $fields
|
||||||
|
* @return object|null
|
||||||
|
*/
|
||||||
|
public static function getOrderOne(array $params, array $fields = ['*']): object|null
|
||||||
|
{
|
||||||
|
return self::where($params)->orderBy('created_at','desc')->first($fields);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取信息-多条
|
* 获取信息-多条
|
||||||
* @param array $params
|
* @param array $params
|
||||||
|
|||||||
@ -117,6 +117,13 @@ class InquiryService extends BaseService
|
|||||||
if ($doctor['iden_auth_status'] != 1) {
|
if ($doctor['iden_auth_status'] != 1) {
|
||||||
return fail(HttpEnumCode::HTTP_ERROR, "当前医生无法接诊,请重新选择");
|
return fail(HttpEnumCode::HTTP_ERROR, "当前医生无法接诊,请重新选择");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 检测当前医生是否和患者存在未完成问诊订单
|
||||||
|
$InquiryService = new InquiryService();
|
||||||
|
$order_inquiry = $InquiryService->checkPatientDoctorProgressInquiry($user_info['client_user_id'],$request_params['doctor_id']);
|
||||||
|
if (!empty($order_inquiry)){
|
||||||
|
return fail(HttpEnumCode::HTTP_ERROR, "您和当前医生存在问诊中订单,无法再次发起问诊");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 检测当前是否符合系统问诊时间
|
// 检测当前是否符合系统问诊时间
|
||||||
|
|||||||
@ -223,7 +223,7 @@ class PatientDoctorService extends BaseService
|
|||||||
$params['patient_id'] = $user_info['client_user_id'];
|
$params['patient_id'] = $user_info['client_user_id'];
|
||||||
$params['doctor_id'] = $doctor_id;
|
$params['doctor_id'] = $doctor_id;
|
||||||
$params['history_status'] = 1;
|
$params['history_status'] = 1;
|
||||||
$patient_history_doctor = PatientHistoryInquiryModel::getOne($params);
|
$patient_history_doctor = PatientHistoryInquiryModel::getOrderOne($params);
|
||||||
// 按照天来计算,当日为1,前一天为2 未服务过为0
|
// 按照天来计算,当日为1,前一天为2 未服务过为0
|
||||||
if (!empty($patient_history_doctor['created_at'])) {
|
if (!empty($patient_history_doctor['created_at'])) {
|
||||||
$result['days'] = ceil((strtotime(date('Y-m-d', strtotime('+1 day'))) - strtotime($patient_history_doctor['created_at'])) / 86400);
|
$result['days'] = ceil((strtotime(date('Y-m-d', strtotime('+1 day'))) - strtotime($patient_history_doctor['created_at'])) / 86400);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user