|
@@ -6,6 +6,7 @@ import (
|
|
"hongze/hongze_cygx/services"
|
|
"hongze/hongze_cygx/services"
|
|
"hongze/hongze_cygx/utils"
|
|
"hongze/hongze_cygx/utils"
|
|
"html"
|
|
"html"
|
|
|
|
+ "regexp"
|
|
"strconv"
|
|
"strconv"
|
|
"strings"
|
|
"strings"
|
|
"time"
|
|
"time"
|
|
@@ -133,18 +134,22 @@ func (this *ArticleController) Detail() {
|
|
|
|
|
|
if strings.Contains(companyPermission, articlePermissionPermissionName) {
|
|
if strings.Contains(companyPermission, articlePermissionPermissionName) {
|
|
hasPermission = 1
|
|
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
|
|
|
|
- go models.AddCygxArticleHistoryRecord(historyRecord)
|
|
|
|
|
|
+ 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
|
|
|
|
+ go models.AddCygxArticleHistoryRecord(historyRecord)
|
|
|
|
+ }
|
|
} else { //无该行业权限
|
|
} else { //无该行业权限
|
|
hasPermission = 3
|
|
hasPermission = 3
|
|
}
|
|
}
|
|
|
|
+
|
|
if hasPermission == 1 {
|
|
if hasPermission == 1 {
|
|
key := "CYGX_ARTICLE_" + strconv.Itoa(articleId) + "_" + strconv.Itoa(uid)
|
|
key := "CYGX_ARTICLE_" + strconv.Itoa(articleId) + "_" + strconv.Itoa(uid)
|
|
if !utils.Rc.IsExist(key) {
|
|
if !utils.Rc.IsExist(key) {
|
|
@@ -199,6 +204,19 @@ func (this *ArticleController) Detail() {
|
|
br.ErrMsg = "获取销售数据失败,Err:" + err.Error() + strconv.Itoa(uid) + ";articleId" + strconv.Itoa(articleId)
|
|
br.ErrMsg = "获取销售数据失败,Err:" + err.Error() + strconv.Itoa(uid) + ";articleId" + strconv.Itoa(articleId)
|
|
return
|
|
return
|
|
}
|
|
}
|
|
|
|
+ if detail.ArticleId > 1000000 {
|
|
|
|
+ var hrefRegexp = regexp.MustCompile("[0-9]\\d*")
|
|
|
|
+ match := hrefRegexp.FindAllString(detail.SellerAndMobile, -1)
|
|
|
|
+ if match != nil {
|
|
|
|
+ for _, v := range match {
|
|
|
|
+ sellerAndMobile := &models.SellerRep{
|
|
|
|
+ SellerMobile: v,
|
|
|
|
+ SellerName: strings.Replace(detail.SellerAndMobile, v, "", -1),
|
|
|
|
+ }
|
|
|
|
+ sellerList = append(sellerList, sellerAndMobile)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
detail.SellerList = sellerList
|
|
detail.SellerList = sellerList
|
|
} else { //潜在客户
|
|
} else { //潜在客户
|
|
if applyCount > 0 {
|
|
if applyCount > 0 {
|
|
@@ -430,6 +448,19 @@ func (this *ArticleCommonController) Detail() {
|
|
br.ErrMsg = "获取销售数据失败,Err:" + err.Error() + ";articleId" + strconv.Itoa(detail.ArticleId)
|
|
br.ErrMsg = "获取销售数据失败,Err:" + err.Error() + ";articleId" + strconv.Itoa(detail.ArticleId)
|
|
return
|
|
return
|
|
}
|
|
}
|
|
|
|
+ if detail.ArticleId > 1000000 {
|
|
|
|
+ var hrefRegexp = regexp.MustCompile("[0-9]\\d*")
|
|
|
|
+ match := hrefRegexp.FindAllString(detail.SellerAndMobile, -1)
|
|
|
|
+ if match != nil {
|
|
|
|
+ for _, v := range match {
|
|
|
|
+ sellerAndMobile := &models.SellerRep{
|
|
|
|
+ SellerMobile: v,
|
|
|
|
+ SellerName: strings.Replace(detail.SellerAndMobile, v, "", -1),
|
|
|
|
+ }
|
|
|
|
+ sellerList = append(sellerList, sellerAndMobile)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
detail.SellerList = sellerList
|
|
detail.SellerList = sellerList
|
|
resp.Detail = detail
|
|
resp.Detail = detail
|
|
br.Ret = 200
|
|
br.Ret = 200
|