diff --git a/controller/blog.go b/controller/blog.go index f2cc7f1..131ee82 100644 --- a/controller/blog.go +++ b/controller/blog.go @@ -48,7 +48,7 @@ func GetArticles(c *gin.Context) { if req.Name != ""{ if req.Type == 110{ is_public := 0 - if public == "true" || public == ""{ + if public == "true"{ is_public = 0 }else{ is_public = 1 @@ -57,7 +57,7 @@ func GetArticles(c *gin.Context) { sql = fmt.Sprintf(sql,req.Name,is_public,limit,offset*limit) }else{ is_public := 0 - if public == "true" || public == ""{ + if public == "true" { is_public = 0 }else{ is_public = 1 @@ -68,7 +68,7 @@ func GetArticles(c *gin.Context) { }else{ if req.Type == 110{ is_public := 0 - if public == "true" || public == ""{ + if public == "true" { is_public = 1 }else{ is_public = 0 @@ -77,7 +77,7 @@ func GetArticles(c *gin.Context) { "limit %d offset %d",is_public,limit,offset) }else{ is_public := 0 - if public == "true" ||public == ""{ + if public == "true" { is_public = 1 }else{ is_public = 0