19
This commit is contained in:
parent
fce126bbbd
commit
6a9688b34f
@ -459,7 +459,7 @@ func (r *OrderPrescriptionDao) GetOrderTransferPrescriptionExportListSearch(req
|
||||
|
||||
// 关联抄方医生对应的用户表(用于按用户姓名查询)
|
||||
query = query.Joins("LEFT JOIN " + userTable + " ON " + doctorTable + ".user_id = " + userTable + ".user_id")
|
||||
|
||||
|
||||
// 患者表
|
||||
query = query.Preload("UserPatient", func(db *gorm.DB) *gorm.DB {
|
||||
return db.Omit("open_id", "union_id", "wx_session_key")
|
||||
@ -483,6 +483,13 @@ func (r *OrderPrescriptionDao) GetOrderTransferPrescriptionExportListSearch(req
|
||||
// 处方关联疾病表
|
||||
query = query.Preload("OrderPrescriptionIcd")
|
||||
|
||||
// 处方关联问诊表(抄方用)
|
||||
query = query.Preload("OrderInquiry", func(db *gorm.DB) *gorm.DB {
|
||||
return db.Preload("UserDoctor", func(db *gorm.DB) *gorm.DB {
|
||||
return db.Select("user_id", "user_name", "doctor_id")
|
||||
})
|
||||
})
|
||||
|
||||
// 患者家庭成员表
|
||||
query = query.Preload("PatientFamily")
|
||||
|
||||
|
||||
@ -1830,9 +1830,9 @@ func (r *ExportService) OrderPrescription(d []*model.OrderPrescription) (string,
|
||||
DoctorAdvice: v.DoctorAdvice,
|
||||
}
|
||||
|
||||
if v.UserDoctor != nil {
|
||||
if v.OrderInquiry !=nil && v.OrderInquiry.UserDoctor != nil {
|
||||
// 医生姓名
|
||||
data.DoctorName = v.UserDoctor.UserName
|
||||
data.DoctorName = v.OrderInquiry.UserDoctor.UserName
|
||||
}
|
||||
|
||||
if v.UserPharmacist != nil {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user