正在显示
9 个修改的文件
包含
17 行增加
和
17 行删除
| @@ -418,5 +418,5 @@ func (rs *EvaluationProjectService) CheckRecipients(in *command.CheckRecipientCo | @@ -418,5 +418,5 @@ func (rs *EvaluationProjectService) CheckRecipients(in *command.CheckRecipientCo | ||
| 418 | if err := transactionContext.CommitTransaction(); err != nil { | 418 | if err := transactionContext.CommitTransaction(); err != nil { |
| 419 | return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) | 419 | return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) |
| 420 | } | 420 | } |
| 421 | - return repeatNum, nil | 421 | + return map[string]interface{}{"repeatNum": repeatNum}, nil |
| 422 | } | 422 | } |
| @@ -119,7 +119,7 @@ func (repo *EvaluationCycleRepository) Find(queryOptions map[string]interface{}) | @@ -119,7 +119,7 @@ func (repo *EvaluationCycleRepository) Find(queryOptions map[string]interface{}) | ||
| 119 | 119 | ||
| 120 | query := tx.Model(&m).Where("deleted_at isnull") | 120 | query := tx.Model(&m).Where("deleted_at isnull") |
| 121 | 121 | ||
| 122 | - if v, ok := queryOptions["name"]; ok && len(v.(string)) > 0 { | 122 | + if v, ok := queryOptions["name"].(string); ok && len(v) > 0 { |
| 123 | query.Where("name LIKE ?", v) | 123 | query.Where("name LIKE ?", v) |
| 124 | } | 124 | } |
| 125 | 125 | ||
| @@ -170,7 +170,7 @@ func (repo *EvaluationCycleRepository) Count(queryOptions map[string]interface{} | @@ -170,7 +170,7 @@ func (repo *EvaluationCycleRepository) Count(queryOptions map[string]interface{} | ||
| 170 | query.Where("id != ?", notId) | 170 | query.Where("id != ?", notId) |
| 171 | } | 171 | } |
| 172 | 172 | ||
| 173 | - if v, ok := queryOptions["name"]; ok { | 173 | + if v, ok := queryOptions["name"].(string); ok && len(v) > 0 { |
| 174 | query.Where("name = ?", v) | 174 | query.Where("name = ?", v) |
| 175 | } | 175 | } |
| 176 | 176 |
| @@ -186,7 +186,7 @@ func (repo *EvaluationCycleTemplateRepository) Count(queryOptions map[string]int | @@ -186,7 +186,7 @@ func (repo *EvaluationCycleTemplateRepository) Count(queryOptions map[string]int | ||
| 186 | query.Where("id != ?", v) | 186 | query.Where("id != ?", v) |
| 187 | } | 187 | } |
| 188 | 188 | ||
| 189 | - if v, ok := queryOptions["name"]; ok { | 189 | + if v, ok := queryOptions["name"].(string); ok && len(v) > 0 { |
| 190 | query.Where("name = ?", v) | 190 | query.Where("name = ?", v) |
| 191 | } | 191 | } |
| 192 | 192 |
| @@ -131,7 +131,7 @@ func (repo *EvaluationProjectRepository) Find(queryOptions map[string]interface{ | @@ -131,7 +131,7 @@ func (repo *EvaluationProjectRepository) Find(queryOptions map[string]interface{ | ||
| 131 | query.ExcludeColumn(excludeColumns...) | 131 | query.ExcludeColumn(excludeColumns...) |
| 132 | } | 132 | } |
| 133 | 133 | ||
| 134 | - if v, ok := queryOptions["name"]; ok { | 134 | + if v, ok := queryOptions["name"].(string); ok && len(v) > 0 { |
| 135 | query.Where("name = ?", v) | 135 | query.Where("name = ?", v) |
| 136 | } | 136 | } |
| 137 | 137 | ||
| @@ -192,7 +192,7 @@ func (repo *EvaluationProjectRepository) Count(queryOptions map[string]interface | @@ -192,7 +192,7 @@ func (repo *EvaluationProjectRepository) Count(queryOptions map[string]interface | ||
| 192 | query.Where("id != ?", v) | 192 | query.Where("id != ?", v) |
| 193 | } | 193 | } |
| 194 | 194 | ||
| 195 | - if v, ok := queryOptions["name"]; ok { | 195 | + if v, ok := queryOptions["name"].(string); ok && len(v) > 0 { |
| 196 | query.Where("name = ?", v) | 196 | query.Where("name = ?", v) |
| 197 | } | 197 | } |
| 198 | 198 |
| @@ -127,7 +127,7 @@ func (repo *EvaluationRuleRepository) Find(queryOptions map[string]interface{}) | @@ -127,7 +127,7 @@ func (repo *EvaluationRuleRepository) Find(queryOptions map[string]interface{}) | ||
| 127 | query.Where("id in(?)", pg.In(v)) | 127 | query.Where("id in(?)", pg.In(v)) |
| 128 | } | 128 | } |
| 129 | 129 | ||
| 130 | - if v, ok := queryOptions["name"]; ok { | 130 | + if v, ok := queryOptions["name"].(string); ok && len(v) > 0 { |
| 131 | query.Where("name = ?", v) | 131 | query.Where("name = ?", v) |
| 132 | } | 132 | } |
| 133 | 133 | ||
| @@ -176,7 +176,7 @@ func (repo *EvaluationRuleRepository) Count(queryOptions map[string]interface{}) | @@ -176,7 +176,7 @@ func (repo *EvaluationRuleRepository) Count(queryOptions map[string]interface{}) | ||
| 176 | query.Where("id != ?", v) | 176 | query.Where("id != ?", v) |
| 177 | } | 177 | } |
| 178 | 178 | ||
| 179 | - if v, ok := queryOptions["name"]; ok { | 179 | + if v, ok := queryOptions["name"].(string); ok && len(v) > 0 { |
| 180 | query.Where("name = ?", v) | 180 | query.Where("name = ?", v) |
| 181 | } | 181 | } |
| 182 | 182 |
| @@ -129,7 +129,7 @@ func (repo *EvaluationTemplateRepository) Find(queryOptions map[string]interface | @@ -129,7 +129,7 @@ func (repo *EvaluationTemplateRepository) Find(queryOptions map[string]interface | ||
| 129 | query.Where("id != ?", v) | 129 | query.Where("id != ?", v) |
| 130 | } | 130 | } |
| 131 | 131 | ||
| 132 | - if v, ok := queryOptions["name"]; ok && len(v.(string)) > 0 { | 132 | + if v, ok := queryOptions["name"].(string); ok && len(v) > 0 { |
| 133 | query.Where("name LIKE ?", v) | 133 | query.Where("name LIKE ?", v) |
| 134 | } | 134 | } |
| 135 | 135 | ||
| @@ -186,7 +186,7 @@ func (repo *EvaluationTemplateRepository) Count(queryOptions map[string]interfac | @@ -186,7 +186,7 @@ func (repo *EvaluationTemplateRepository) Count(queryOptions map[string]interfac | ||
| 186 | query.Where("id != ?", v) | 186 | query.Where("id != ?", v) |
| 187 | } | 187 | } |
| 188 | 188 | ||
| 189 | - if v, ok := queryOptions["name"]; ok { | 189 | + if v, ok := queryOptions["name"].(string); ok && len(v) > 0 { |
| 190 | query.Where("name = ?", v) | 190 | query.Where("name = ?", v) |
| 191 | } | 191 | } |
| 192 | 192 |
| @@ -113,8 +113,8 @@ func (repo *RoleRepository) Find(queryOptions map[string]interface{}) (int64, [] | @@ -113,8 +113,8 @@ func (repo *RoleRepository) Find(queryOptions map[string]interface{}) (int64, [] | ||
| 113 | var m []*models.Role | 113 | var m []*models.Role |
| 114 | query := tx.Model(&m).Where("deleted_at isnull") | 114 | query := tx.Model(&m).Where("deleted_at isnull") |
| 115 | 115 | ||
| 116 | - if name, ok := queryOptions["name"]; ok { | ||
| 117 | - query.Where("name = ?", name) | 116 | + if v, ok := queryOptions["name"].(string); ok && len(v) > 0 { |
| 117 | + query.Where("name = ?", v) | ||
| 118 | } | 118 | } |
| 119 | 119 | ||
| 120 | if companyId, ok := queryOptions["companyId"]; ok { | 120 | if companyId, ok := queryOptions["companyId"]; ok { |
| @@ -154,8 +154,8 @@ func (repo *RoleRepository) Count(queryOptions map[string]interface{}) (int64, e | @@ -154,8 +154,8 @@ func (repo *RoleRepository) Count(queryOptions map[string]interface{}) (int64, e | ||
| 154 | query.Where("id != ?", notId) | 154 | query.Where("id != ?", notId) |
| 155 | } | 155 | } |
| 156 | 156 | ||
| 157 | - if name, ok := queryOptions["name"]; ok { | ||
| 158 | - query.Where("name = ?", name) | 157 | + if v, ok := queryOptions["name"].(string); ok && len(v) > 0 { |
| 158 | + query.Where("name = ?", v) | ||
| 159 | } | 159 | } |
| 160 | 160 | ||
| 161 | if companyId, ok := queryOptions["companyId"]; ok { | 161 | if companyId, ok := queryOptions["companyId"]; ok { |
| @@ -161,8 +161,8 @@ func (repo *RoleUserRepository) Count(queryOptions map[string]interface{}) (int6 | @@ -161,8 +161,8 @@ func (repo *RoleUserRepository) Count(queryOptions map[string]interface{}) (int6 | ||
| 161 | query.Where("id != ?", notId) | 161 | query.Where("id != ?", notId) |
| 162 | } | 162 | } |
| 163 | 163 | ||
| 164 | - if name, ok := queryOptions["name"]; ok { | ||
| 165 | - query.Where("name = ?", name) | 164 | + if v, ok := queryOptions["name"].(string); ok && len(v) > 0 { |
| 165 | + query.Where("name = ?", v) | ||
| 166 | } | 166 | } |
| 167 | 167 | ||
| 168 | if companyId, ok := queryOptions["companyId"]; ok { | 168 | if companyId, ok := queryOptions["companyId"]; ok { |
| @@ -116,7 +116,7 @@ func (repo *UserRepository) Find(queryOptions map[string]interface{}) (int, []*d | @@ -116,7 +116,7 @@ func (repo *UserRepository) Find(queryOptions map[string]interface{}) (int, []*d | ||
| 116 | if v, ok := queryOptions["account"]; ok { | 116 | if v, ok := queryOptions["account"]; ok { |
| 117 | query.Where("account like ?", v) | 117 | query.Where("account like ?", v) |
| 118 | } | 118 | } |
| 119 | - if v, ok := queryOptions["name"]; ok { | 119 | + if v, ok := queryOptions["name"].(string); ok && len(v) > 0 { |
| 120 | query.Where("name like ?", fmt.Sprintf("%%%v%%", v)) | 120 | query.Where("name like ?", fmt.Sprintf("%%%v%%", v)) |
| 121 | } | 121 | } |
| 122 | if v, ok := queryOptions["offset"]; ok { | 122 | if v, ok := queryOptions["offset"]; ok { |
-
请 注册 或 登录 后发表评论