互动留言医院姓名为空问题
This commit is contained in:
parent
335e16698c
commit
3cb3495eb6
@ -156,13 +156,17 @@ func (r *CaseCommentDao) GetCaseCommentPageSearch(req requests.GetCaseCommentPag
|
||||
// 执行组建
|
||||
orQuery = orQuery.Or(gorm.Expr("user_id IN (?)", userSubQuery))
|
||||
|
||||
// 病例名称
|
||||
caseSubQuery := global.Db.Model(&model.Case{}).
|
||||
Select("case_id").
|
||||
Where("case_name LIKE ?", keyword)
|
||||
// 医院名称
|
||||
basicHospitalSubQuery := global.Db.Model(&model.BasicHospital{}).
|
||||
Select("hospital_id").
|
||||
Where("hospital_name LIKE ?", keyword)
|
||||
|
||||
userHospitalIdSubQuery := global.Db.Model(&model.User{}).
|
||||
Select("user_id").
|
||||
Where(gorm.Expr("hospital_id IN (?)", basicHospitalSubQuery))
|
||||
|
||||
// 执行组建
|
||||
orQuery = orQuery.Or(gorm.Expr("case_id IN (?)", caseSubQuery))
|
||||
orQuery = orQuery.Or(gorm.Expr("user_id IN (?)", userHospitalIdSubQuery))
|
||||
|
||||
query = query.Where(orQuery)
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user