12
This commit is contained in:
parent
ffbc1c83c2
commit
92781a3624
@ -345,10 +345,11 @@ func (r *OrderPrescriptionDao) GetOrderPrescriptionTransferPageSearch(req reques
|
||||
Select("doctor_id").
|
||||
Where(gorm.Expr("user_id IN (?)", transferDoctorUserSubQuery))
|
||||
|
||||
// 使用 OR 条件:患者匹配 OR 抄方医生匹配 OR 就诊人匹配
|
||||
query = query.Where(prescriptionTable+".patient_id IN (?)", patientSubQuery).
|
||||
Or(inquiryTable+".doctor_id IN (?)", transferDoctorSubQuery).
|
||||
Or(prescriptionTable+".family_id IN (?)", patientFamilySubQuery)
|
||||
// 使用 OR 条件:患者匹配 OR 抄方医生匹配 OR 就诊人匹配(整体加括号)
|
||||
query = query.Where(
|
||||
gorm.Expr("("+prescriptionTable+".patient_id IN (?) OR "+inquiryTable+".doctor_id IN (?) OR "+prescriptionTable+".family_id IN (?))",
|
||||
patientSubQuery, transferDoctorSubQuery, patientFamilySubQuery),
|
||||
)
|
||||
}
|
||||
|
||||
// 处方状态
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user