...
|
...
|
@@ -133,9 +133,14 @@ func (repo *UserRepository) Find(queryOptions map[string]interface{}) (int, []*d |
|
|
if v, ok := queryOptions["name"].(string); ok && len(v) > 0 {
|
|
|
query.Where("name like ?", fmt.Sprintf("%%%v%%", v))
|
|
|
}
|
|
|
// 模糊搜索条名称 + 账号
|
|
|
if v, ok := queryOptions["search"].(string); ok && len(v) > 0 {
|
|
|
query.Where("name like ? or account like ?", fmt.Sprintf("%%%v%%", v), fmt.Sprintf("%%%v%%", v))
|
|
|
}
|
|
|
if v, ok := queryOptions["names"]; ok {
|
|
|
query.Where("name in(?)", pg.In(v))
|
|
|
}
|
|
|
|
|
|
if v, ok := queryOptions["offset"]; ok {
|
|
|
if value, ok := v.(int); ok {
|
|
|
query.Offset(value)
|
...
|
...
|
|