Bladeren bron

no message

xingzai 1 jaar geleden
bovenliggende
commit
b87736a642
1 gewijzigde bestanden met toevoegingen van 8 en 1 verwijderingen
  1. 8 1
      controllers/yanxuan_special.go

+ 8 - 1
controllers/yanxuan_special.go

@@ -20,6 +20,7 @@ type YanxuanSpecialController struct {
 // @Param   UserId   query   int  true       "用户ID"
 // @Param   PageSize   query   int  true       "每页数据条数"
 // @Param   CurrentIndex   query   int  true       "当前页页码,从1开始"
+// @Param   Status   query   int  false       "研选专栏装态"
 // @Success 200 {object} models.SpecialListResp
 // @router /list [get]
 func (this *YanxuanSpecialController) List() {
@@ -38,6 +39,7 @@ func (this *YanxuanSpecialController) List() {
 	userId, _ := this.GetInt("UserId", 0)
 	pageSize, _ := this.GetInt("PageSize")
 	currentIndex, _ := this.GetInt("CurrentIndex")
+	status, _ := this.GetInt("Status")
 
 	var startSize int
 	if pageSize <= 0 {
@@ -55,7 +57,12 @@ func (this *YanxuanSpecialController) List() {
 		condition += ` AND a.user_id = ? `
 		pars = append(pars, userId)
 	}
-	condition += ` AND a.status = 3 `
+	if status == 2 {
+		condition += ` AND a.status = 2 `
+	} else {
+		condition += ` AND a.status = 3 `
+	}
+
 	total, err := models.GetCygxYanxuanSpecialCount(condition, pars)
 	if err != nil {
 		br.Msg = "获取失败"