|
@@ -86,7 +86,8 @@ func (this *TacticsController) List() {
|
|
for i := 0; i < lenList; i++ {
|
|
for i := 0; i < lenList; i++ {
|
|
item := list[i]
|
|
item := list[i]
|
|
list[i].Body, _ = services.GetReportContentTextSub(item.Body)
|
|
list[i].Body, _ = services.GetReportContentTextSub(item.Body)
|
|
- list[i].Abstract = html.UnescapeString(item.Abstract)
|
|
|
|
|
|
+ //list[i].Abstract = html.UnescapeString(item.Abstract)
|
|
|
|
+ list[i].Abstract, _ = services.GetReportContentTextSub(item.Abstract)
|
|
}
|
|
}
|
|
resp.List = list
|
|
resp.List = list
|
|
resp.Paging = page
|
|
resp.Paging = page
|
|
@@ -132,7 +133,7 @@ func (this *TacticsController) Detail() {
|
|
br.ErrMsg = "判断是否已申请过试用失败,Err:" + err.Error()
|
|
br.ErrMsg = "判断是否已申请过试用失败,Err:" + err.Error()
|
|
return
|
|
return
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ fmt.Println(user.CompanyId)
|
|
//`description:"1:有该行业权限,正常展示,2:无该行业权限,不存在权益客户下,3:无该品类权限,4:潜在客户,未提交过申请,5:潜在客户,已提交过申请"`
|
|
//`description:"1:有该行业权限,正常展示,2:无该行业权限,不存在权益客户下,3:无该品类权限,4:潜在客户,未提交过申请,5:潜在客户,已提交过申请"`
|
|
if user.CompanyId > 1 {
|
|
if user.CompanyId > 1 {
|
|
companyPermission, err := models.GetCompanyPermission(user.CompanyId)
|
|
companyPermission, err := models.GetCompanyPermission(user.CompanyId)
|
|
@@ -141,7 +142,6 @@ func (this *TacticsController) Detail() {
|
|
br.ErrMsg = "判断是否已申请访谈失败,Err:" + strconv.Itoa(uid) + ";articleId" + strconv.Itoa(articleId)
|
|
br.ErrMsg = "判断是否已申请访谈失败,Err:" + strconv.Itoa(uid) + ";articleId" + strconv.Itoa(articleId)
|
|
return
|
|
return
|
|
}
|
|
}
|
|
-
|
|
|
|
detail, err = models.GetArticleDetailById(articleId)
|
|
detail, err = models.GetArticleDetailById(articleId)
|
|
if err != nil {
|
|
if err != nil {
|
|
br.Msg = "获取信息失败"
|
|
br.Msg = "获取信息失败"
|
|
@@ -151,7 +151,8 @@ func (this *TacticsController) Detail() {
|
|
fmt.Println(detail.Department)
|
|
fmt.Println(detail.Department)
|
|
|
|
|
|
detail.Body = html.UnescapeString(detail.Body)
|
|
detail.Body = html.UnescapeString(detail.Body)
|
|
- detail.Abstract = html.UnescapeString(detail.Abstract)
|
|
|
|
|
|
+ //detail.Abstract = html.UnescapeString(detail.Abstract)
|
|
|
|
+ detail.Abstract, _ = services.GetReportContentTextSub(detail.Abstract)
|
|
if companyPermission == "" {
|
|
if companyPermission == "" {
|
|
if applyCount > 0 {
|
|
if applyCount > 0 {
|
|
hasPermission = 5
|
|
hasPermission = 5
|
|
@@ -162,7 +163,7 @@ func (this *TacticsController) Detail() {
|
|
goto Loop
|
|
goto Loop
|
|
} else {
|
|
} else {
|
|
hasFree = 1
|
|
hasFree = 1
|
|
- articlePermission, err := models.GetArticlePermission(detail.SubCategoryName)
|
|
|
|
|
|
+ articlePermission, err := models.GetReportPermission(detail.SubCategoryName)
|
|
if err != nil {
|
|
if err != nil {
|
|
br.Msg = "获取信息失败"
|
|
br.Msg = "获取信息失败"
|
|
br.ErrMsg = "获取报告权限失败,Err:" + err.Error() + strconv.Itoa(uid) + ";articleId" + strconv.Itoa(articleId)
|
|
br.ErrMsg = "获取报告权限失败,Err:" + err.Error() + strconv.Itoa(uid) + ";articleId" + strconv.Itoa(articleId)
|
|
@@ -170,10 +171,11 @@ func (this *TacticsController) Detail() {
|
|
}
|
|
}
|
|
if articlePermission == nil {
|
|
if articlePermission == nil {
|
|
br.Msg = "获取信息失败"
|
|
br.Msg = "获取信息失败"
|
|
- br.ErrMsg = "报告权限不存在,Err:" + err.Error() + strconv.Itoa(uid) + ";articleId" + strconv.Itoa(articleId)
|
|
|
|
|
|
+ br.ErrMsg = "报告权限不存在,Err:" + strconv.Itoa(uid) + ";articleId" + strconv.Itoa(articleId)
|
|
return
|
|
return
|
|
}
|
|
}
|
|
for _, p := range articlePermission {
|
|
for _, p := range articlePermission {
|
|
|
|
+ fmt.Println(p)
|
|
if strings.Contains(companyPermission, p.PermissionName) {
|
|
if strings.Contains(companyPermission, p.PermissionName) {
|
|
hasPermission = 1
|
|
hasPermission = 1
|
|
historyRecord := new(models.CygxArticleHistoryRecord)
|
|
historyRecord := new(models.CygxArticleHistoryRecord)
|
|
@@ -205,7 +207,7 @@ func (this *TacticsController) Detail() {
|
|
interviewApplyItem, err := models.GetArticleInterviewApply(uid, articleId)
|
|
interviewApplyItem, err := models.GetArticleInterviewApply(uid, articleId)
|
|
if err != nil && err.Error() != utils.ErrNoRow() {
|
|
if err != nil && err.Error() != utils.ErrNoRow() {
|
|
br.Msg = "获取信息失败"
|
|
br.Msg = "获取信息失败"
|
|
- br.ErrMsg = "判断是否已申请访谈失败,Err:" + strconv.Itoa(uid) + ";articleId" + strconv.Itoa(articleId)
|
|
|
|
|
|
+ br.ErrMsg = "判断是否已申请访谈失败,Err:" + err.Error() + strconv.Itoa(uid) + ";articleId" + strconv.Itoa(articleId)
|
|
return
|
|
return
|
|
}
|
|
}
|
|
|
|
|
|
@@ -217,13 +219,20 @@ func (this *TacticsController) Detail() {
|
|
sellerItem, err := models.GetSellerByCompanyId(user.CompanyId)
|
|
sellerItem, err := models.GetSellerByCompanyId(user.CompanyId)
|
|
if err != nil {
|
|
if err != nil {
|
|
br.Msg = "获取信息失败"
|
|
br.Msg = "获取信息失败"
|
|
- br.ErrMsg = "获取销售数据失败,Err:" + strconv.Itoa(uid) + ";articleId" + strconv.Itoa(articleId)
|
|
|
|
|
|
+ br.ErrMsg = "获取销售数据失败,Err:" + err.Error() + strconv.Itoa(uid) + ";articleId" + strconv.Itoa(articleId)
|
|
return
|
|
return
|
|
}
|
|
}
|
|
if sellerItem != nil {
|
|
if sellerItem != nil {
|
|
detail.SellerMobile = sellerItem.Mobile
|
|
detail.SellerMobile = sellerItem.Mobile
|
|
detail.SellerName = sellerItem.RealName
|
|
detail.SellerName = sellerItem.RealName
|
|
}
|
|
}
|
|
|
|
+ sellerList, err := models.GetSellerList(articleId)
|
|
|
|
+ if err != nil {
|
|
|
|
+ br.Msg = "获取信息失败"
|
|
|
|
+ br.ErrMsg = "获取销售数据失败,Err:" + err.Error() + strconv.Itoa(uid) + ";articleId" + strconv.Itoa(articleId)
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ detail.SellerList = sellerList
|
|
} else { //潜在客户
|
|
} else { //潜在客户
|
|
if applyCount > 0 {
|
|
if applyCount > 0 {
|
|
hasPermission = 5
|
|
hasPermission = 5
|