|
@@ -219,11 +219,9 @@ func (this *ArticleController) Detail() {
|
|
|
br.ErrMsg = "获取销售数据失败,Err:" + err.Error() + strconv.Itoa(uid) + ";articleId" + strconv.Itoa(articleId)
|
|
|
return
|
|
|
}
|
|
|
- fmt.Println(detail.SellerAndMobile)
|
|
|
if detail.ArticleId >= utils.SummaryArticleId && strings.Contains(detail.SellerAndMobile, "-") {
|
|
|
strnum := strings.Index(detail.SellerAndMobile, "-")
|
|
|
detail.SellerAndMobile = detail.SellerAndMobile[0:strnum]
|
|
|
- fmt.Println(detail.SellerAndMobile)
|
|
|
if strnum > 0 {
|
|
|
nickName := detail.SellerAndMobile[0:strnum]
|
|
|
sellerAndMobile := &models.SellerRep{
|
|
@@ -608,37 +606,41 @@ func (this *ArticleController) AddStopTime() {
|
|
|
}
|
|
|
if hasPersion {
|
|
|
detailNew, err := models.GetNewArticleHistoryRecord(uid, articleId)
|
|
|
+ fmt.Println(detailNew)
|
|
|
+ fmt.Println(err)
|
|
|
if err == nil {
|
|
|
+ fmt.Println("修改")
|
|
|
hasPermission = 1
|
|
|
historyRecord := new(models.AddStopTimeNewRep)
|
|
|
historyRecord.StopTime = detailNew.StopTime + stopTime
|
|
|
historyRecord.Id = detailNew.Id
|
|
|
historyRecord.OutType = outType
|
|
|
- go models.AddArticleStopTime(historyRecord)
|
|
|
+ go models.UpdateArticleStopTime(historyRecord)
|
|
|
}
|
|
|
|
|
|
- key := "CYGX_ARTICLE_PV" + strconv.Itoa(articleId) + "_" + strconv.Itoa(uid) + "_" + strconv.Itoa(user.CompanyId)
|
|
|
- record := new(models.CygxArticleHistoryRecordNewpv)
|
|
|
- record.UserId = uid
|
|
|
- record.ArticleId = articleId
|
|
|
- record.CreateTime = time.Now()
|
|
|
- record.ModifyTime = time.Now()
|
|
|
- record.Mobile = user.Mobile
|
|
|
- record.Email = user.Email
|
|
|
- record.CompanyId = user.CompanyId
|
|
|
- record.CompanyName = user.CompanyName
|
|
|
- record.StopTime = stopTime
|
|
|
- record.OutType = outType
|
|
|
//不统计本公司的阅读记录、正常退出的不做时间差统计
|
|
|
if user.CompanyId != 16 {
|
|
|
- if !utils.Rc.IsExist(key) || req.OutType != 2 {
|
|
|
+ key := "CYGX_ARTICLE_PV" + strconv.Itoa(articleId) + "_" + strconv.Itoa(uid) + "_" + strconv.Itoa(user.CompanyId) + "_" + strconv.Itoa(outType)
|
|
|
+ record := new(models.CygxArticleHistoryRecordNewpv)
|
|
|
+ record.UserId = uid
|
|
|
+ record.ArticleId = articleId
|
|
|
+ record.CreateTime = time.Now()
|
|
|
+ record.ModifyTime = time.Now()
|
|
|
+ record.Mobile = user.Mobile
|
|
|
+ record.Email = user.Email
|
|
|
+ record.CompanyId = user.CompanyId
|
|
|
+ record.CompanyName = user.CompanyName
|
|
|
+ record.StopTime = stopTime
|
|
|
+ record.OutType = outType
|
|
|
+ if !utils.Rc.IsExist(key) || outType != 2 {
|
|
|
//新增浏览记录
|
|
|
go models.AddCygxArticleViewRecordNewpv(record)
|
|
|
} else {
|
|
|
go models.UpdateCygxArticleViewRecordNewpv(record, stopTime)
|
|
|
}
|
|
|
+ utils.Rc.Put(key, 1, 10*time.Minute)
|
|
|
}
|
|
|
- utils.Rc.Put(key, 1, 10*time.Minute)
|
|
|
+
|
|
|
models.ModifyReportLastViewTime(uid)
|
|
|
} else { //无该行业权限
|
|
|
hasPermission = 3
|