parent
755fb711a9
commit
9f53e9551e
@ -1998,14 +1998,26 @@ class PatientOrderService extends BaseService
|
||||
$params['is_delete'] = 0;
|
||||
$order_prescription = OrderPrescription::getWithPage($params, ['*'], $page, $per_page);
|
||||
|
||||
// 创建新的数据副本
|
||||
$order_prescription_new = $order_prescription;
|
||||
// 创建新的数据副本,初始化为空,保留分页信息
|
||||
$order_prescription_new = [];
|
||||
if (!empty($order_prescription)) {
|
||||
// 复制分页信息等非data字段
|
||||
foreach ($order_prescription as $key => $value) {
|
||||
if ($key !== 'data') {
|
||||
$order_prescription_new[$key] = $value;
|
||||
}
|
||||
}
|
||||
$order_prescription_new['data'] = [];
|
||||
}
|
||||
|
||||
if (!empty($order_prescription_new['data'])) {
|
||||
foreach ($order_prescription_new['data'] as &$item) {
|
||||
if (!empty($order_prescription['data'])) {
|
||||
foreach ($order_prescription['data'] as $item) {
|
||||
// 复制原始item数据
|
||||
$new_item = $item;
|
||||
|
||||
//处理抄方情况
|
||||
$params = array();
|
||||
$params['order_inquiry_id'] = $item['order_inquiry_id'];
|
||||
$params['order_inquiry_id'] = $new_item['order_inquiry_id'];
|
||||
$OrderInquiry = OrderInquiry::getOne($params);
|
||||
if (!empty($OrderInquiry)) {
|
||||
//为抄方订单
|
||||
@ -2016,14 +2028,17 @@ class PatientOrderService extends BaseService
|
||||
$fields = ['doctor_id','user_name','doctor_title'];
|
||||
$UserDoctor = UserDoctor::getOne($params, $fields);
|
||||
if (!empty($UserDoctor)) {
|
||||
$item['UserDoctor'] = $UserDoctor;
|
||||
$new_item['UserDoctor'] = $UserDoctor;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($item['UserDoctor'])) {
|
||||
$item['UserDoctor']['doctor_title'] = DoctorTitleCode::getMessage($item['UserDoctor']['doctor_title']);
|
||||
if (!empty($new_item['UserDoctor'])) {
|
||||
$new_item['UserDoctor']['doctor_title'] = DoctorTitleCode::getMessage($new_item['UserDoctor']['doctor_title']);
|
||||
}
|
||||
|
||||
// 将处理后的数据添加到新数组中
|
||||
$order_prescription_new['data'][] = $new_item;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user