|
@@ -7,6 +7,7 @@ import (
|
|
|
"hongze/hongze_clpt/services"
|
|
|
"hongze/hongze_clpt/utils"
|
|
|
"path"
|
|
|
+ "strconv"
|
|
|
"strings"
|
|
|
"time"
|
|
|
)
|
|
@@ -132,9 +133,9 @@ func (this *YanxuanSpecialNoLoginController) List() {
|
|
|
v.TagList = []string{}
|
|
|
}
|
|
|
}
|
|
|
- isAuthor, isImproveInformation := services.GetYanxuanSpecialAuthorInfo(sysUser) //用户是否没开通研选专栏以及,专栏信息是否完善
|
|
|
- resp.IsAuthor = isAuthor
|
|
|
- resp.IsImproveInformation = isImproveInformation
|
|
|
+ specialAuthorCheck := services.GetYanxuanSpecialAuthorInfo(sysUser) //用户是否没开通研选专栏以及,专栏信息是否完善
|
|
|
+ resp.IsAuthor = specialAuthorCheck.IsAuthor
|
|
|
+ resp.IsImproveInformation = specialAuthorCheck.IsImproveInformation
|
|
|
resp.List = list
|
|
|
page := paging.GetPaging(currentIndex, pageSize, total)
|
|
|
resp.Paging = page
|
|
@@ -925,9 +926,18 @@ func (this *YanxuanSpecialNoLoginController) AuthorList() {
|
|
|
currentIndex = 1
|
|
|
}
|
|
|
startSize = utils.StartIndex(currentIndex, pageSize)
|
|
|
+ resp := new(models.SpecialAuthorListResp)
|
|
|
+ specialAuthorCheck := services.GetYanxuanSpecialAuthorInfo(sysUser) //用户是否没开通研选专栏以及,专栏信息是否完善
|
|
|
+ resp.IsAuthor = specialAuthorCheck.IsAuthor
|
|
|
+ resp.IsImproveInformation = specialAuthorCheck.IsImproveInformation
|
|
|
+ resp.SpecialColumnId = specialAuthorCheck.SpecialColumnId
|
|
|
+ resp.HeadImg = specialAuthorCheck.HeadImg
|
|
|
+
|
|
|
var condition string
|
|
|
+ var conditionUserSort string
|
|
|
var pars []interface{}
|
|
|
condition += ` AND a.nick_name <> '' `
|
|
|
+ conditionUserSort += ` ( IF ( a.user_id = ` + strconv.Itoa(sysUser.UserId) + `, 1 = 1, user_id = 1 ) ) AS user_sort , ` // 用户本人如果开通了专栏,就放在最前面
|
|
|
|
|
|
total, err := models.GetCygxYanxuanSpecialAuthorCount(condition, pars)
|
|
|
if err != nil {
|
|
@@ -935,8 +945,8 @@ func (this *YanxuanSpecialNoLoginController) AuthorList() {
|
|
|
br.ErrMsg = "获取失败,Err:" + err.Error()
|
|
|
return
|
|
|
}
|
|
|
- condition += ` ORDER BY latest_publish_time DESC`
|
|
|
- list, tmpErr := models.GetYanxuanSpecialAuthorList(condition, pars, startSize, pageSize)
|
|
|
+ condition += ` ORDER BY user_sort DESC, latest_publish_time DESC`
|
|
|
+ list, tmpErr := models.GetYanxuanSpecialAuthorList(conditionUserSort, condition, pars, startSize, pageSize)
|
|
|
if tmpErr != nil {
|
|
|
br.Msg = "获取失败"
|
|
|
br.ErrMsg = "获取失败, Err:" + tmpErr.Error()
|
|
@@ -949,14 +959,6 @@ func (this *YanxuanSpecialNoLoginController) AuthorList() {
|
|
|
//userIds = append(userIds, v.UserId)
|
|
|
}
|
|
|
|
|
|
- //bestNew := services.GetBestNewYanxuanSpecialByUserId(userIds)
|
|
|
- //for _, v := range list {
|
|
|
- // v.YanxuanSpecialCenter = bestNew[v.UserId]
|
|
|
- //}
|
|
|
- resp := new(models.SpecialAuthorListResp)
|
|
|
- isAuthor, isImproveInformation := services.GetYanxuanSpecialAuthorInfo(sysUser) //用户是否没开通研选专栏以及,专栏信息是否完善
|
|
|
- resp.IsAuthor = isAuthor
|
|
|
- resp.IsImproveInformation = isImproveInformation
|
|
|
page := paging.GetPaging(currentIndex, pageSize, total)
|
|
|
resp.List = list
|
|
|
resp.Paging = page
|