...
|
...
|
@@ -113,8 +113,8 @@ func (repo *RoleRepository) Find(queryOptions map[string]interface{}) (int64, [] |
|
|
var m []*models.Role
|
|
|
query := tx.Model(&m).Where("deleted_at isnull")
|
|
|
|
|
|
if name, ok := queryOptions["name"]; ok {
|
|
|
query.Where("name = ?", name)
|
|
|
if v, ok := queryOptions["name"].(string); ok && len(v) > 0 {
|
|
|
query.Where("name = ?", v)
|
|
|
}
|
|
|
|
|
|
if companyId, ok := queryOptions["companyId"]; ok {
|
...
|
...
|
@@ -154,8 +154,8 @@ func (repo *RoleRepository) Count(queryOptions map[string]interface{}) (int64, e |
|
|
query.Where("id != ?", notId)
|
|
|
}
|
|
|
|
|
|
if name, ok := queryOptions["name"]; ok {
|
|
|
query.Where("name = ?", name)
|
|
|
if v, ok := queryOptions["name"].(string); ok && len(v) > 0 {
|
|
|
query.Where("name = ?", v)
|
|
|
}
|
|
|
|
|
|
if companyId, ok := queryOptions["companyId"]; ok {
|
...
|
...
|
|