Browse Source

Merge pull request #155 from SliverHorn/patch-1

Update sys_dictionary.go
main
蒋吉兆 4 years ago
committed by GitHub
parent
commit
6b464a9a37
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      server/service/sys_dictionary.go

8
server/service/sys_dictionary.go

@ -85,16 +85,16 @@ func GetSysDictionaryInfoList(info request.SysDictionarySearch) (err error, list
var sysDictionarys []model.SysDictionary
// 如果有条件搜索 下方会自动创建搜索语句
if info.Name != "" {
db = db.Where("name LIKE ?", "%"+info.Name+"%")
db = db.Where("`name` LIKE ?", "%"+info.Name+"%")
}
if info.Type != "" {
db = db.Where("type LIKE ?", "%"+info.Type+"%")
db = db.Where("`type` LIKE ?", "%"+info.Type+"%")
}
if info.Status != nil {
db = db.Where("status = ?", info.Status)
db = db.Where("`status` = ?", info.Status)
}
if info.Desc != "" {
db = db.Where("desc LIKE ?", "%"+info.Desc+"%")
db = db.Where("`desc` LIKE ?", "%"+info.Desc+"%")
}
err = db.Count(&total).Error
err = db.Limit(limit).Offset(offset).Find(&sysDictionarys).Error

Loading…
Cancel
Save