|
@@ -238,6 +238,9 @@ func (this *ResearchController) HotList() {
|
|
|
// @Title KOL榜列表
|
|
|
// @Description KOL榜列表接口
|
|
|
// @Param ChartPermissionId query int true "分类ID"
|
|
|
+// @Param PageSize query int true "每页数据条数"
|
|
|
+// @Param CurrentIndex query int true "当前页页码,从1开始"
|
|
|
+// @Param ThemeType query int true "主题类型,1关注度、2更新时间 "
|
|
|
// @Success 200 {object} models.DepartmentListResp
|
|
|
// @router /kolList [get]
|
|
|
func (this *ResearchController) KolList() {
|
|
@@ -257,8 +260,33 @@ func (this *ResearchController) KolList() {
|
|
|
// br.Msg = "请输入分类ID"
|
|
|
// return
|
|
|
//}
|
|
|
+ themeType, _ := this.GetInt("ThemeType")
|
|
|
+ pageSize, _ := this.GetInt("PageSize")
|
|
|
+ currentIndex, _ := this.GetInt("CurrentIndex")
|
|
|
+ var startSize int
|
|
|
+ if pageSize <= 0 {
|
|
|
+ pageSize = utils.PageSize15
|
|
|
+ }
|
|
|
+ if currentIndex <= 0 {
|
|
|
+ currentIndex = 1
|
|
|
+ }
|
|
|
+ startSize = utils.StartIndex(currentIndex, pageSize)
|
|
|
|
|
|
- list, err := models.GetDepartmentList(user.UserId)
|
|
|
+ total, err := models.GetDepartmentlistCount("")
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "获取失败"
|
|
|
+ br.ErrMsg = "获取失败,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ var condition string
|
|
|
+ if themeType != 2 {
|
|
|
+ condition = `ORDER BY fllow_num DESC `
|
|
|
+ } else {
|
|
|
+ condition = `ORDER BY sum_num DESC `
|
|
|
+ }
|
|
|
+
|
|
|
+ list, err := models.GetDepartmentList(condition, user.UserId, startSize, pageSize)
|
|
|
if err != nil {
|
|
|
br.Msg = "获取信息失败"
|
|
|
br.ErrMsg = "获取品种信息失败,Err:" + err.Error()
|
|
@@ -285,6 +313,8 @@ func (this *ResearchController) KolList() {
|
|
|
}
|
|
|
}
|
|
|
resp := new(models.DepartmentListResp)
|
|
|
+ page := paging.GetPaging(currentIndex, pageSize, total)
|
|
|
+ resp.Paging = page
|
|
|
resp.List = list
|
|
|
br.Ret = 200
|
|
|
br.Success = true
|