Pārlūkot izejas kodu

详情评论bug

layui
mail_yanpeng@163.com pirms 6 gadiem
vecāks
revīzija
bfecb0e29f
  1. 4
      filter/Security.go
  2. 2
      service/CommentService.go

4
filter/Security.go

@ -9,8 +9,8 @@ var FilterAdmin = func(ctx *context.Context) {
url := ctx.Input.URI()
refer := ctx.Input.Refer()
logs.Info(url)
logs.Info(refer)
logs.Info("https://www.aiprose.com"+url)
//logs.Info(refer)
//logs.Info("https://www.aiprose.com"+url)
if "https://www.aiprose.com"+url == refer {
ctx.Input.SetData("refresh", true)
}

2
service/CommentService.go

@ -9,7 +9,7 @@ import (
func FindCommentByBlog(bid int64) ([]*models.Comment, error) {
var comms []*models.Comment
o := orm.NewOrm()
_, err := o.QueryTable(&models.Comment{}).Filter("Pid", 0).OrderBy("-Ctime").All(&comms)
_, err := o.QueryTable(&models.Comment{}).Filter("Pid", 0).Filter("BlogId",bid).OrderBy("-Ctime").All(&comms)
if err != nil {
return nil, err
}

Notiek ielāde…
Atcelt
Saglabāt