xingzai 1 ano atrás
pai
commit
f532d75da7

+ 16 - 2
controllers/cygx/yanxuan_special.go

@@ -2,7 +2,6 @@ package cygx
 
 import (
 	"encoding/json"
-	"fmt"
 	"github.com/rdlucklib/rdluck_tools/paging"
 	"github.com/tealeg/xlsx"
 	"hongze/hz_crm_api/controllers"
@@ -236,7 +235,6 @@ func (this *YanxuanSpecialController) AuthorList() {
 	} else {
 		sortStr = " ORDER BY art.create_time  DESC "
 	}
-	fmt.Println(sortStr)
 
 	total, err := cygx.GetYanxuanSpecialAuthorCount(condition, pars)
 	if err != nil {
@@ -260,6 +258,7 @@ func (this *YanxuanSpecialController) AuthorList() {
 	//获取专栏用户最新的一篇文章信息
 	mapNewTime := cygxService.GetBestNewYanxuanSpecialByUserId(userIds)
 	for _, v := range list {
+		v.SpecialAuthorId = v.Id
 		v.ArticlePublishTime = mapNewTime[v.UserId]
 	}
 	resp := new(cygx.GetCygxYanxuanSpecialAuthorItemResp)
@@ -675,6 +674,21 @@ func (this *YanxuanSpecialController) ApprovalLogList() {
 		br.ErrMsg = "获取失败, Err:" + tmpErr.Error()
 		return
 	}
+	pars = make([]interface{}, 0)
+	listAuthor, tmpErr := cygx.GetYanxuanSpecialAuthorList("", pars, 0, 999)
+	if tmpErr != nil {
+		br.Msg = "获取失败"
+		br.ErrMsg = "获取失败, Err:" + tmpErr.Error()
+		return
+	}
+	mapUserId := make(map[int]int)
+	for _, v := range listAuthor {
+		mapUserId[v.UserId] = v.Id
+	}
+
+	for _, v := range list {
+		v.SpecialAuthorId = mapUserId[v.UserId]
+	}
 
 	resp := new(cygx.CygxYanxuanSpecialApprovalLogListResp)
 	page := paging.GetPaging(currentIndex, pageSize, total)

+ 1 - 0
models/cygx/cygx_yanxuan_special_approval_log.go

@@ -48,6 +48,7 @@ type CygxYanxuanSpecialApprovalLogResp struct {
 	AdminUserId      int    // 审核人员用户ID
 	SpecialName      string // 专栏名称
 	NickName         string // 昵称
+	SpecialAuthorId  int    //cygx_yanxuan_special_author 表主键ID 作者专栏ID
 }
 
 // 获取数量

+ 1 - 0
models/cygx/cygx_yanxuan_special_user.go

@@ -47,6 +47,7 @@ type CygxYanxuanSpecialAuthorItem struct {
 	ArticlePublishTime string // 最近发布文章的时间
 	FansNum            int    // 粉丝数量
 	ArticleCollectNum  int    // 文章收藏数量
+	SpecialAuthorId    int    //cygx_yanxuan_special_author 表主键ID 作者专栏ID
 }
 
 func AddCygxYanxuanSpecialAuthor(item *CygxYanxuanSpecialAuthor) (lastId int64, err error) {