feat 修改article的搜索
This commit is contained in:
parent
277d73739b
commit
6def3252d8
@ -119,7 +119,12 @@ func (f *FindArticleQuery) Scope(db *gorm.DB) *gorm.DB {
|
|||||||
db = db.Where("available=?", *f.Available)
|
db = db.Where("available=?", *f.Available)
|
||||||
}
|
}
|
||||||
if f.Ban != nil {
|
if f.Ban != nil {
|
||||||
db = db.Where("ban=?", *f.Ban)
|
if *f.Ban {
|
||||||
|
db = db.Where("ban=?", *f.Ban)
|
||||||
|
} else {
|
||||||
|
db = db.Where("(ban=? or ban is null)", false)
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return db
|
return db
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user