|
@@ -74,263 +74,264 @@ func UpdateWxUserLabel(cont context.Context) (err error) {
|
|
|
|
|
|
//处理图表关注后的用户
|
|
|
{
|
|
|
-
|
|
|
- listChartCollect, err := models.GetCygxChartCollectByMobileList()
|
|
|
- if err != nil {
|
|
|
- fmt.Println("GetCygxChartCollectByMobileList ,Err" + err.Error())
|
|
|
- }
|
|
|
- for k, v := range listChartCollect {
|
|
|
- if v.Mobile != "" {
|
|
|
- user, err := models.GetWxUserItemByMobile(v.Mobile)
|
|
|
- if err != nil && err.Error() != utils.ErrNoRow() {
|
|
|
- fmt.Println("GetWxUserItemByUserId ,Err" + err.Error())
|
|
|
- }
|
|
|
- if user != nil {
|
|
|
- fmt.Println(user.RealName, k)
|
|
|
- err = models.UpdateCygxChartCollect(user)
|
|
|
- if err != nil {
|
|
|
- fmt.Println("UpdateCygxChartCollect ,Err" + err.Error())
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- //处理 前一天移动之后的用户的公司记录信息
|
|
|
-
|
|
|
- {
|
|
|
- startDate := time.Now().AddDate(0, 0, -1).Format(utils.FormatDate)
|
|
|
- endDate := time.Now().Format(utils.FormatDate)
|
|
|
- listUpdateUser, err := models.GetWxUserOpLogList(startDate, endDate)
|
|
|
- if err != nil && err.Error() != utils.ErrNoRow() {
|
|
|
- return err
|
|
|
- }
|
|
|
- var userIds string
|
|
|
- var mobiles string
|
|
|
- if len(listUpdateUser) > 0 {
|
|
|
- for _, v := range listUpdateUser {
|
|
|
- userIds += strconv.Itoa(v.UserId) + ","
|
|
|
- mobiles += "'" + v.Mobile + "',"
|
|
|
- }
|
|
|
- }
|
|
|
- userIds = strings.TrimRight(userIds, ",")
|
|
|
- mobiles = strings.TrimRight(mobiles, ",")
|
|
|
-
|
|
|
- //如果用户ID不为空那么就处理这些用户的记录信息
|
|
|
- if userIds != "" {
|
|
|
- var condition string
|
|
|
- //condition = ` AND user_id IN (` + userIds + `)`
|
|
|
- condition = ` AND mobile IN (` + mobiles + `)`
|
|
|
- //处理用户的文章收藏
|
|
|
- listCollect, err := models.GetCygxArticleCollectList(condition)
|
|
|
- if err != nil && err.Error() != utils.ErrNoRow() {
|
|
|
- fmt.Println("GetAddCygxArticleCollectList ,Err" + err.Error())
|
|
|
- }
|
|
|
- if len(listCollect) > 0 {
|
|
|
- for _, v := range listCollect {
|
|
|
- user, err := models.GetWxUserItemByUserId(v.UserId)
|
|
|
- if err != nil && err.Error() != utils.ErrNoRow() {
|
|
|
- fmt.Println("GetWxUserItemByUserId ,Err" + err.Error())
|
|
|
- }
|
|
|
- if user != nil {
|
|
|
- fmt.Println(user.RealName)
|
|
|
- err = models.UpdateCygxArticleCollect(user)
|
|
|
- if err != nil {
|
|
|
- fmt.Println("UpdateCygxArticleCollect ,Err" + err.Error())
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- //处理用户的文章收藏 end
|
|
|
-
|
|
|
- //修改用户关注的产业
|
|
|
- listIndustryFllow, err := models.GetCygxIndustryFllowList(condition)
|
|
|
- if err != nil {
|
|
|
- fmt.Println("GetCygxIndustryFllowList ,Err" + err.Error())
|
|
|
- }
|
|
|
- for k, v := range listIndustryFllow {
|
|
|
- if v.Mobile != "" {
|
|
|
- user, err := models.GetWxUserItemByUserId(v.UserId)
|
|
|
- if err != nil && err.Error() != utils.ErrNoRow() {
|
|
|
- fmt.Println("GetWxUserItemByUserId ,Err" + err.Error())
|
|
|
- }
|
|
|
- if user != nil {
|
|
|
- fmt.Println(user.RealName, k)
|
|
|
- err = models.UpdateCygxIndustryFllow(user)
|
|
|
- if err != nil {
|
|
|
- fmt.Println("UpdateCygxIndustryFllow ,Err" + err.Error())
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- //修改用户产业关注的产业end
|
|
|
-
|
|
|
- //修改用户的阅读记录
|
|
|
- listArticlePv, err := models.GetArticleHistoryRecordAllByMobileList(condition)
|
|
|
- if err != nil {
|
|
|
- fmt.Println("GetArticleHistoryRecordAllByMobileList ,Err" + err.Error())
|
|
|
- }
|
|
|
- for k, v := range listArticlePv {
|
|
|
- if v.Mobile != "" {
|
|
|
- user, err := models.GetWxUserItemByMobile(v.Mobile)
|
|
|
- if err != nil && err.Error() != utils.ErrNoRow() {
|
|
|
- fmt.Println("GetWxUserItemByUserId ,Err" + err.Error())
|
|
|
- }
|
|
|
- if user != nil {
|
|
|
- fmt.Println(user.RealName, k)
|
|
|
- err = models.UpdateCygxArticleHistoryRecordAll(user)
|
|
|
- if err != nil {
|
|
|
- fmt.Println("UpdateCygxArticleCollect ,Err" + err.Error())
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- //修改用户的阅读记录end
|
|
|
-
|
|
|
- //处理用户的搜索记录
|
|
|
- listSearch, err := models.GetCygxSearchKeyWordList(condition)
|
|
|
- if err != nil {
|
|
|
- fmt.Println("GetArticleHistoryRecordAllByMobileList ,Err" + err.Error())
|
|
|
- }
|
|
|
-
|
|
|
- for k, v := range listSearch {
|
|
|
- if v.Mobile != "" {
|
|
|
- user, err := models.GetWxUserItemByUserId(v.UserId)
|
|
|
- if err != nil && err.Error() != utils.ErrNoRow() {
|
|
|
- fmt.Println("GetWxUserItemByUserId ,Err" + err.Error())
|
|
|
- }
|
|
|
- if user != nil {
|
|
|
- fmt.Println(user.RealName, k)
|
|
|
- err = models.UpdateCygxSearchKeyWord(user)
|
|
|
- if err != nil {
|
|
|
- fmt.Println("UpdateCygxSearchKeyWord ,Err" + err.Error())
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- // 处理用户的作者关注
|
|
|
- lisDepartmentF, err := models.GetArticleDepartmentFollowByMobileList(condition)
|
|
|
- if err != nil {
|
|
|
- fmt.Println("GetArticleDepartmentFollowByMobileList ,Err" + err.Error())
|
|
|
- return err
|
|
|
- }
|
|
|
- for k, v := range lisDepartmentF {
|
|
|
- if v.Mobile != "" {
|
|
|
- user, err := models.GetWxUserItemByUserId(v.UserId)
|
|
|
- if err != nil && err.Error() != utils.ErrNoRow() {
|
|
|
- fmt.Println("GetWxUserItemByUserId ,Err" + err.Error())
|
|
|
- }
|
|
|
- if user != nil {
|
|
|
- fmt.Println(user.RealName, k)
|
|
|
- err = models.UpdateCygxArticleDepartmentFollow(user)
|
|
|
- if err != nil {
|
|
|
- fmt.Println("UpdateCygxArticleDepartmentFollow ,Err" + err.Error())
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- // 处理用户的作者关注end
|
|
|
-
|
|
|
- // 处理用户的活动视频播放
|
|
|
- listActivityVideo, err := models.GetActivityVideoHistoryByMobileList(condition)
|
|
|
- if err != nil {
|
|
|
- fmt.Println("GetArticleDepartmentFollowByMobileList ,Err" + err.Error())
|
|
|
- return err
|
|
|
- }
|
|
|
- for k, v := range listActivityVideo {
|
|
|
- if v.Mobile != "" {
|
|
|
- user, err := models.GetWxUserItemByUserId(v.UserId)
|
|
|
- if err != nil && err.Error() != utils.ErrNoRow() {
|
|
|
- fmt.Println("GetWxUserItemByUserId ,Err" + err.Error())
|
|
|
- }
|
|
|
- if user != nil {
|
|
|
- fmt.Println(user.RealName, k)
|
|
|
- err = models.UpdateCygxActivityVideoHistory(user)
|
|
|
- if err != nil {
|
|
|
- fmt.Println("UpdateCygxActivityVideoHistory ,Err" + err.Error())
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- // 处理用户的活动视频播放end
|
|
|
-
|
|
|
- // 处理用户的活动音频播放
|
|
|
- listActivityVoice, err := models.GetActivityVoiceHistoryByMobileList(condition)
|
|
|
- if err != nil {
|
|
|
- fmt.Println("GetActivityVoiceHistoryByMobileList ,Err" + err.Error())
|
|
|
- return err
|
|
|
- }
|
|
|
- for k, v := range listActivityVoice {
|
|
|
- if v.Mobile != "" {
|
|
|
- user, err := models.GetWxUserItemByUserId(v.UserId)
|
|
|
- if err != nil && err.Error() != utils.ErrNoRow() {
|
|
|
- fmt.Println("GetWxUserItemByUserId ,Err" + err.Error())
|
|
|
- }
|
|
|
- if user != nil {
|
|
|
- fmt.Println(user.RealName, k)
|
|
|
- err = models.UpdateCygxActivityVoiceHistory(user)
|
|
|
- if err != nil {
|
|
|
- fmt.Println("UpdateCygxActivityVoiceHistory ,Err" + err.Error())
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- // 处理用户的活动音频播放end
|
|
|
-
|
|
|
- // 处理用户产业视频的播放记录
|
|
|
- listMicroRoadshow, err := models.GetMicroRoadshowVideoHistoryByMobileList(condition)
|
|
|
- if err != nil {
|
|
|
- fmt.Println("GetMicroRoadshowVideoHistoryByMobileList ,Err" + err.Error())
|
|
|
- return err
|
|
|
- }
|
|
|
- for k, v := range listMicroRoadshow {
|
|
|
- if v.Mobile != "" {
|
|
|
- user, err := models.GetWxUserItemByUserId(v.UserId)
|
|
|
- if err != nil && err.Error() != utils.ErrNoRow() {
|
|
|
- fmt.Println("GetWxUserItemByUserId ,Err" + err.Error())
|
|
|
- }
|
|
|
- if user != nil {
|
|
|
- fmt.Println(user.RealName, k)
|
|
|
- err = models.UpdateCygxMicroRoadshowVideoHistory(user)
|
|
|
- if err != nil {
|
|
|
- fmt.Println("UpdateCygxMicroRoadshowVideoHistory ,Err" + err.Error())
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- // 处理用户产业视频的播放记录 end
|
|
|
-
|
|
|
- //如果手机号不为空,则更新用户的报名信息
|
|
|
- if mobiles != "" {
|
|
|
- condition = ` AND mobile IN (` + mobiles + `)`
|
|
|
- listSingUp, err := models.GetCygxActivitySignupByMobileList(condition)
|
|
|
+ if utils.RunMode == "release" {
|
|
|
+ listChartCollect, err := models.GetCygxChartCollectByMobileList()
|
|
|
if err != nil {
|
|
|
fmt.Println("GetCygxChartCollectByMobileList ,Err" + err.Error())
|
|
|
}
|
|
|
- //fmt.Println("更新用户的报名信息长度", len(listSingUp))
|
|
|
- for _, v := range listSingUp {
|
|
|
+ for k, v := range listChartCollect {
|
|
|
if v.Mobile != "" {
|
|
|
user, err := models.GetWxUserItemByMobile(v.Mobile)
|
|
|
if err != nil && err.Error() != utils.ErrNoRow() {
|
|
|
fmt.Println("GetWxUserItemByUserId ,Err" + err.Error())
|
|
|
}
|
|
|
if user != nil {
|
|
|
- err = models.UpdateCygxActivitySignup(user)
|
|
|
+ fmt.Println(user.RealName, k)
|
|
|
+ err = models.UpdateCygxChartCollect(user)
|
|
|
if err != nil {
|
|
|
- fmt.Println("UpdateCygxActivitySignup ,Err" + err.Error())
|
|
|
- //return err
|
|
|
+ fmt.Println("UpdateCygxChartCollect ,Err" + err.Error())
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ //处理 前一天移动之后的用户的公司记录信息
|
|
|
+
|
|
|
+ //{
|
|
|
+ // startDate := time.Now().AddDate(0, 0, -1).Format(utils.FormatDate)
|
|
|
+ // endDate := time.Now().Format(utils.FormatDate)
|
|
|
+ // listUpdateUser, err := models.GetWxUserOpLogList(startDate, endDate)
|
|
|
+ // if err != nil && err.Error() != utils.ErrNoRow() {
|
|
|
+ // return err
|
|
|
+ // }
|
|
|
+ // var userIds string
|
|
|
+ // var mobiles string
|
|
|
+ // if len(listUpdateUser) > 0 {
|
|
|
+ // for _, v := range listUpdateUser {
|
|
|
+ // userIds += strconv.Itoa(v.UserId) + ","
|
|
|
+ // mobiles += "'" + v.Mobile + "',"
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // userIds = strings.TrimRight(userIds, ",")
|
|
|
+ // mobiles = strings.TrimRight(mobiles, ",")
|
|
|
+ //
|
|
|
+ // //如果用户ID不为空那么就处理这些用户的记录信息
|
|
|
+ // if userIds != "" {
|
|
|
+ // var condition string
|
|
|
+ // //condition = ` AND user_id IN (` + userIds + `)`
|
|
|
+ // condition = ` AND mobile IN (` + mobiles + `)`
|
|
|
+ // //处理用户的文章收藏
|
|
|
+ // listCollect, err := models.GetCygxArticleCollectList(condition)
|
|
|
+ // if err != nil && err.Error() != utils.ErrNoRow() {
|
|
|
+ // fmt.Println("GetAddCygxArticleCollectList ,Err" + err.Error())
|
|
|
+ // }
|
|
|
+ // if len(listCollect) > 0 {
|
|
|
+ // for _, v := range listCollect {
|
|
|
+ // user, err := models.GetWxUserItemByUserId(v.UserId)
|
|
|
+ // if err != nil && err.Error() != utils.ErrNoRow() {
|
|
|
+ // fmt.Println("GetWxUserItemByUserId ,Err" + err.Error())
|
|
|
+ // }
|
|
|
+ // if user != nil {
|
|
|
+ // fmt.Println(user.RealName)
|
|
|
+ // err = models.UpdateCygxArticleCollect(user)
|
|
|
+ // if err != nil {
|
|
|
+ // fmt.Println("UpdateCygxArticleCollect ,Err" + err.Error())
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // //处理用户的文章收藏 end
|
|
|
+ //
|
|
|
+ // //修改用户关注的产业
|
|
|
+ // listIndustryFllow, err := models.GetCygxIndustryFllowList(condition)
|
|
|
+ // if err != nil {
|
|
|
+ // fmt.Println("GetCygxIndustryFllowList ,Err" + err.Error())
|
|
|
+ // }
|
|
|
+ // for k, v := range listIndustryFllow {
|
|
|
+ // if v.Mobile != "" {
|
|
|
+ // user, err := models.GetWxUserItemByUserId(v.UserId)
|
|
|
+ // if err != nil && err.Error() != utils.ErrNoRow() {
|
|
|
+ // fmt.Println("GetWxUserItemByUserId ,Err" + err.Error())
|
|
|
+ // }
|
|
|
+ // if user != nil {
|
|
|
+ // fmt.Println(user.RealName, k)
|
|
|
+ // err = models.UpdateCygxIndustryFllow(user)
|
|
|
+ // if err != nil {
|
|
|
+ // fmt.Println("UpdateCygxIndustryFllow ,Err" + err.Error())
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ //
|
|
|
+ // //修改用户产业关注的产业end
|
|
|
+ //
|
|
|
+ // //修改用户的阅读记录
|
|
|
+ // listArticlePv, err := models.GetArticleHistoryRecordAllByMobileList(condition)
|
|
|
+ // if err != nil {
|
|
|
+ // fmt.Println("GetArticleHistoryRecordAllByMobileList ,Err" + err.Error())
|
|
|
+ // }
|
|
|
+ // for k, v := range listArticlePv {
|
|
|
+ // if v.Mobile != "" {
|
|
|
+ // user, err := models.GetWxUserItemByMobile(v.Mobile)
|
|
|
+ // if err != nil && err.Error() != utils.ErrNoRow() {
|
|
|
+ // fmt.Println("GetWxUserItemByUserId ,Err" + err.Error())
|
|
|
+ // }
|
|
|
+ // if user != nil {
|
|
|
+ // fmt.Println(user.RealName, k)
|
|
|
+ // err = models.UpdateCygxArticleHistoryRecordAll(user)
|
|
|
+ // if err != nil {
|
|
|
+ // fmt.Println("UpdateCygxArticleCollect ,Err" + err.Error())
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // //修改用户的阅读记录end
|
|
|
+ //
|
|
|
+ // //处理用户的搜索记录
|
|
|
+ // listSearch, err := models.GetCygxSearchKeyWordList(condition)
|
|
|
+ // if err != nil {
|
|
|
+ // fmt.Println("GetArticleHistoryRecordAllByMobileList ,Err" + err.Error())
|
|
|
+ // }
|
|
|
+ //
|
|
|
+ // for k, v := range listSearch {
|
|
|
+ // if v.Mobile != "" {
|
|
|
+ // user, err := models.GetWxUserItemByUserId(v.UserId)
|
|
|
+ // if err != nil && err.Error() != utils.ErrNoRow() {
|
|
|
+ // fmt.Println("GetWxUserItemByUserId ,Err" + err.Error())
|
|
|
+ // }
|
|
|
+ // if user != nil {
|
|
|
+ // fmt.Println(user.RealName, k)
|
|
|
+ // err = models.UpdateCygxSearchKeyWord(user)
|
|
|
+ // if err != nil {
|
|
|
+ // fmt.Println("UpdateCygxSearchKeyWord ,Err" + err.Error())
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ //
|
|
|
+ // // 处理用户的作者关注
|
|
|
+ // lisDepartmentF, err := models.GetArticleDepartmentFollowByMobileList(condition)
|
|
|
+ // if err != nil {
|
|
|
+ // fmt.Println("GetArticleDepartmentFollowByMobileList ,Err" + err.Error())
|
|
|
+ // return err
|
|
|
+ // }
|
|
|
+ // for k, v := range lisDepartmentF {
|
|
|
+ // if v.Mobile != "" {
|
|
|
+ // user, err := models.GetWxUserItemByUserId(v.UserId)
|
|
|
+ // if err != nil && err.Error() != utils.ErrNoRow() {
|
|
|
+ // fmt.Println("GetWxUserItemByUserId ,Err" + err.Error())
|
|
|
+ // }
|
|
|
+ // if user != nil {
|
|
|
+ // fmt.Println(user.RealName, k)
|
|
|
+ // err = models.UpdateCygxArticleDepartmentFollow(user)
|
|
|
+ // if err != nil {
|
|
|
+ // fmt.Println("UpdateCygxArticleDepartmentFollow ,Err" + err.Error())
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // // 处理用户的作者关注end
|
|
|
+ //
|
|
|
+ // // 处理用户的活动视频播放
|
|
|
+ // listActivityVideo, err := models.GetActivityVideoHistoryByMobileList(condition)
|
|
|
+ // if err != nil {
|
|
|
+ // fmt.Println("GetArticleDepartmentFollowByMobileList ,Err" + err.Error())
|
|
|
+ // return err
|
|
|
+ // }
|
|
|
+ // for k, v := range listActivityVideo {
|
|
|
+ // if v.Mobile != "" {
|
|
|
+ // user, err := models.GetWxUserItemByUserId(v.UserId)
|
|
|
+ // if err != nil && err.Error() != utils.ErrNoRow() {
|
|
|
+ // fmt.Println("GetWxUserItemByUserId ,Err" + err.Error())
|
|
|
+ // }
|
|
|
+ // if user != nil {
|
|
|
+ // fmt.Println(user.RealName, k)
|
|
|
+ // err = models.UpdateCygxActivityVideoHistory(user)
|
|
|
+ // if err != nil {
|
|
|
+ // fmt.Println("UpdateCygxActivityVideoHistory ,Err" + err.Error())
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // // 处理用户的活动视频播放end
|
|
|
+ //
|
|
|
+ // // 处理用户的活动音频播放
|
|
|
+ // listActivityVoice, err := models.GetActivityVoiceHistoryByMobileList(condition)
|
|
|
+ // if err != nil {
|
|
|
+ // fmt.Println("GetActivityVoiceHistoryByMobileList ,Err" + err.Error())
|
|
|
+ // return err
|
|
|
+ // }
|
|
|
+ // for k, v := range listActivityVoice {
|
|
|
+ // if v.Mobile != "" {
|
|
|
+ // user, err := models.GetWxUserItemByUserId(v.UserId)
|
|
|
+ // if err != nil && err.Error() != utils.ErrNoRow() {
|
|
|
+ // fmt.Println("GetWxUserItemByUserId ,Err" + err.Error())
|
|
|
+ // }
|
|
|
+ // if user != nil {
|
|
|
+ // fmt.Println(user.RealName, k)
|
|
|
+ // err = models.UpdateCygxActivityVoiceHistory(user)
|
|
|
+ // if err != nil {
|
|
|
+ // fmt.Println("UpdateCygxActivityVoiceHistory ,Err" + err.Error())
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // // 处理用户的活动音频播放end
|
|
|
+ //
|
|
|
+ // // 处理用户产业视频的播放记录
|
|
|
+ // listMicroRoadshow, err := models.GetMicroRoadshowVideoHistoryByMobileList(condition)
|
|
|
+ // if err != nil {
|
|
|
+ // fmt.Println("GetMicroRoadshowVideoHistoryByMobileList ,Err" + err.Error())
|
|
|
+ // return err
|
|
|
+ // }
|
|
|
+ // for k, v := range listMicroRoadshow {
|
|
|
+ // if v.Mobile != "" {
|
|
|
+ // user, err := models.GetWxUserItemByUserId(v.UserId)
|
|
|
+ // if err != nil && err.Error() != utils.ErrNoRow() {
|
|
|
+ // fmt.Println("GetWxUserItemByUserId ,Err" + err.Error())
|
|
|
+ // }
|
|
|
+ // if user != nil {
|
|
|
+ // fmt.Println(user.RealName, k)
|
|
|
+ // err = models.UpdateCygxMicroRoadshowVideoHistory(user)
|
|
|
+ // if err != nil {
|
|
|
+ // fmt.Println("UpdateCygxMicroRoadshowVideoHistory ,Err" + err.Error())
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // // 处理用户产业视频的播放记录 end
|
|
|
+ //
|
|
|
+ // //如果手机号不为空,则更新用户的报名信息
|
|
|
+ // if mobiles != "" {
|
|
|
+ // condition = ` AND mobile IN (` + mobiles + `)`
|
|
|
+ // listSingUp, err := models.GetCygxActivitySignupByMobileList(condition)
|
|
|
+ // if err != nil {
|
|
|
+ // fmt.Println("GetCygxChartCollectByMobileList ,Err" + err.Error())
|
|
|
+ // }
|
|
|
+ // //fmt.Println("更新用户的报名信息长度", len(listSingUp))
|
|
|
+ // for _, v := range listSingUp {
|
|
|
+ // if v.Mobile != "" {
|
|
|
+ // user, err := models.GetWxUserItemByMobile(v.Mobile)
|
|
|
+ // if err != nil && err.Error() != utils.ErrNoRow() {
|
|
|
+ // fmt.Println("GetWxUserItemByUserId ,Err" + err.Error())
|
|
|
+ // }
|
|
|
+ // if user != nil {
|
|
|
+ // err = models.UpdateCygxActivitySignup(user)
|
|
|
+ // if err != nil {
|
|
|
+ // fmt.Println("UpdateCygxActivitySignup ,Err" + err.Error())
|
|
|
+ // //return err
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ //
|
|
|
+ // }
|
|
|
+ //}
|
|
|
+
|
|
|
//处理用户标签
|
|
|
//for _, vUser := range listUser {
|
|
|
// labels, err := models.GetCygxCompanyUserListSplit(strconv.Itoa(vUser.UserId))
|
|
@@ -504,6 +505,8 @@ func UpdateWxUserLabel(cont context.Context) (err error) {
|
|
|
mapUserInteraction := make(map[int]int)
|
|
|
mapCompanyInteraction := make(map[int]int)
|
|
|
mapCompanyInteractionItem := make(map[int]*models.CygxCompanyInteractionNum)
|
|
|
+ mapComapnyInteractionSeller := make(map[int]int)
|
|
|
+ mapComapnyInteractionNumSeller := make(map[int]int) // 销售可查看的互动量
|
|
|
//获取已经处理记录的用户并记录切片
|
|
|
listUserInteractionNum, err := models.GetCygxUserInteractionNumList()
|
|
|
if err != nil && err.Error() != utils.ErrNoRow() {
|
|
@@ -514,6 +517,16 @@ func UpdateWxUserLabel(cont context.Context) (err error) {
|
|
|
mapUserInteraction[v.UserId] = v.UserId
|
|
|
}
|
|
|
|
|
|
+ //获取跟销售建立绑定关系的用户并记录切片
|
|
|
+ listUserSeller, err := models.GetUserSellerRelationUserList()
|
|
|
+ if err != nil && err.Error() != utils.ErrNoRow() {
|
|
|
+ fmt.Println("GetUserSellerRelationUserList Err", err)
|
|
|
+ return err
|
|
|
+ }
|
|
|
+ for _, v := range listUserSeller {
|
|
|
+ mapComapnyInteractionSeller[v.UserId] = v.UserId
|
|
|
+ }
|
|
|
+
|
|
|
listCompanyInteractionNum, err := models.GetCygxCompanyInteractionNumList()
|
|
|
if err != nil && err.Error() != utils.ErrNoRow() {
|
|
|
fmt.Println("GetCygxUserInteractionNumList Err", err)
|
|
@@ -648,6 +661,10 @@ func UpdateWxUserLabel(cont context.Context) (err error) {
|
|
|
}
|
|
|
mapComapnyInteractionNum[vsplit.CompanyId] += interactionNum
|
|
|
|
|
|
+ if mapComapnyInteractionSeller[int(vsplit.UserId)] > 0 {
|
|
|
+ mapComapnyInteractionNumSeller[vsplit.CompanyId] += interactionNum //如果销售可以看到这个人,那么就对销售可见的数量进行添加
|
|
|
+ }
|
|
|
+
|
|
|
itemInteraction := new(models.CygxUserInteractionNum)
|
|
|
itemInteraction.UserId = int(vsplit.UserId)
|
|
|
itemInteraction.ArticleHistoryNum = vsplit.HistoryNum
|
|
@@ -723,12 +740,18 @@ func UpdateWxUserLabel(cont context.Context) (err error) {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ fmt.Println("修改机构互动量信息")
|
|
|
////修改机构互动量信息
|
|
|
if len(mapComapnyInteractionNum) > 0 {
|
|
|
for k, v := range mapComapnyInteractionNum {
|
|
|
- err = models.UpdateComapanyInteractionNum(v, k)
|
|
|
+ companyId := k
|
|
|
+ err = models.UpdateComapanyInteractionNum(v, mapComapnyInteractionNumSeller[companyId], companyId)
|
|
|
+ if err != nil {
|
|
|
+ fmt.Println(" AddCygxUserInteractionNumList Err", err)
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
// 批量添加用户互动量信息
|
|
|
if len(itemsInteraction) > 0 {
|
|
|
_, err = models.AddCygxUserInteractionNumList(itemsInteraction)
|
|
@@ -761,3 +784,277 @@ func UpdateWxUserLabel(cont context.Context) (err error) {
|
|
|
go UpdateUserLabelWeight()
|
|
|
return
|
|
|
}
|
|
|
+
|
|
|
+func init123123() {
|
|
|
+ var err error
|
|
|
+ defer func() {
|
|
|
+ if err != nil {
|
|
|
+ go utils.SendAlarmMsg("更新用户标签失败;Err:"+err.Error(), 2)
|
|
|
+ }
|
|
|
+ }()
|
|
|
+ var interactionNum int
|
|
|
+ mapComapnyInteractionNum := make(map[int]int)
|
|
|
+
|
|
|
+ listUser, err := models.GetUserRegisterListinit()
|
|
|
+ if err != nil && err.Error() != utils.ErrNoRow() {
|
|
|
+ fmt.Println("GetUserSellerRelationUserList Err", err)
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ fmt.Println(len(listUser))
|
|
|
+ //return
|
|
|
+ //处理用户、机构互动量数据
|
|
|
+ {
|
|
|
+ var userIds string
|
|
|
+ var itemsInteraction []*models.CygxUserInteractionNum
|
|
|
+ mapUserInteraction := make(map[int]int)
|
|
|
+ mapCompanyInteraction := make(map[int]int)
|
|
|
+ mapCompanyInteractionItem := make(map[int]*models.CygxCompanyInteractionNum)
|
|
|
+ mapComapnyInteractionSeller := make(map[int]int)
|
|
|
+ mapComapnyInteractionNumSeller := make(map[int]int) // 销售可查看的互动量
|
|
|
+ //获取已经处理记录的用户并记录切片
|
|
|
+ listUserInteractionNum, err := models.GetCygxUserInteractionNumList()
|
|
|
+ if err != nil && err.Error() != utils.ErrNoRow() {
|
|
|
+ fmt.Println("GetCygxUserInteractionNumList Err", err)
|
|
|
+ return
|
|
|
+ }
|
|
|
+ for _, v := range listUserInteractionNum {
|
|
|
+ mapUserInteraction[v.UserId] = v.UserId
|
|
|
+ }
|
|
|
+
|
|
|
+ //获取跟销售建立绑定关系的用户并记录切片
|
|
|
+ listUserSeller, err := models.GetUserSellerRelationUserList()
|
|
|
+ if err != nil && err.Error() != utils.ErrNoRow() {
|
|
|
+ fmt.Println("GetUserSellerRelationUserList Err", err)
|
|
|
+ return
|
|
|
+ }
|
|
|
+ for _, v := range listUserSeller {
|
|
|
+ mapComapnyInteractionSeller[v.UserId] = v.UserId
|
|
|
+ }
|
|
|
+
|
|
|
+ listCompanyInteractionNum, err := models.GetCygxCompanyInteractionNumList()
|
|
|
+ if err != nil && err.Error() != utils.ErrNoRow() {
|
|
|
+ fmt.Println("GetCygxUserInteractionNumList Err", err)
|
|
|
+ return
|
|
|
+ }
|
|
|
+ for _, v := range listCompanyInteractionNum {
|
|
|
+ mapCompanyInteraction[v.CompanyId] = v.CompanyId
|
|
|
+ }
|
|
|
+
|
|
|
+ //处理用户互动量数据
|
|
|
+ for kUser, vUser := range listUser {
|
|
|
+ userIds += strconv.Itoa(vUser.UserId) + ","
|
|
|
+ //一次查询一百个避免用户过多
|
|
|
+ if kUser%100 == 0 {
|
|
|
+ userIds = strings.TrimRight(userIds, ",")
|
|
|
+ userUserInteractionList, err := models.GetCygxCompanyUserUserInteraction(userIds)
|
|
|
+ if err != nil {
|
|
|
+ fmt.Println("GetCygxCompanyUserUserInteraction Err", err)
|
|
|
+ return
|
|
|
+ }
|
|
|
+ //处理用户的互动量
|
|
|
+ if len(userUserInteractionList) > 0 {
|
|
|
+ for _, vsplit := range userUserInteractionList {
|
|
|
+ interactionNum = vsplit.HistoryNum + vsplit.CountNum + vsplit.IndustryFllowNum + vsplit.DepartmentFollowNum + vsplit.KeyWordNum + vsplit.OnLineNum + vsplit.OfficeNum + vsplit.ChartCountNum + vsplit.TripNum + vsplit.RoadshowVideoNum + vsplit.ActivityVideoNum + vsplit.ActivityVoiceNum + vsplit.TagNum
|
|
|
+ if interactionNum > 0 {
|
|
|
+ //更改用户的互动量
|
|
|
+ err = models.UpdateUserInteractionNum(interactionNum, int(vsplit.UserId))
|
|
|
+ if err != nil {
|
|
|
+ fmt.Println("UpdateUserInteractionNum Err", err)
|
|
|
+ return
|
|
|
+ }
|
|
|
+ mapComapnyInteractionNum[vsplit.CompanyId] += interactionNum
|
|
|
+
|
|
|
+ itemInteraction := new(models.CygxUserInteractionNum)
|
|
|
+ itemInteraction.UserId = int(vsplit.UserId)
|
|
|
+ itemInteraction.ArticleHistoryNum = vsplit.HistoryNum
|
|
|
+ itemInteraction.ArticleCountNum = vsplit.CountNum
|
|
|
+ itemInteraction.ChartCountNum = vsplit.ChartCountNum
|
|
|
+ itemInteraction.IndustryFllowNum = vsplit.IndustryFllowNum
|
|
|
+ itemInteraction.DepartmentFollowNum = vsplit.DepartmentFollowNum
|
|
|
+ itemInteraction.KeyWordNum = vsplit.KeyWordNum
|
|
|
+ itemInteraction.ActivityOnLineNum = vsplit.OnLineNum
|
|
|
+ itemInteraction.ActivityOfficeNum = vsplit.OfficeNum
|
|
|
+ itemInteraction.ActivityNum = vsplit.OnLineNum + vsplit.OfficeNum
|
|
|
+ itemInteraction.TripNum = vsplit.TripNum
|
|
|
+ itemInteraction.RoadshowVideoNum = vsplit.RoadshowVideoNum
|
|
|
+ itemInteraction.ActivityVideoNum = vsplit.ActivityVideoNum
|
|
|
+ itemInteraction.ActivityVoiceNum = vsplit.ActivityVoiceNum
|
|
|
+ itemInteraction.TagNum = vsplit.TagNum
|
|
|
+ itemInteraction.RoadshowNum = vsplit.RoadshowVideoNum + vsplit.ActivityVideoNum + vsplit.ActivityVoiceNum
|
|
|
+ itemInteraction.CreateTime = time.Now()
|
|
|
+ itemInteraction.ModifyTime = time.Now()
|
|
|
+
|
|
|
+ //如果这个切片下的结构体没有值就给他初始值,如果有就跟后面的相加
|
|
|
+ if mapCompanyInteractionItem[vsplit.CompanyId] == nil {
|
|
|
+ itemCompanyInteraction := new(models.CygxCompanyInteractionNum)
|
|
|
+ itemCompanyInteraction.CompanyId = vsplit.CompanyId
|
|
|
+ itemCompanyInteraction.ArticleHistoryNum = vsplit.HistoryNum
|
|
|
+ itemCompanyInteraction.ArticleCountNum = vsplit.CountNum
|
|
|
+ itemCompanyInteraction.ChartCountNum = vsplit.ChartCountNum
|
|
|
+ itemCompanyInteraction.IndustryFllowNum = vsplit.IndustryFllowNum
|
|
|
+ itemCompanyInteraction.DepartmentFollowNum = vsplit.DepartmentFollowNum
|
|
|
+ itemCompanyInteraction.KeyWordNum = vsplit.KeyWordNum
|
|
|
+ itemCompanyInteraction.ActivityOnLineNum = vsplit.OnLineNum
|
|
|
+ itemCompanyInteraction.ActivityOfficeNum = vsplit.OfficeNum
|
|
|
+ itemCompanyInteraction.ActivityNum = vsplit.OnLineNum + vsplit.OfficeNum
|
|
|
+ itemCompanyInteraction.TripNum = vsplit.TripNum
|
|
|
+ itemCompanyInteraction.RoadshowVideoNum = vsplit.RoadshowVideoNum
|
|
|
+ itemCompanyInteraction.ActivityVideoNum = vsplit.ActivityVideoNum
|
|
|
+ itemCompanyInteraction.ActivityVoiceNum = vsplit.ActivityVoiceNum
|
|
|
+ itemCompanyInteraction.TagNum = vsplit.TagNum
|
|
|
+ itemCompanyInteraction.RoadshowNum = vsplit.RoadshowVideoNum + vsplit.ActivityVideoNum + vsplit.ActivityVoiceNum
|
|
|
+ mapCompanyInteractionItem[vsplit.CompanyId] = itemCompanyInteraction
|
|
|
+ mapCompanyInteractionItem[vsplit.CompanyId].CreateTime = time.Now()
|
|
|
+ mapCompanyInteractionItem[vsplit.CompanyId].ModifyTime = time.Now()
|
|
|
+ } else {
|
|
|
+ fmt.Println("公司ID", vsplit.CompanyId)
|
|
|
+ mapCompanyInteractionItem[vsplit.CompanyId].CompanyId = vsplit.CompanyId
|
|
|
+ mapCompanyInteractionItem[vsplit.CompanyId].ArticleHistoryNum += vsplit.HistoryNum
|
|
|
+ mapCompanyInteractionItem[vsplit.CompanyId].ArticleCountNum += vsplit.CountNum
|
|
|
+ mapCompanyInteractionItem[vsplit.CompanyId].ChartCountNum += vsplit.ChartCountNum
|
|
|
+ mapCompanyInteractionItem[vsplit.CompanyId].IndustryFllowNum += vsplit.IndustryFllowNum
|
|
|
+ mapCompanyInteractionItem[vsplit.CompanyId].DepartmentFollowNum += vsplit.DepartmentFollowNum
|
|
|
+ mapCompanyInteractionItem[vsplit.CompanyId].KeyWordNum += vsplit.KeyWordNum
|
|
|
+ mapCompanyInteractionItem[vsplit.CompanyId].ActivityOnLineNum += vsplit.OnLineNum
|
|
|
+ mapCompanyInteractionItem[vsplit.CompanyId].ActivityOfficeNum += vsplit.OfficeNum
|
|
|
+ mapCompanyInteractionItem[vsplit.CompanyId].ActivityNum += vsplit.OnLineNum + vsplit.OfficeNum
|
|
|
+ mapCompanyInteractionItem[vsplit.CompanyId].TripNum += vsplit.TripNum
|
|
|
+ mapCompanyInteractionItem[vsplit.CompanyId].RoadshowVideoNum += vsplit.RoadshowVideoNum
|
|
|
+ mapCompanyInteractionItem[vsplit.CompanyId].ActivityVideoNum += vsplit.ActivityVideoNum
|
|
|
+ mapCompanyInteractionItem[vsplit.CompanyId].ActivityVoiceNum += vsplit.ActivityVoiceNum
|
|
|
+ mapCompanyInteractionItem[vsplit.CompanyId].TagNum += vsplit.TagNum
|
|
|
+ mapCompanyInteractionItem[vsplit.CompanyId].RoadshowNum += vsplit.RoadshowVideoNum + vsplit.ActivityVideoNum + vsplit.ActivityVoiceNum
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ //如果存在就修改不存在就新增
|
|
|
+ if mapUserInteraction[int(vsplit.UserId)] == 0 {
|
|
|
+ itemsInteraction = append(itemsInteraction, itemInteraction)
|
|
|
+ } else {
|
|
|
+ err = models.UpdateCygxUserInteractionNum(itemInteraction)
|
|
|
+ if err != nil {
|
|
|
+ fmt.Println("UpdateCygxUserInteractionNum Err", err)
|
|
|
+ return
|
|
|
+ }
|
|
|
+ fmt.Println(itemInteraction.UserId)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ userIds = ""
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ userIds = strings.TrimRight(userIds, ",")
|
|
|
+ if userIds != "" {
|
|
|
+ userUserInteractionList, err := models.GetCygxCompanyUserUserInteraction(userIds)
|
|
|
+ if err != nil {
|
|
|
+ fmt.Println("GetCygxCompanyUserUserInteraction Err", err)
|
|
|
+ return
|
|
|
+ }
|
|
|
+ //fmt.Println("处理用户剩余的")
|
|
|
+ //处理用户的互动量
|
|
|
+ if len(userUserInteractionList) > 0 {
|
|
|
+ for _, vsplit := range userUserInteractionList {
|
|
|
+ interactionNum = vsplit.HistoryNum + vsplit.CountNum + vsplit.IndustryFllowNum + vsplit.DepartmentFollowNum + vsplit.KeyWordNum + vsplit.OnLineNum + vsplit.OfficeNum + vsplit.ChartCountNum + vsplit.TripNum + vsplit.RoadshowVideoNum + vsplit.ActivityVideoNum + vsplit.ActivityVoiceNum + vsplit.TagNum
|
|
|
+ if interactionNum > 0 {
|
|
|
+ err = models.UpdateUserInteractionNum(interactionNum, int(vsplit.UserId))
|
|
|
+ if err != nil {
|
|
|
+ fmt.Println("UpdateUserInteractionNum Err", err)
|
|
|
+ return
|
|
|
+ }
|
|
|
+ mapComapnyInteractionNum[vsplit.CompanyId] += interactionNum
|
|
|
+
|
|
|
+ if mapComapnyInteractionSeller[int(vsplit.UserId)] > 0 {
|
|
|
+ mapComapnyInteractionNumSeller[vsplit.CompanyId] += interactionNum //如果销售可以看到这个人,那么就对销售可见的数量进行添加
|
|
|
+ }
|
|
|
+
|
|
|
+ itemInteraction := new(models.CygxUserInteractionNum)
|
|
|
+ itemInteraction.UserId = int(vsplit.UserId)
|
|
|
+ itemInteraction.ArticleHistoryNum = vsplit.HistoryNum
|
|
|
+ itemInteraction.ArticleCountNum = vsplit.CountNum
|
|
|
+ itemInteraction.ChartCountNum = vsplit.ChartCountNum
|
|
|
+ itemInteraction.IndustryFllowNum = vsplit.IndustryFllowNum
|
|
|
+ itemInteraction.DepartmentFollowNum = vsplit.DepartmentFollowNum
|
|
|
+ itemInteraction.KeyWordNum = vsplit.KeyWordNum
|
|
|
+ itemInteraction.ActivityOnLineNum = vsplit.OnLineNum
|
|
|
+ itemInteraction.ActivityOfficeNum = vsplit.OfficeNum
|
|
|
+ itemInteraction.ActivityNum = vsplit.OnLineNum + vsplit.OfficeNum
|
|
|
+ itemInteraction.TripNum = vsplit.TripNum
|
|
|
+ itemInteraction.RoadshowVideoNum = vsplit.RoadshowVideoNum
|
|
|
+ itemInteraction.ActivityVideoNum = vsplit.ActivityVideoNum
|
|
|
+ itemInteraction.ActivityVoiceNum = vsplit.ActivityVoiceNum
|
|
|
+ itemInteraction.TagNum = vsplit.TagNum
|
|
|
+ itemInteraction.RoadshowNum = vsplit.RoadshowVideoNum + vsplit.ActivityVideoNum + vsplit.ActivityVoiceNum
|
|
|
+
|
|
|
+ //如果这个切片下的结构体没有值就给他初始值,如果有就跟后面的相加
|
|
|
+ if mapCompanyInteractionItem[vsplit.CompanyId] == nil {
|
|
|
+ itemCompanyInteraction := new(models.CygxCompanyInteractionNum)
|
|
|
+ itemCompanyInteraction.CompanyId = vsplit.CompanyId
|
|
|
+ itemCompanyInteraction.ArticleHistoryNum = vsplit.HistoryNum
|
|
|
+ itemCompanyInteraction.ArticleCountNum = vsplit.CountNum
|
|
|
+ itemCompanyInteraction.ChartCountNum = vsplit.ChartCountNum
|
|
|
+ itemCompanyInteraction.IndustryFllowNum = vsplit.IndustryFllowNum
|
|
|
+ itemCompanyInteraction.DepartmentFollowNum = vsplit.DepartmentFollowNum
|
|
|
+ itemCompanyInteraction.KeyWordNum = vsplit.KeyWordNum
|
|
|
+ itemCompanyInteraction.ActivityOnLineNum = vsplit.OnLineNum
|
|
|
+ itemCompanyInteraction.ActivityOfficeNum = vsplit.OfficeNum
|
|
|
+ itemCompanyInteraction.ActivityNum = vsplit.OnLineNum + vsplit.OfficeNum
|
|
|
+ itemCompanyInteraction.TripNum = vsplit.TripNum
|
|
|
+ itemCompanyInteraction.RoadshowVideoNum = vsplit.RoadshowVideoNum
|
|
|
+ itemCompanyInteraction.ActivityVideoNum = vsplit.ActivityVideoNum
|
|
|
+ itemCompanyInteraction.ActivityVoiceNum = vsplit.ActivityVoiceNum
|
|
|
+ itemCompanyInteraction.TagNum = vsplit.TagNum
|
|
|
+ itemCompanyInteraction.RoadshowNum = vsplit.RoadshowVideoNum + vsplit.ActivityVideoNum + vsplit.ActivityVoiceNum
|
|
|
+ mapCompanyInteractionItem[vsplit.CompanyId] = itemCompanyInteraction
|
|
|
+ mapCompanyInteractionItem[vsplit.CompanyId].CreateTime = time.Now()
|
|
|
+ mapCompanyInteractionItem[vsplit.CompanyId].ModifyTime = time.Now()
|
|
|
+ } else {
|
|
|
+ mapCompanyInteractionItem[vsplit.CompanyId].CompanyId = vsplit.CompanyId
|
|
|
+ mapCompanyInteractionItem[vsplit.CompanyId].ArticleHistoryNum += vsplit.HistoryNum
|
|
|
+ mapCompanyInteractionItem[vsplit.CompanyId].ArticleCountNum += vsplit.CountNum
|
|
|
+ mapCompanyInteractionItem[vsplit.CompanyId].ChartCountNum += vsplit.ChartCountNum
|
|
|
+ mapCompanyInteractionItem[vsplit.CompanyId].IndustryFllowNum += vsplit.IndustryFllowNum
|
|
|
+ mapCompanyInteractionItem[vsplit.CompanyId].DepartmentFollowNum += vsplit.DepartmentFollowNum
|
|
|
+ mapCompanyInteractionItem[vsplit.CompanyId].KeyWordNum += vsplit.KeyWordNum
|
|
|
+ mapCompanyInteractionItem[vsplit.CompanyId].ActivityOnLineNum += vsplit.OnLineNum
|
|
|
+ mapCompanyInteractionItem[vsplit.CompanyId].ActivityOfficeNum += vsplit.OfficeNum
|
|
|
+ mapCompanyInteractionItem[vsplit.CompanyId].ActivityNum += vsplit.OnLineNum + vsplit.OfficeNum
|
|
|
+ mapCompanyInteractionItem[vsplit.CompanyId].TripNum += vsplit.TripNum
|
|
|
+ mapCompanyInteractionItem[vsplit.CompanyId].RoadshowVideoNum += vsplit.RoadshowVideoNum
|
|
|
+ mapCompanyInteractionItem[vsplit.CompanyId].ActivityVideoNum += vsplit.ActivityVideoNum
|
|
|
+ mapCompanyInteractionItem[vsplit.CompanyId].ActivityVoiceNum += vsplit.ActivityVoiceNum
|
|
|
+ mapCompanyInteractionItem[vsplit.CompanyId].TagNum += vsplit.TagNum
|
|
|
+ mapCompanyInteractionItem[vsplit.CompanyId].RoadshowNum += vsplit.RoadshowVideoNum + vsplit.ActivityVideoNum + vsplit.ActivityVoiceNum
|
|
|
+ }
|
|
|
+
|
|
|
+ ////如果存在就修改不存在就新增
|
|
|
+ //if mapUserInteraction[int(vsplit.UserId)] == 0 {
|
|
|
+ // itemsInteraction = append(itemsInteraction, itemInteraction)
|
|
|
+ //} else {
|
|
|
+ // err = models.UpdateCygxUserInteractionNum(itemInteraction)
|
|
|
+ // if err != nil {
|
|
|
+ // fmt.Println("UpdateCygxUserInteractionNum Err", err)
|
|
|
+ // return
|
|
|
+ // }
|
|
|
+ // fmt.Println(itemInteraction.UserId)
|
|
|
+ // err = models.UpdateCygxUserInteractionNum(itemInteraction)
|
|
|
+ //}
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ fmt.Println("修改机构互动量信息")
|
|
|
+ ////修改机构互动量信息
|
|
|
+ if len(mapComapnyInteractionNum) > 0 {
|
|
|
+ for k, v := range mapComapnyInteractionNum {
|
|
|
+ companyId := k
|
|
|
+ err = models.UpdateComapanyInteractionNum(v, mapComapnyInteractionNumSeller[companyId], companyId)
|
|
|
+ if err != nil {
|
|
|
+ fmt.Println(" AddCygxUserInteractionNumList Err", err)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|