Pārlūkot izejas kodu

fix:知识资源状态筛选

zqbao 3 mēneši atpakaļ
vecāks
revīzija
ba0afdf45e
1 mainītis faili ar 9 papildinājumiem un 1 dzēšanām
  1. 9 1
      controllers/knowledge/resource.go

+ 9 - 1
controllers/knowledge/resource.go

@@ -37,7 +37,7 @@ type ResourceController struct {
 // @Param   EndDate   query   string  true       "结束时间"
 // @Param   Frequency   query   string  true       "频度"
 // @Param   ClassifyIds   query   int  true       "分类id, 多选, 英文逗号分隔"
-// @Param   State   query   int  true       "状态"
+// @Param   State   query   string  true       "状态, 多选, 英文逗号分隔"
 // @Param   KeyWord   query   string  true       "搜索关键词"
 // @Param   PublishSort   query   string  true       "desc:降序,asc 升序(预留)"
 // @Param   FilterReportType   query   string  true       "筛选事件类型,1:公共研报,2:共享研报,3:我的研报"
@@ -57,6 +57,9 @@ func (this *ResourceController) List() {
 	currentIndex, _ := this.GetInt("CurrentIndex")
 
 	classifyIds := this.GetString("ClassifyIds")
+
+	state := this.GetString("State")
+
 	// 添加人
 	addUserIds, _ := this.GetInt("SysUserIds")
 	// 标签
@@ -96,6 +99,11 @@ func (this *ResourceController) List() {
 		condition += ` AND admin_id = ? `
 		pars = append(pars, this.SysUser.AdminId)
 	}
+	if state != "" {
+		stateArr := strings.Split(state, ",")
+		condition += ` AND state in (?) `
+		pars = append(pars, stateArr)
+	}
 
 	if isShowPublic {
 		condition += ` AND state = ? `