Browse Source

隐藏所有的标签

xingzai 2 years ago
parent
commit
7766c7f9ba
4 changed files with 39 additions and 28 deletions
  1. 17 16
      controllers/report.go
  2. 11 2
      controllers/research.go
  3. 2 2
      models/industrial_management.go
  4. 9 8
      models/report.go

+ 17 - 16
controllers/report.go

@@ -1137,22 +1137,23 @@ func (this *ReportController) IsShow() {
 		return
 	}
 	var resp models.IsShow
-	resp.IsShowChart = true
-	resp.IsShowResearch = true
-	resp.IsShowList = true
-	mobile := user.Mobile
-	if mobile == "" {
-		br.Ret = 200
-		br.Success = true
-		br.Data = resp
-		return
-	}
-	total, _ := models.GetUserIsAdminCount(mobile)
-	if total > 0 {
-		resp.IsShow = true
-	}
-	resp.LinkWxExplain = utils.LINK_WX_EXPLAIN
-	resp.YanXuan_Explain = true
+
+	//resp.IsShowChart = true
+	//resp.IsShowResearch = true
+	//resp.IsShowList = true
+	//mobile := user.Mobile
+	//if mobile == "" {
+	//	br.Ret = 200
+	//	br.Success = true
+	//	br.Data = resp
+	//	return
+	//}
+	//total, _ := models.GetUserIsAdminCount(mobile)
+	//if total > 0 {
+	//	resp.IsShow = true
+	//}
+	//resp.LinkWxExplain = utils.LINK_WX_EXPLAIN
+	//resp.YanXuan_Explain = true
 	br.Ret = 200
 	br.Success = true
 	br.Data = resp

+ 11 - 2
controllers/research.go

@@ -34,7 +34,7 @@ func (this *ResearchController) NewList() {
 	//	br.Msg = "请输入分类ID"
 	//	return
 	//}
-	list, err := models.GetIndustrialManagementNewList()
+	list, err := models.GetIndustrialManagementNewList("")
 	if err != nil {
 		br.Msg = "获取信息失败"
 		br.ErrMsg = "获取品种信息失败,Err:" + err.Error()
@@ -164,7 +164,7 @@ func (this *ResearchController) HotList() {
 		return
 	}
 	newMap := make(map[int]string)
-	listNew, err := models.GetIndustrialManagementNewList()
+	listNew, err := models.GetIndustrialManagementNewList("")
 	if err != nil {
 		br.Msg = "获取信息失败"
 		br.ErrMsg = "获取产业最新信息失败,Err:" + err.Error()
@@ -444,7 +444,16 @@ func (this *ResearchController) DepartmentIdDetail() {
 			list[k].IsCollect = true
 		}
 	}
+
+	condition = ` AND a.department_id =  ` + strconv.Itoa(departmentId)
+	listIndustrial, err := models.GetIndustrialManagementNewList(condition)
+	if err != nil {
+		br.Msg = "获取信息失败"
+		br.ErrMsg = "获取品种信息失败,Err:" + err.Error()
+		return
+	}
 	resp.List = list
+	resp.ListIndustrial = listIndustrial
 	br.Ret = 200
 	br.Success = true
 	br.Msg = "获取成功"

+ 2 - 2
models/industrial_management.go

@@ -358,7 +358,7 @@ type IndustrialManagementNewList struct {
 }
 
 //近期更新主题列表
-func GetIndustrialManagementNewList() (items []*IndustrialManagementNewResp, err error) {
+func GetIndustrialManagementNewList(condition string) (items []*IndustrialManagementNewResp, err error) {
 	o := orm.NewOrm()
 	sql := `SELECT
 			m.industrial_management_id,
@@ -372,7 +372,7 @@ func GetIndustrialManagementNewList() (items []*IndustrialManagementNewResp, err
 		WHERE
 			1 = 1
 			AND a.article_type_id > 0
-			AND publish_status = 1 
+			AND publish_status = 1 ` + condition + `
 		GROUP BY
 			m.industrial_management_id 
 		ORDER BY

+ 9 - 8
models/report.go

@@ -581,14 +581,15 @@ func GetThemeDetail(userId, industrialManagementId int, condition string) (items
 
 //用户收藏榜start
 type DepartmentDetailResp struct {
-	DepartmentId int    `description:"作者Id"`
-	NickName     string `description:"作者昵称"`
-	ImgUrl       string `description:"图片链接"`
-	FllowNum     int    `description:"多少人关注"`
-	ArticleNum   int    `description:"文章数量"`
-	CollectNum   int    `description:"收藏人数"`
-	IsFllow      bool   `description:"是否关注"`
-	List         []*ArticleCollectionResp
+	DepartmentId   int    `description:"作者Id"`
+	NickName       string `description:"作者昵称"`
+	ImgUrl         string `description:"图片链接"`
+	FllowNum       int    `description:"多少人关注"`
+	ArticleNum     int    `description:"文章数量"`
+	CollectNum     int    `description:"收藏人数"`
+	IsFllow        bool   `description:"是否关注"`
+	List           []*ArticleCollectionResp
+	ListIndustrial []*IndustrialManagementNewResp
 }
 
 type DepartmentDetail struct {