From a1ef7d9cab7845f298963a3a50f6089445c62f7d Mon Sep 17 00:00:00 2001 From: "DESKTOP-4RNDQIC\\29019" <290198252@qq.com> Date: Sun, 31 May 2020 19:48:24 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=90=8E=E5=8F=B0=E6=96=87?= =?UTF-8?q?=E7=AB=A0=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + controller/blog.go | 13 ++++++------- 2 files changed, 7 insertions(+), 7 deletions(-) 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