diff --git a/.gitignore b/.gitignore index 34ba1b0..04675b1 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,4 @@ id_rsa background image/ deploy.bat +docbackground.exe diff --git a/controller/blog.go b/controller/blog.go index 652bfee..f2cc7f1 100644 --- a/controller/blog.go +++ b/controller/blog.go @@ -48,28 +48,27 @@ func GetArticles(c *gin.Context) { if req.Name != ""{ if req.Type == 110{ is_public := 0 - if public == "true"{ + if public == "true" || public == ""{ is_public = 0 }else{ is_public = 1 } sql = "select * from doc where doc.title like '%%%s%%' and is_public = %d limit %d offset %d " - sql = fmt.Sprintf(sql,is_public) - + sql = fmt.Sprintf(sql,req.Name,is_public,limit,offset*limit) }else{ is_public := 0 - if public == "true"{ + if public == "true" || public == ""{ is_public = 0 }else{ is_public = 1 } sql = fmt.Sprintf("select * from doc where doc.title like '%%%s%%' and doc.type = %d and is_public = %d limit %d offset %d ", - is_public,req.Name,req.Type,limit,offset*limit) + req.Name,req.Type,is_public,limit,offset*limit) } }else{ if req.Type == 110{ is_public := 0 - if public == "true"{ + if public == "true" || public == ""{ is_public = 1 }else{ is_public = 0 @@ -78,7 +77,7 @@ func GetArticles(c *gin.Context) { "limit %d offset %d",is_public,limit,offset) }else{ is_public := 0 - if public == "true"{ + if public == "true" ||public == ""{ is_public = 1 }else{ is_public = 0