Browse Source

no message

xingzai 1 year ago
parent
commit
ed0ca9949f
1 changed files with 11 additions and 1 deletions
  1. 11 1
      controllers/cygx/askserie_video.go

+ 11 - 1
controllers/cygx/askserie_video.go

@@ -126,6 +126,7 @@ func (this *AskserieVideoController) PreserveAndPublish() {
 // @Param   PublishStatus   query   int  true       "发布状态: -1-默认全部; 0-未发布; 1-已关注"
 // @Param   ChartPermissionId   query   string  false       "行业Id"
 // @Param   KeyWord   query   string  false       "搜索关键词"
+// @Param   SortType          query   string    false		"排序顺序:asc、desc"
 // @Success Ret=200 {object} cygx.GetCygxTacticsTimeLineResp
 // @router /askserie_video/list [get]
 func (this *AskserieVideoController) List() {
@@ -151,6 +152,7 @@ func (this *AskserieVideoController) List() {
 	keyWord := this.GetString("KeyWord")
 	keyWord = strings.Trim(keyWord, " ")
 	keyWord = strings.Replace(keyWord, "'", "", -1)
+	sortType := this.GetString("SortType")
 	var startSize int
 	if pageSize <= 0 {
 		pageSize = utils.PageSize20
@@ -185,7 +187,15 @@ func (this *AskserieVideoController) List() {
 		br.ErrMsg = "获取失败,Err:" + err.Error()
 		return
 	}
-	condition += "	ORDER BY art.modify_date DESC  "
+
+	var conditionOrder string
+	if sortType == "asc" || sortType == "desc" {
+		conditionOrder += ` ORDER BY art.video_counts   ` + sortType
+	} else {
+		conditionOrder += ` 	ORDER BY art.modify_date DESC  `
+	}
+	//condition += "	ORDER BY art.modify_date DESC  "
+	condition += conditionOrder
 	list, err := cygx.GetCygxAskserieVideoList(condition, pars, startSize, pageSize)
 	if err != nil {
 		br.Msg = "获取失败"