|
@@ -104,13 +104,15 @@ func (this *TacticsController) List() {
|
|
|
list[k].IsRed = true
|
|
|
}
|
|
|
}
|
|
|
- detail, errCategory := models.GetdetailByCategoryId(categoryId)
|
|
|
- if errCategory != nil && errCategory.Error() != utils.ErrNoRow() {
|
|
|
- br.Msg = "获取信息失败"
|
|
|
- br.ErrMsg = "获取信息失败,Err:" + errCategory.Error()
|
|
|
- return
|
|
|
+ if categoryId > 0 {
|
|
|
+ detail, errCategory := models.GetdetailByCategoryId(categoryId)
|
|
|
+ if errCategory != nil {
|
|
|
+ br.Msg = "获取信息失败"
|
|
|
+ br.ErrMsg = "获取信息失败,Err:" + errCategory.Error() + "categoryID 不存在:" + strconv.Itoa(categoryId)
|
|
|
+ return
|
|
|
+ }
|
|
|
+ resp.MatchTypeName = detail.MatchTypeName
|
|
|
}
|
|
|
- resp.MatchTypeName = detail.MatchTypeName
|
|
|
resp.List = list
|
|
|
resp.Paging = page
|
|
|
br.Ret = 200
|
|
@@ -204,17 +206,27 @@ func (this *TacticsController) Detail() {
|
|
|
}
|
|
|
if strings.Contains(companyPermission, articlePermissionPermissionName) {
|
|
|
hasPermission = 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
|
|
|
recordCount, _ := models.GetNoAddStoptimeArticleCount(uid, articleId)
|
|
|
- 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
|
|
|
+ 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
|