浏览代码

修改总阅读次数

longyu 3 年之前
父节点
当前提交
863a428e14
共有 2 个文件被更改,包括 3 次插入11 次删除
  1. 1 10
      controllers/roadshow/calendar.go
  2. 2 1
      models/company.go

+ 1 - 10
controllers/roadshow/calendar.go

@@ -154,7 +154,6 @@ func (this *CalendarController) Accept() {
 	this.OkDetailed(nil, "保存成功")
 }
 
-
 // @Title 拒绝路演活动接口
 // @Description 拒绝路演活动接口
 // @Param	request	body roadshow.RefuseReq true "type json string"
@@ -280,16 +279,8 @@ func (this *CalendarController) CalendarDetail() {
 		for _, v := range permissionList {
 			permissionArr = append(permissionArr, v.PermissionName)
 		}
-		readMap, err := services.GetFiccCountUserViewHistoryByCompanyIds(strconv.Itoa(companyId))
-		if err != nil {
-			this.FailWithMessage("获取阅读次数失败", "获取阅读次数失败!GetRsCalendarResearcherById:"+err.Error())
-			return
-		}
 
-		readNum, ok := readMap[companyId]
-		if !ok {
-			readNum = 0
-		}
+		readNum := companyProductItem.ViewTotal
 		companyDetailView.CompanyId = companyProductItem.CompanyId
 		companyDetailView.CompanyName = companyProductItem.CompanyName
 		companyDetailView.Status = companyProductItem.Status

+ 2 - 1
models/company.go

@@ -39,6 +39,7 @@ type CompanyProduct struct {
 	LossTime            time.Time `description:"流失时间"`
 	CompanyType         string    `description:"客户类型"`
 	OpenCode            string    `description:"开放给第三方的编码,不让第三方定位我们的客户信息"`
+	ViewTotal           int       `description:"阅读总数"`
 }
 
 func GetCompanyProductByCompanyIdAndProductId(companyId, productId int) (item *CompanyProduct, err error) {
@@ -75,4 +76,4 @@ func GetCompanyProductReportPermissionList(companyId, productId int) (items []*C
 	sql := `SELECT a.*,b.permission_name,b.classify_name FROM company_report_permission a left join chart_permission b on a.chart_permission_id=b.chart_permission_id WHERE a.company_id = ? and a.product_id=? `
 	_, err = o.Raw(sql, companyId, productId).QueryRows(&items)
 	return
-}
+}