1234567891011121314151617181920212223242526272829303132333435363738394041 |
- package services
- import (
- "hongze/hongze_cygx/models"
- "hongze/hongze_cygx/utils"
- "strconv"
- )
- // 添加历史信息
- func AddCygxReportHistoryRecord(item *models.CygxReportHistoryRecord) (err error) {
- //defer func() {
- // if err != nil {
- // go utils.SendAlarmMsg("产品内测用户浏览信息记录失败"+err.Error(), 2)
- // }
- //}()
- if item.StopTime >= 5 {
- _, err = models.AddCygxReportHistoryRecord(item)
- if err != nil {
- go utils.SendAlarmMsg("报告精选用户浏览信息记录失败"+err.Error()+"报告类型"+item.ReportType+"报告ID:"+strconv.Itoa(item.ArticleId), 2)
- }
- }
- historyRecordLog := new(models.CygxReportHistoryRecordLog)
- historyRecordLog.UserId = item.UserId
- historyRecordLog.ArticleId = historyRecordLog.ArticleId
- historyRecordLog.CreateTime = historyRecordLog.CreateTime
- historyRecordLog.Mobile = historyRecordLog.Mobile
- historyRecordLog.Email = historyRecordLog.Email
- historyRecordLog.CompanyId = historyRecordLog.CompanyId
- historyRecordLog.CompanyName = historyRecordLog.CompanyName
- historyRecordLog.StopTime = historyRecordLog.StopTime
- historyRecordLog.OutType = historyRecordLog.OutType
- historyRecordLog.ReportType = historyRecordLog.ReportType
- historyRecordLog.RegisterPlatform = historyRecordLog.RegisterPlatform
- _, err = models.AddCygxReportHistoryRecordLog(historyRecordLog)
- if err != nil {
- go utils.SendAlarmMsg("报告精选用户浏览信息日志记录失败"+err.Error()+"报告类型"+item.ReportType+"报告ID:"+strconv.Itoa(item.ArticleId), 2)
- }
- return
- }
|