ziwen 2 anos atrás
pai
commit
3329e89d1e
2 arquivos alterados com 4 adições e 16 exclusões
  1. 1 3
      controllers/user.go
  2. 3 13
      models/article_comment.go

+ 1 - 3
controllers/user.go

@@ -1532,7 +1532,6 @@ func (this *UserCommonController) LoginPublic() {
 
 // @Title 获取我的留言
 // @Description 获取我的留言列表
-// @Param   CommentType		query	int		true	"留言种类,1报告 2微路演"
 // @Success 200 {object} models.CygxCommentListResp
 // @router /comment/list [get]
 func (this *UserController) CommnetList() {
@@ -1548,10 +1547,9 @@ func (this *UserController) CommnetList() {
 		br.Ret = 408
 		return
 	}
-	commentType, _ := this.GetInt("CommentType", 1)
 
 	userId := this.User.UserId
-	commentlist, err := models.GetCommentList(userId, commentType)
+	commentlist, err := models.GetCommentList(userId)
 	if err != nil && err.Error() != utils.ErrNoRow() {
 		br.Msg = "获取失败"
 		br.ErrMsg = "获取我的留言列表失败,Err:" + err.Error()

+ 3 - 13
models/article_comment.go

@@ -33,24 +33,14 @@ type AddCygxArticleCommentReq struct {
 }
 
 //我的留言列表
-func GetCommentList(userId, commentType int) (items []*CygxArticleComment, err error) {
+func GetCommentList(userId int) (items []*CygxArticleComment, err error) {
 	o := orm.NewOrm()
-	sql := ""
-	if commentType == 1{
-		sql = `SELECT
+	sql := `SELECT
 			* 
 		FROM
 			cygx_article_comment AS c
 		WHERE
-			user_id = ? AND article_id <> 0 ORDER BY c.create_time DESC`
-	} else if commentType == 2{
-		sql = `SELECT
-			* 
-		FROM
-			cygx_article_comment AS c
-		WHERE
-			user_id = ? AND article_id = 0 ORDER BY c.create_time DESC`
-	}
+			user_id = ? ORDER BY c.create_time DESC`
 
 	_, err = o.Raw(sql, userId).QueryRows(&items)
 	return