zhangchuanxing пре 1 дан
родитељ
комит
8371a9d74c
3 измењених фајлова са 55 додато и 4 уклоњено
  1. 5 0
      controllers/home.go
  2. 32 4
      controllers/research.go
  3. 18 0
      controllers/yanxuan_special.go

+ 5 - 0
controllers/home.go

@@ -310,6 +310,10 @@ func (this *MobileHomeController) NewList() {
 		condition += " AND chart_permission_id  =  " + strconv.Itoa(chartPermissionId)
 	}
 
+	if user.CompanyId == utils.GAO_YI_ZI_CHAN_COMPANY_ID {
+		conditionInit += ` AND source != 'yanxuanspecial'   AND IF   ( source IN('article') , chart_permission_id != 31 ,1=1 )    `
+	}
+
 	//if tagIds == "" && chartPermissionId == 0 {
 	//	//查询近一个月的数据
 	//	conditionInit += " AND publish_date  >   '" + time.Now().AddDate(0, 0, -30).Format(utils.FormatDateTime) + "'"
@@ -373,6 +377,7 @@ func (this *MobileHomeController) NewList() {
 		condition += ` OR ( source = 'activityspecial' AND source_id IN (` + utils.GetOrmInReplace(lenActivityspecialIds) + `) ` + conditionInit + ` )   `
 		pars = append(pars, activityspecialIds)
 	}
+
 	//}
 	//return
 	total, err = models.GetResourceDataCount(condition, pars)

+ 32 - 4
controllers/research.go

@@ -249,7 +249,16 @@ func (this *MobileResearchController) KolList() {
 		currentIndex = 1
 	}
 	startSize = utils.StartIndex(currentIndex, pageSize)
-
+	resp := new(models.DepartmentListResp)
+	if user.CompanyId == utils.GAO_YI_ZI_CHAN_COMPANY_ID {
+		resp.List = make([]*models.DepartmentResp, 0)
+		resp.Paging = paging.GetPaging(currentIndex, pageSize, 0)
+		br.Ret = 200
+		br.Success = true
+		br.Msg = "获取成功"
+		br.Data = resp
+		return
+	}
 	total, err := models.GetDepartmentlistCount("")
 	if err != nil {
 		br.Msg = "获取失败"
@@ -306,7 +315,7 @@ func (this *MobileResearchController) KolList() {
 			}
 		}
 	}
-	resp := new(models.DepartmentListResp)
+
 	page := paging.GetPaging(currentIndex, pageSize, total)
 	resp.Paging = page
 	resp.List = list
@@ -348,6 +357,16 @@ func (this *MobileResearchController) HotList() {
 	startSize = utils.StartIndex(currentIndex, pageSize)
 	var condition string
 	var conditionOrder string
+	resp := new(models.IndustrialManagementHotListResp)
+	if user.CompanyId == utils.GAO_YI_ZI_CHAN_COMPANY_ID {
+		resp.List = make([]*models.IndustrialManagementHotResp, 0)
+		resp.Paging = paging.GetPaging(currentIndex, pageSize, 0)
+		br.Ret = 200
+		br.Success = true
+		br.Msg = "获取成功"
+		br.Data = resp
+		return
+	}
 	articleTypeIds, err := services.GetYanXuanArticleTypeIds()
 	if err != nil {
 		br.Msg = "获取信息失败"
@@ -413,7 +432,7 @@ func (this *MobileResearchController) HotList() {
 		}
 	}
 	page := paging.GetPaging(currentIndex, pageSize, total)
-	resp := new(models.IndustrialManagementHotListResp)
+
 	resp.Paging = page
 	resp.List = list
 	br.Ret = 200
@@ -819,6 +838,16 @@ func (this *MobileResearchController) Billboard() {
 	pageSize, _ := this.GetInt("PageSize", 15)
 	var condition string
 	var pars []interface{}
+	resp := new(models.ArticleResearchListResp)
+	if user.CompanyId == utils.GAO_YI_ZI_CHAN_COMPANY_ID {
+		resp.List = make([]*models.ArticleResearchResp, 0)
+		resp.Paging = paging.GetPaging(1, pageSize, 0)
+		br.Ret = 200
+		br.Success = true
+		br.Msg = "获取成功"
+		br.Data = resp
+		return
+	}
 	articleTypeIds, err := services.GetYanXuanArticleTypeIds()
 	if err != nil {
 		br.Msg = "获取信息失败"
@@ -859,7 +888,6 @@ func (this *MobileResearchController) Billboard() {
 		return
 	}
 
-	resp := new(models.ArticleResearchListResp)
 	for _, v := range list {
 		item := models.ArticleResearchResp{
 			ArticleId:       v.ArticleId,

+ 18 - 0
controllers/yanxuan_special.go

@@ -54,6 +54,15 @@ func (this *YanxuanSpecialNoLoginController) List() {
 	}
 	startSize = utils.StartIndex(currentIndex, pageSize)
 	resp := new(models.SpecialListResp)
+	if sysUser.CompanyId == utils.GAO_YI_ZI_CHAN_COMPANY_ID {
+		resp.List = make([]*models.CygxYanxuanSpecialItem, 0)
+		resp.Paging = paging.GetPaging(currentIndex, pageSize, 0)
+		br.Ret = 200
+		br.Success = true
+		br.Msg = "获取成功"
+		br.Data = resp
+		return
+	}
 	var condition string
 	var pars []interface{}
 
@@ -1071,6 +1080,15 @@ func (this *YanxuanSpecialNoLoginController) AuthorList() {
 	}
 	startSize = utils.StartIndex(currentIndex, pageSize)
 	resp := new(models.SpecialAuthorListResp)
+	if sysUser.CompanyId == utils.GAO_YI_ZI_CHAN_COMPANY_ID {
+		resp.List = make([]*models.CygxYanxuanSpecialAuthorItem, 0)
+		resp.Paging = paging.GetPaging(currentIndex, pageSize, 0)
+		br.Ret = 200
+		br.Success = true
+		br.Msg = "获取成功"
+		br.Data = resp
+		return
+	}
 	specialAuthorCheck := services.GetYanxuanSpecialAuthorInfo(sysUser) //用户是否没开通研选专栏以及,专栏信息是否完善
 	resp.IsAuthor = specialAuthorCheck.IsAuthor
 	resp.IsImproveInformation = specialAuthorCheck.IsImproveInformation