修复后台文章查询

master
DESKTOP-4RNDQIC\29019 2020-05-31 19:48:24 +08:00
parent 9f80b48fd7
commit a1ef7d9cab
2 changed files with 7 additions and 7 deletions

1
.gitignore vendored
View File

@ -11,3 +11,4 @@ id_rsa
background
image/
deploy.bat
docbackground.exe

View File

@ -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