|
@@ -253,12 +253,43 @@ func GetReportDetail(userinfo *models.WxUserItem, reportId int) (reportDetail fi
|
|
|
if hasPower {
|
|
|
hasPermission = 1
|
|
|
} else {
|
|
|
- hasPermission, e = GetUserPermissionCode(userinfo.UserId, userinfo.CompanyId)
|
|
|
+ //hasPermission, e = GetUserPermissionCode(userinfo.UserId, userinfo.CompanyId)
|
|
|
+ //if e != nil {
|
|
|
+ // err = errors.New("GetUserPermissionCode")
|
|
|
+ // return
|
|
|
+ //}
|
|
|
+ reportDetail.SellerName, reportDetail.SellerMobile, _ = GetSellerName(userinfo)
|
|
|
+ applyCount, e := models.GetApplyRecordCount(userinfo.UserId)
|
|
|
if e != nil {
|
|
|
- err = errors.New("GetUserPermissionCode")
|
|
|
+ err = errors.New("GetApplyRecordCount")
|
|
|
return
|
|
|
}
|
|
|
- reportDetail.SellerName, reportDetail.SellerMobile, _ = GetSellerName(userinfo)
|
|
|
+ if userinfo.CompanyId > 1 {
|
|
|
+ companyPermission, e := models.GetCompanyPermission(userinfo.CompanyId)
|
|
|
+ if e != nil {
|
|
|
+ err = errors.New("GetCompanyPermission")
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if companyPermission == "" {
|
|
|
+ if applyCount > 0 {
|
|
|
+ hasPermission = 6
|
|
|
+ } else {
|
|
|
+ hasPermission = 2
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if applyCount == 0 {
|
|
|
+ hasPermission = 4
|
|
|
+ } else {
|
|
|
+ hasPermission = 3
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else { //潜在客户
|
|
|
+ if applyCount > 0 {
|
|
|
+ hasPermission = 6
|
|
|
+ } else {
|
|
|
+ hasPermission = 5
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
reportDetail.HasPermission = hasPermission
|
|
|
|
|
@@ -295,6 +326,7 @@ func GetReportDetail(userinfo *models.WxUserItem, reportId int) (reportDetail fi
|
|
|
reportItem.EndImg = reportInfo.EndImg
|
|
|
reportItem.CanvasColor = reportInfo.CanvasColor
|
|
|
reportItem.ArticleId = detailArticle.ArticleId
|
|
|
+ reportItem.Disclaimer = GetConfigCodeDisclaimer()
|
|
|
|
|
|
//版头版尾样式
|
|
|
{
|