|
@@ -967,64 +967,64 @@ func (this *CompanyUserController) List() {
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
- userViewMobileTotalMap := make(map[string]*models.UserViewMobileTotalSlice)
|
|
|
- userReportViewMobileTotalMap := make(map[string]*models.ReportViewMobileRecord)
|
|
|
- userAdvisoryViewMobileTotalMap := make(map[string]*advisory.UserViewMobileTotalSlice)
|
|
|
- userCygxArticleHistoryRecordViewMobileTotalMap := make(map[string]*models.UserViewMobileTotalSlice)
|
|
|
- if len(mobilesSlice) > 0 {
|
|
|
-
|
|
|
- userViewMobileTotalList, _ := models.GetCountUserViewHistoryByMobiles(mobileStr)
|
|
|
- for _, userViewMobile := range userViewMobileTotalList {
|
|
|
- userViewMobileTotalMap[userViewMobile.Mobile] = userViewMobile
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- userReportViewMobileTotalList, _ := models.GetReportViewMaxTimeByMobiles(mobileStr)
|
|
|
- for _, userReportViewMobile := range userReportViewMobileTotalList {
|
|
|
- userReportViewMobileTotalMap[userReportViewMobile.Mobile] = userReportViewMobile
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- userAdvisoryViewMobileTotalList, _ := advisory.GetCountUserViewHistoryByMobiles(mobileStr)
|
|
|
-
|
|
|
- for _, userAdvisoryViewMobile := range userAdvisoryViewMobileTotalList {
|
|
|
- userAdvisoryViewMobileTotalMap[userAdvisoryViewMobile.Mobile] = userAdvisoryViewMobile
|
|
|
- }
|
|
|
-
|
|
|
- userCygxArticleHistoryRecordViewMobileTotalList, _ := models.GetCountCygxArticleHistoryRecordByMobiles(mobileStr)
|
|
|
- for _, userCygxArticleHistoryRecordViewMobile := range userCygxArticleHistoryRecordViewMobileTotalList {
|
|
|
- userCygxArticleHistoryRecordViewMobileTotalMap[userCygxArticleHistoryRecordViewMobile.Mobile] = userCygxArticleHistoryRecordViewMobile
|
|
|
- }
|
|
|
- }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
-
|
|
|
- userViewEmailTotalMap := make(map[string]*models.UserViewEmailTotalSlice)
|
|
|
- userReportViewEmailTotalMap := make(map[string]*models.ReportViewEmailRecord)
|
|
|
- userAdvisoryViewEmailTotalMap := make(map[string]*advisory.UserViewEmailTotalSlice)
|
|
|
- userCygxViewEmailTotalMap := make(map[string]*models.UserViewEmailTotalSlice)
|
|
|
- if len(emailsSlice) > 0 {
|
|
|
-
|
|
|
- userViewEmailTotalList, _ := models.GetCountUserViewHistoryByEmails(emailStr)
|
|
|
- for _, userViewEmail := range userViewEmailTotalList {
|
|
|
- userViewEmailTotalMap[userViewEmail.Email] = userViewEmail
|
|
|
- }
|
|
|
-
|
|
|
- userReportViewEmailTotalList, _ := models.GetReportViewMaxTimeByEmails(emailStr)
|
|
|
- for _, userReportViewEmail := range userReportViewEmailTotalList {
|
|
|
- userReportViewEmailTotalMap[userReportViewEmail.Email] = userReportViewEmail
|
|
|
- }
|
|
|
-
|
|
|
- userAdvisoryViewEmailTotalList, _ := advisory.GetCountUserViewHistoryByEmails(emailStr)
|
|
|
- for _, userAdvisoryViewEmail := range userAdvisoryViewEmailTotalList {
|
|
|
- userAdvisoryViewEmailTotalMap[userAdvisoryViewEmail.Email] = userAdvisoryViewEmail
|
|
|
- }
|
|
|
-
|
|
|
- userCygxViewEmailTotalList, _ := models.GetCountCygxArticleHistoryRecordByEmails(emailStr)
|
|
|
- for _, userCygxReportViewEmail := range userCygxViewEmailTotalList {
|
|
|
- userCygxViewEmailTotalMap[userCygxReportViewEmail.Email] = userCygxReportViewEmail
|
|
|
- }
|
|
|
- }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
|
|
|
userSellerRelationTotalSlice, err := models.GetUserSellerRelationCountByUserIds(userIdStr)
|
|
@@ -1090,23 +1090,6 @@ func (this *CompanyUserController) List() {
|
|
|
item := list[i]
|
|
|
|
|
|
list[i].CompanyName = companyInfo.CompanyName
|
|
|
-
|
|
|
- if userView, ok := userViewMobileTotalMap[item.Mobile]; ok {
|
|
|
- list[i].ViewTotal += userView.Total
|
|
|
- if userView.CreatedTime.After(list[i].LastViewTime) {
|
|
|
- list[i].LastViewTime = userView.CreatedTime
|
|
|
- list[i].LastViewTimeStr = userView.CreatedTime.Format(utils.FormatDateTime)
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- if userView, ok := userViewEmailTotalMap[item.Email]; ok {
|
|
|
-
|
|
|
- list[i].ViewTotal += userView.Total
|
|
|
- if userView.CreatedTime.After(list[i].LastViewTime) {
|
|
|
- list[i].LastViewTime = userView.CreatedTime
|
|
|
- list[i].LastViewTimeStr = userView.CreatedTime.Format(utils.FormatDateTime)
|
|
|
- }
|
|
|
- }
|
|
|
|
|
|
if item.OpenId != "" {
|
|
|
list[i].IsRegister = true
|
|
@@ -1121,78 +1104,98 @@ func (this *CompanyUserController) List() {
|
|
|
list[i].IsRegister = false
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- if reportView, ok := userReportViewMobileTotalMap[item.Mobile]; ok {
|
|
|
-
|
|
|
- if reportView.LastViewTime.After(list[i].LastViewTime) {
|
|
|
- list[i].LastViewTime = reportView.LastViewTime
|
|
|
- list[i].LastViewTimeStr = reportView.LastViewTime.Format(utils.FormatDateTime)
|
|
|
- }
|
|
|
-
|
|
|
- list[i].ViewTotal += reportView.ViewTotal
|
|
|
- }
|
|
|
-
|
|
|
- if reportView, ok := userReportViewEmailTotalMap[item.Email]; ok {
|
|
|
-
|
|
|
- if reportView.LastViewTime.After(list[i].LastViewTime) {
|
|
|
- list[i].LastViewTime = reportView.LastViewTime
|
|
|
- list[i].LastViewTimeStr = reportView.LastViewTime.Format(utils.FormatDateTime)
|
|
|
- }
|
|
|
-
|
|
|
- list[i].ViewTotal += reportView.ViewTotal
|
|
|
- }
|
|
|
|
|
|
-
|
|
|
- if advisoryView, ok := userAdvisoryViewMobileTotalMap[item.Mobile]; ok {
|
|
|
-
|
|
|
-
|
|
|
- if advisoryView.CreatedTime.After(list[i].LastViewTime) {
|
|
|
- list[i].LastViewTime = advisoryView.CreatedTime
|
|
|
- list[i].LastViewTimeStr = advisoryView.CreatedTime.Format(utils.FormatDateTime)
|
|
|
- }
|
|
|
-
|
|
|
- list[i].ViewTotal += advisoryView.Total
|
|
|
- }
|
|
|
-
|
|
|
- if advisoryView, ok := userAdvisoryViewEmailTotalMap[item.Email]; ok {
|
|
|
-
|
|
|
- if advisoryView.CreatedTime.After(list[i].LastViewTime) {
|
|
|
- list[i].LastViewTime = advisoryView.CreatedTime
|
|
|
- list[i].LastViewTimeStr = advisoryView.CreatedTime.Format(utils.FormatDateTime)
|
|
|
- }
|
|
|
-
|
|
|
- list[i].ViewTotal += advisoryView.Total
|
|
|
- }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
-
|
|
|
- if cygxView, ok := userCygxArticleHistoryRecordViewMobileTotalMap[item.Mobile]; ok {
|
|
|
-
|
|
|
- if cygxView.CreatedTime.After(list[i].LastViewTime) {
|
|
|
- list[i].LastViewTime = cygxView.CreatedTime
|
|
|
- list[i].LastViewTimeStr = cygxView.CreatedTime.Format(utils.FormatDateTime)
|
|
|
- }
|
|
|
-
|
|
|
- list[i].ViewTotal += cygxView.Total
|
|
|
- }
|
|
|
-
|
|
|
- if cygxView, ok := userCygxViewEmailTotalMap[item.Email]; ok {
|
|
|
-
|
|
|
- if cygxView.CreatedTime.After(list[i].LastViewTime) {
|
|
|
- list[i].LastViewTime = cygxView.CreatedTime
|
|
|
- list[i].LastViewTimeStr = cygxView.CreatedTime.Format(utils.FormatDateTime)
|
|
|
- }
|
|
|
-
|
|
|
- list[i].ViewTotal += cygxView.Total
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- if reportView.LastViewTime.After(list[i].LastViewTime) {
|
|
|
- list[i].LastViewTime = reportView.LastViewTime
|
|
|
- list[i].LastViewTimeStr = reportView.LastViewTime.Format(utils.FormatDateTime)
|
|
|
- }
|
|
|
-
|
|
|
- list[i].ViewTotal += reportView.ViewTotal
|
|
|
- }*/
|
|
|
+ list[i].ViewTotal = list[i].FiccViewTotal + list[i].RaiViewTotal
|
|
|
|
|
|
|
|
|
if _, ok := userRecordRegisterMap[int(item.UserId)]; ok {
|
|
@@ -2985,11 +2988,11 @@ func (this *CompanyUserController) ViewReportList() {
|
|
|
case 1:
|
|
|
baseCondition += ` AND source = ? `
|
|
|
basePars = append(basePars, 4)
|
|
|
- total = item.FiccViewTotal
|
|
|
-
|
|
|
+
|
|
|
+ total = item.RaiViewTotal
|
|
|
if lastViewTimeT.IsZero() {
|
|
|
- if item.FiccLastViewTime != `` && item.FiccLastViewTime != `0000-00-00 00:00:00` {
|
|
|
- lastViewTimeT, _ = time.ParseInLocation(utils.FormatDateTime, item.FiccLastViewTime, time.Local)
|
|
|
+ if item.RaiLastViewTime != `` && item.RaiLastViewTime != `0000-00-00 00:00:00` {
|
|
|
+ lastViewTimeT, _ = time.ParseInLocation(utils.FormatDateTime, item.RaiLastViewTime, time.Local)
|
|
|
} else {
|
|
|
lastViewTimeT = time.Now()
|
|
|
}
|
|
@@ -2999,10 +3002,11 @@ func (this *CompanyUserController) ViewReportList() {
|
|
|
case 2:
|
|
|
baseCondition += ` AND source in (?,?,?) `
|
|
|
basePars = append(basePars, 1, 2, 3)
|
|
|
- total = item.RaiViewTotal
|
|
|
+ total = item.FiccViewTotal
|
|
|
+
|
|
|
if lastViewTimeT.IsZero() {
|
|
|
- if item.RaiLastViewTime != `` && item.RaiLastViewTime != `0000-00-00 00:00:00` {
|
|
|
- lastViewTimeT, _ = time.ParseInLocation(utils.FormatDateTime, item.RaiLastViewTime, time.Local)
|
|
|
+ if item.FiccLastViewTime != `` && item.FiccLastViewTime != `0000-00-00 00:00:00` {
|
|
|
+ lastViewTimeT, _ = time.ParseInLocation(utils.FormatDateTime, item.FiccLastViewTime, time.Local)
|
|
|
} else {
|
|
|
lastViewTimeT = time.Now()
|
|
|
}
|