浏览代码

no message

xingzai 6 月之前
父节点
当前提交
fb6416d234
共有 2 个文件被更改,包括 7 次插入6 次删除
  1. 2 0
      models/report.go
  2. 5 6
      services/ficc_reporrt.go

+ 2 - 0
models/report.go

@@ -195,6 +195,7 @@ func GetReportAndproductIndustrylListimg(categoryId, userId, startSize, pageSize
 	o := orm.NewOrm()
 	sql := `SELECT
 			art.article_id,
+			art.report_id,
 			art.body,
 			art.annotation,
 			art.abstract,
@@ -211,6 +212,7 @@ func GetReportAndproductIndustrylListimg(categoryId, userId, startSize, pageSize
 		UNION ALL
 		SELECT
 			art.product_interior_id AS article_id,
+			0 AS report_id,
 			art.body,
 			"",
 			art.abstract,

+ 5 - 6
services/ficc_reporrt.go

@@ -250,7 +250,7 @@ func GetReportDetail(userinfo *models.WxUserItem, reportId int) (reportDetail fi
 		fmt.Println(companyPermission)
 		if companyPermission == "" {
 			if applyCount > 0 {
-				hasPermission = 5
+				hasPermission = 6
 			} else {
 				hasPermission = 2
 			}
@@ -263,9 +263,8 @@ func GetReportDetail(userinfo *models.WxUserItem, reportId int) (reportDetail fi
 			if hasPersion {
 				hasPermission = 1
 			} else { //无该行业权限
-				companyDetail, e := models.GetCompanyDetailById(userinfo.CompanyId)
-				if e == nil && companyDetail.ProductId == 1 {
-					hasPermission = 2
+				if applyCount == 0 {
+					hasPermission = 4
 				} else {
 					hasPermission = 3
 				}
@@ -283,9 +282,9 @@ func GetReportDetail(userinfo *models.WxUserItem, reportId int) (reportDetail fi
 		}
 	} else { //潜在客户
 		if applyCount > 0 {
-			hasPermission = 5
+			hasPermission = 6
 		} else {
-			hasPermission = 4
+			hasPermission = 5
 		}
 	}
 	reportDetail.HasPermission = hasPermission