fix: 查询问题修复

This commit is contained in:
meilin.huang
2021-12-13 09:49:05 +08:00
parent 1f208b7b63
commit 8d30d7103c
3 changed files with 18 additions and 0 deletions

View File

@@ -22,6 +22,9 @@ func (r *redisRepo) GetRedisList(condition *entity.Redis, pageParam *model.PageP
if condition.ProjectId != 0 {
sql = fmt.Sprintf("%s AND d.project_id = %d", sql, condition.ProjectId)
}
if condition.EnvId != 0 {
sql = fmt.Sprintf("%s AND d.env_id = %d", sql, condition.EnvId)
}
if condition.Host != "" {
sql = sql + " AND d.host LIKE '%" + condition.Host + "%'"
}