xingzai преди 1 година
родител
ревизия
0b3bc5bef1
променени са 4 файла, в които са добавени 12 реда и са изтрити 9 реда
  1. 1 1
      controllers/cygx/user.go
  2. 5 5
      controllers/cygx/yanxuan_special.go
  3. 4 2
      models/cygx/cygx_user.go
  4. 2 1
      models/cygx/cygx_yanxuan_special.go

+ 1 - 1
controllers/cygx/user.go

@@ -617,7 +617,7 @@ func (this *UserController) TableList() {
 		return
 	}
 
-	List := []*cygx.CygxUserTableRep{{PermissionName: "报告阅读列表", Source: 1, TotalNum: countDetail.HistoryNum},
+	List := []*cygx.CygxUserTableRep{{PermissionName: "报告阅读列表", Source: 1, TotalNum: countDetail.HistoryNum + countDetail.YanxuanSpecialNum},
 		{PermissionName: "活动互动记录", Source: 2, TotalNum: countDetail.OnLineNum + countDetail.OfficeNum},
 		{PermissionName: "专项调研", Source: 8, TotalNum: countDetail.TripNum},
 		{PermissionName: "收藏的报告", Source: 3, TotalNum: countDetail.CountNum},

+ 5 - 5
controllers/cygx/yanxuan_special.go

@@ -214,7 +214,7 @@ func (this *YanxuanSpecialController) AuthorList() {
 			}
 		}
 
-		if sortParam == "articleNum" {
+		if sortParam == "ArticleNum" {
 			if sortType == "asc" {
 				sortStr = " ORDER BY art.article_num ASC "
 			} else {
@@ -222,7 +222,7 @@ func (this *YanxuanSpecialController) AuthorList() {
 			}
 		}
 
-		if sortParam == "Pv" {
+		if sortParam == "pv" {
 			if sortType == "asc" {
 				sortStr = " ORDER BY art.pv ASC "
 			} else {
@@ -287,7 +287,7 @@ func (this *YanxuanSpecialController) List() {
 	pageSize, _ := this.GetInt("PageSize")
 	currentIndex, _ := this.GetInt("CurrentIndex")
 	status, _ := this.GetInt("Status", 1)
-	specialType, _ := this.GetInt("Type", 1)
+	specialType, _ := this.GetInt("Type")
 	keyWord := this.GetString("KeyWord")
 	//排序参数
 	sortParam := this.GetString("SortParam")
@@ -340,7 +340,7 @@ func (this *YanxuanSpecialController) List() {
 	//排序字段以及排序方式处理
 	var sortStr string
 	if sortParam != "" && sortType != "" {
-		if sortParam == "Pv" {
+		if sortParam == "pv" {
 			if sortType == "asc" {
 				sortStr = " ORDER BY a.pv ASC "
 			} else {
@@ -649,7 +649,7 @@ func (this *YanxuanSpecialController) ApprovalLogList() {
 		br.ErrMsg = "获取失败,Err:" + err.Error()
 		return
 	}
-
+	condition += ` ORDER BY  create_time DESC `
 	list, tmpErr := cygx.GetCygxYanxuanSpecialApprovalLogList(condition, pars, startSize, pageSize)
 	if tmpErr != nil {
 		br.Msg = "获取失败"

+ 4 - 2
models/cygx/cygx_user.go

@@ -915,6 +915,7 @@ type GetUserInteractionTableCountResp struct {
 	ActivityVideoNum    int `description:"活动视频播放量"`
 	ActivityVoiceNum    int `description:"活动音频播放量"`
 	TagNum              int `description:"首页标签点击量"`
+	YanxuanSpecialNum   int `description:"研选专栏阅读数量"`
 }
 
 // 用户互动总数统计
@@ -935,9 +936,10 @@ func GetUserInteractionTableCount(uid int) (item *GetUserInteractionTableCountRe
 			( SELECT COUNT( 1 ) FROM cygx_micro_roadshow_video_history AS h  INNER JOIN cygx_micro_roadshow_video as v ON v.video_id = h.video_id WHERE  h.user_id = ?  ) AS roadshow_video_num,
 			( SELECT COUNT( 1 ) FROM cygx_activity_video_history AS h  INNER JOIN cygx_activity_video as v ON v.video_id = h.video_id WHERE  h.user_id = ?  ) AS activity_video_num,
 			( SELECT COUNT( 1 ) FROM cygx_activity_voice_history AS h  INNER JOIN cygx_activity_voice as v ON v.activity_id = h.activity_id WHERE  h.user_id = ?  ) AS activity_voice_num,
-			( SELECT COUNT(1) FROM cygx_tag_history as h INNER JOIN cygx_tag AS b ON h.tag_id = b.tag_id WHERE h.user_id = ?  ) AS tag_num
+			( SELECT COUNT(1) FROM cygx_tag_history as h INNER JOIN cygx_tag AS b ON h.tag_id = b.tag_id WHERE h.user_id = ?  ) AS tag_num,
+			( SELECT COUNT(1) FROM cygx_yanxuan_special_record as h INNER JOIN cygx_yanxuan_special AS b ON h.yanxuan_special_id = b.id WHERE h.user_id = ?  ) AS yanxuan_special_num
 			FROM  dual `
-	err = o.Raw(sql, uid, uid, uid, uid, uid, uid, uid, uid, uid, uid, uid, uid, uid).QueryRow(&item)
+	err = o.Raw(sql, uid, uid, uid, uid, uid, uid, uid, uid, uid, uid, uid, uid, uid, uid).QueryRow(&item)
 	return
 }
 

+ 2 - 1
models/cygx/cygx_yanxuan_special.go

@@ -70,7 +70,8 @@ type GetCygxYanxuanSpeciaResplItemResp struct {
 // 获取数量
 func GetGetYanxuanSpecialCount(condition string, pars []interface{}) (count int, err error) {
 	o := orm.NewOrmUsingDB("hz_cygx")
-	sqlCount := ` SELECT COUNT(1) AS count  FROM cygx_yanxuan_special as a WHERE 1= 1  `
+	sqlCount := ` SELECT COUNT(1) AS count  FROM cygx_yanxuan_special as a 
+				JOIN cygx_yanxuan_special_author AS b ON a.user_id = b.user_id  WHERE 1= 1  `
 	if condition != "" {
 		sqlCount += condition
 	}