parent
ee00b23414
commit
438b5293cd
@ -1999,6 +1999,11 @@ class PatientOrderService extends BaseService
|
||||
$order_prescription = OrderPrescription::getWithPage($params, ['*'], $page, $per_page);
|
||||
if (!empty($order_prescription['data'])) {
|
||||
foreach ($order_prescription['data'] as &$item) {
|
||||
// 将模型对象转换为数组,避免间接修改重载元素错误
|
||||
if (is_object($item)) {
|
||||
$item = $item->toArray();
|
||||
}
|
||||
|
||||
//处理抄方情况
|
||||
$params = array();
|
||||
$params['order_inquiry_id'] = $item['order_inquiry_id'];
|
||||
@ -2013,14 +2018,18 @@ class PatientOrderService extends BaseService
|
||||
|
||||
$UserDoctor = UserDoctor::getOne($params, $fields);
|
||||
if (!empty($UserDoctor)) {
|
||||
$item['UserDoctor']['doctor_title'] = DoctorTitleCode::getMessage($UserDoctor['doctor_title']);
|
||||
}
|
||||
}else{
|
||||
if (!empty($item['UserDoctor'])) {
|
||||
$item['UserDoctor']['doctor_title'] = DoctorTitleCode::getMessage($item['UserDoctor']['doctor_title']);
|
||||
$item['UserDoctor'] = $UserDoctor->toArray();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($item['UserDoctor'])) {
|
||||
// 确保 UserDoctor 也是数组格式
|
||||
if (is_object($item['UserDoctor'])) {
|
||||
$item['UserDoctor'] = $item['UserDoctor']->toArray();
|
||||
}
|
||||
$item['UserDoctor']['doctor_title'] = DoctorTitleCode::getMessage($item['UserDoctor']['doctor_title']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user