소스 검색

用户阅读数据更新排序

xingzai 2 년 전
부모
커밋
9a985a42a7
2개의 변경된 파일5개의 추가작업 그리고 3개의 파일을 삭제
  1. 1 1
      models/send_company_user.go
  2. 4 2
      services/wx_user.go

+ 1 - 1
models/send_company_user.go

@@ -233,7 +233,7 @@ func GetWxUserOpLog(createTime string) (items []*WxUserOpLogResp, err error) {
 //获取指定时间内被移动的用户
 func GetWxUserOpLogList(createTime string) (items []*WxUserOpLogResp, err error) {
 	o := orm.NewOrm()
-	sql := ` SELECT company_id,user_id,mobile FROM wx_user_op_log WHERE  log_type IN ('move') AND create_time >=  '` + createTime + `' AND company_id > 1 GROUP BY user_id `
+	sql := ` SELECT company_id,user_id,mobile FROM wx_user_op_log WHERE  log_type IN ('move','add') AND create_time >=  '` + createTime + `' AND company_id > 1 GROUP BY user_id `
 	_, err = o.Raw(sql).QueryRows(&items)
 	return
 }

+ 4 - 2
services/wx_user.go

@@ -35,6 +35,7 @@ func UpdateWxUserLabel(cont context.Context) (err error) {
 		for _, vUser := range listUser {
 			if vUser.Mobile != "" {
 				mobile := vUser.Mobile
+				fmt.Println(vUser.Mobile)
 				chartMobile += mobile + ","
 				listChart, _, _ := GetChartCollectionByApi(mobile, 9999, 0)
 				if len(listChart) > 0 {
@@ -150,6 +151,7 @@ func UpdateWxUserLabel(cont context.Context) (err error) {
 					}
 				}
 			}
+
 			//修改用户产业关注的产业end
 
 			//修改用户的阅读记录
@@ -248,7 +250,7 @@ func UpdateWxUserLabel(cont context.Context) (err error) {
 		}
 	}
 
-	// 处理用户标签
+	//处理用户标签
 	for _, vUser := range listUser {
 		labels, err := models.GetCygxCompanyUserListSplit(strconv.Itoa(vUser.UserId))
 		if err != nil {
@@ -455,7 +457,7 @@ func UpdateWxUserLabel(cont context.Context) (err error) {
 
 							itemInteraction := new(models.CygxUserInteractionNum)
 							itemInteraction.UserId = int(vsplit.UserId)
-							itemInteraction.ArticleCountNum = vsplit.HistoryNum
+							itemInteraction.ArticleHistoryNum = vsplit.HistoryNum
 							itemInteraction.ArticleCountNum = vsplit.CountNum
 							itemInteraction.ChartCountNum = vsplit.ChartCountNum
 							itemInteraction.IndustryFllowNum = vsplit.IndustryFllowNum