|
@@ -504,36 +504,48 @@ func StatisticalReport() {
|
|
|
|
|
|
// UserViewRedisData 阅读数据
|
|
|
type UserViewRedisData struct {
|
|
|
- Mobile string `json:"mobile"`
|
|
|
- Email string `json:"email"`
|
|
|
- RealName string `json:"real_name"`
|
|
|
- CompanyName string `json:"company_name"`
|
|
|
- ViewTime string `json:"view_time" description:"阅读时间,格式:2022-02-17 13:06:13"`
|
|
|
- ProductId int `json:"product_id" description:"报告所属产品,ficc:1,权益:2"`
|
|
|
- CompanyId int `json:"company_id" description:"客户id"`
|
|
|
+ Mobile string `json:"mobile"`
|
|
|
+ Email string `json:"email"`
|
|
|
+ RealName string `json:"real_name"`
|
|
|
+ CompanyName string `json:"company_name"`
|
|
|
+ ViewTime string `json:"view_time" description:"阅读时间,格式:2022-02-17 13:06:13"`
|
|
|
+ ProductId int `json:"product_id" description:"报告所属产品,ficc:1,权益:2"`
|
|
|
+ CompanyId int `json:"company_id" description:"客户id"`
|
|
|
+ UserId int `json:"user_id" description:"用户id"`
|
|
|
+ ReportId int `json:"report_id" description:"报告id"`
|
|
|
+ StopTime int `json:"stop_time" description:"停留时间"`
|
|
|
+ ReportChapterId int `json:"report_chapter_id" description:"章节ID"`
|
|
|
+ OutId int `json:"out_id" description:"记录ID"`
|
|
|
}
|
|
|
|
|
|
type ReportViewRecord struct {
|
|
|
- Id int `orm:"column(id);pk"`
|
|
|
- UserId int `description:"用户id"`
|
|
|
- ReportId int `description:"报告id"`
|
|
|
- Mobile string `description:"手机号"`
|
|
|
- Email string `description:"邮箱"`
|
|
|
- RealName string `description:"用户实际姓名"`
|
|
|
- CompanyName string `description:"公司名称"`
|
|
|
- CreateTime time.Time `description:"创建时间"`
|
|
|
+ Id int `orm:"column(id);pk"`
|
|
|
+ UserId int `description:"用户id"`
|
|
|
+ ReportId int `description:"报告id"`
|
|
|
+ Mobile string `description:"手机号"`
|
|
|
+ Email string `description:"邮箱"`
|
|
|
+ RealName string `description:"用户实际姓名"`
|
|
|
+ CompanyName string `description:"公司名称"`
|
|
|
+ CreateTime time.Time `description:"创建时间"`
|
|
|
+ StopTime int `json:"stop_time" description:"停留时间"`
|
|
|
+ ReportChapterId int `json:"report_chapter_id" description:"章节ID"`
|
|
|
+ OutId int `json:"out_id" description:"记录ID"`
|
|
|
}
|
|
|
|
|
|
// PushViewRecordNewRedisData 阅读数据加入到redis
|
|
|
func PushViewRecordNewRedisData(reportViewRecord *ReportViewRecord, companyId int) bool {
|
|
|
data := &UserViewRedisData{
|
|
|
- Mobile: reportViewRecord.Mobile,
|
|
|
- Email: reportViewRecord.Email,
|
|
|
- RealName: reportViewRecord.RealName,
|
|
|
- CompanyName: reportViewRecord.CompanyName,
|
|
|
- ViewTime: reportViewRecord.CreateTime.Format(utils.FormatDateTime),
|
|
|
- ProductId: 2,
|
|
|
- CompanyId: companyId,
|
|
|
+ Mobile: reportViewRecord.Mobile,
|
|
|
+ Email: reportViewRecord.Email,
|
|
|
+ RealName: reportViewRecord.RealName,
|
|
|
+ CompanyName: reportViewRecord.CompanyName,
|
|
|
+ ViewTime: reportViewRecord.CreateTime.Format(utils.FormatDateTime),
|
|
|
+ ProductId: 2,
|
|
|
+ CompanyId: companyId,
|
|
|
+ ReportId: reportViewRecord.ReportId,
|
|
|
+ StopTime: reportViewRecord.StopTime,
|
|
|
+ ReportChapterId: reportViewRecord.ReportChapterId,
|
|
|
+ OutId: reportViewRecord.OutId,
|
|
|
}
|
|
|
if utils.Re == nil {
|
|
|
err := utils.Rc.LPush(utils.CACHE_KEY_USER_VIEW, data)
|