zqbao 9 ヶ月 前
コミット
8de89d6b82
1 ファイル変更5 行追加8 行削除
  1. 5 8
      controllers/user_read_record.go

+ 5 - 8
controllers/user_read_record.go

@@ -23,7 +23,7 @@ type UserReadRecordController struct {
 // @Param   PageSize   query   int  true       "每页数据条数"
 // @Param   CurrentIndex   query   int  true       "当前页页码,从1开始"
 // @Param   SellerId   query   int  true       "销售id"
-// @Param   Status   query   string  true       "用户状态"
+// @Param   Status   query   int  true       "用户状态"
 // @Param   KeyWord   query   string  true       "手机号/邮箱/姓名"
 // @Param   IsRegistered   query   string  true       "是否注册"
 // @Param   IsSubscribed   query   string  true       "是否关注"
@@ -45,7 +45,7 @@ func (this *UserReadRecordController) List() {
 	pageSize, _ := this.GetInt("PageSize")
 	currentIndex, _ := this.GetInt("CurrentIndex")
 	sellerIdStr := this.GetString("SellerId")
-	status := this.GetString("Status")
+	status, _ := this.GetInt("Status")
 	keyWord := this.GetString("KeyWord")
 	IsRegistered := this.GetString("IsRegisterd")
 	IsSubscribed := this.GetString("IsSubscribed")
@@ -113,16 +113,13 @@ func (this *UserReadRecordController) List() {
 	}
 
 	switch status {
-	case "禁用":
+	case utils.UserStatusNo:
 		condition += " AND u.status=? "
 		pars = append(pars, 0)
-	case "潜在":
-		condition += " AND u.status=? "
-		pars = append(pars, 1)
-	case "正式":
+	case utils.UserStatusFormal:
 		condition += " AND u.status=? "
 		pars = append(pars, 2)
-	case "":
+	default:
 		condition += " AND (u.status=? OR u.status=?) "
 		pars = append(pars, 0, 2)
 	}