|
@@ -134,23 +134,27 @@ func (this *ArticleController) Detail() {
|
|
|
|
|
|
if strings.Contains(companyPermission, articlePermissionPermissionName) {
|
|
|
hasPermission = 1
|
|
|
- detailNew, err := models.GetNewArticleHistoryRecord(uid, articleId)
|
|
|
- if err != nil {
|
|
|
- br.Msg = "获取信息失败"
|
|
|
- br.ErrMsg = "获取信息失败,Err:" + err.Error()
|
|
|
- return
|
|
|
- }
|
|
|
- recordCount, _ := models.GetNoAddStoptimeArticleCount(detailNew.Id)
|
|
|
- if recordCount < 1 {
|
|
|
- historyRecord := new(models.CygxArticleHistoryRecord)
|
|
|
- historyRecord.UserId = uid
|
|
|
- historyRecord.ArticleId = articleId
|
|
|
- historyRecord.CreateTime = time.Now()
|
|
|
- historyRecord.Mobile = user.Mobile
|
|
|
- historyRecord.Email = user.Email
|
|
|
- historyRecord.CompanyId = user.CompanyId
|
|
|
- historyRecord.CompanyName = user.CompanyName
|
|
|
+ historyRecord := new(models.CygxArticleHistoryRecord)
|
|
|
+ historyRecord.UserId = uid
|
|
|
+ historyRecord.ArticleId = articleId
|
|
|
+ historyRecord.CreateTime = time.Now()
|
|
|
+ historyRecord.Mobile = user.Mobile
|
|
|
+ historyRecord.Email = user.Email
|
|
|
+ historyRecord.CompanyId = user.CompanyId
|
|
|
+ historyRecord.CompanyName = user.CompanyName
|
|
|
+ recordCount, _ := models.GetNoAddStoptimeArticleCount(uid, articleId)
|
|
|
+ if recordCount == 0 {
|
|
|
go models.AddCygxArticleHistoryRecord(historyRecord)
|
|
|
+ } else {
|
|
|
+ detailNew, err := models.GetNewArticleHistoryRecord(uid, articleId)
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "获取信息失败"
|
|
|
+ br.ErrMsg = "获取信息失败,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if detailNew.StopTime > 0 {
|
|
|
+ go models.AddCygxArticleHistoryRecord(historyRecord)
|
|
|
+ }
|
|
|
}
|
|
|
} else { //无该行业权限
|
|
|
hasPermission = 3
|