diff --git a/app/Services/PatientOrderService.php b/app/Services/PatientOrderService.php index d9a01a7..9d86f78 100644 --- a/app/Services/PatientOrderService.php +++ b/app/Services/PatientOrderService.php @@ -1997,11 +1997,12 @@ class PatientOrderService extends BaseService $params['platform_audit_status'] = 1; $params['is_delete'] = 0; $order_prescription = OrderPrescription::getWithPage($params, ['*'], $page, $per_page); - Log::getInstance("PatientOrderService-getPatientPrescriptionOrderList")->info("order_prescription", [ - 'order_prescription' => $order_prescription, - ]); - if (!empty($order_prescription['data'])) { - foreach ($order_prescription['data'] as &$item) { + + // 创建新的数据副本 + $order_prescription_new = $order_prescription; + + if (!empty($order_prescription_new['data'])) { + foreach ($order_prescription_new['data'] as &$item) { //处理抄方情况 $params = array(); $params['order_inquiry_id'] = $item['order_inquiry_id']; @@ -2013,12 +2014,8 @@ class PatientOrderService extends BaseService //若为抄方订单则显示原订单 $params['doctor_id'] = $OrderInquiry['doctor_id']; $fields = ['doctor_id','user_name','doctor_title']; - $UserDoctor = UserDoctor::getOne($params, $fields); if (!empty($UserDoctor)) { - Log::getInstance("PatientOrderService-getPatientPrescriptionOrderList")->info("修改 UserDoctor", [ - 'UserDoctor' => $UserDoctor->toArray(), - ]); $item['UserDoctor'] = $UserDoctor; } } @@ -2030,11 +2027,8 @@ class PatientOrderService extends BaseService } } - Log::getInstance("PatientOrderService-getPatientPrescriptionOrderList")->info("order_prescription 最终", [ - 'order_prescription' => $order_prescription, - ]); - return success($order_prescription); + return success($order_prescription_new); } catch (\Throwable $e) { Log::getInstance("PatientOrderService-getPatientPrescriptionOrderList")->error("获取处方订单列表异常", [ 'message' => $e->getMessage(),