浏览代码

no message

xingzai 1 年之前
父节点
当前提交
d6986382d2
共有 3 个文件被更改,包括 17 次插入2 次删除
  1. 5 1
      controllers/home.go
  2. 10 0
      controllers/tag.go
  3. 2 1
      models/cygx_tag.go

+ 5 - 1
controllers/home.go

@@ -256,6 +256,7 @@ func (this *MobileHomeController) List() {
 // @Title 首页列表接口
 // @Description 首页列表接口
 // @Param   TagIds   query   string  true       "标签选择"
+// @Param   ChartPermissionId   query   int	  false     "行业id"
 // @Param   PageSize   query   int  true       "每页数据条数"
 // @Param   CurrentIndex   query   int  true       "当前页页码,从1开始"
 // @Success 200 {object} models.HomeArtAndChartListResp
@@ -277,7 +278,7 @@ func (this *MobileHomeController) NewList() {
 	pageSize, _ := this.GetInt("PageSize")
 	currentIndex, _ := this.GetInt("CurrentIndex")
 	tagIds := this.GetString("TagIds")
-
+	chartPermissionId, _ := this.GetInt("ChartPermissionId")
 	var startSize int
 	if pageSize <= 0 {
 		pageSize = utils.PageSize20
@@ -509,6 +510,9 @@ func (this *MobileHomeController) NewList() {
 		//查询近一个月的数据
 		conditionInit = " AND publish_date  >   '" + time.Now().AddDate(0, 0, -30).Format(utils.FormatDateTime) + "'"
 	}
+	if chartPermissionId > 0 {
+		conditionInit = " AND chart_permission_id  =  " + strconv.Itoa(chartPermissionId)
+	}
 	//return
 	//conditionInit += `  AND source IN ('newchart')`
 	if user.CompanyId <= 1 {

+ 10 - 0
controllers/tag.go

@@ -72,7 +72,17 @@ func (this *TagController) TagCustomizeList() {
 			v.CheckList = append(v.CheckList, "D")
 		}
 	}
+	//var condition string
+	condition = ` AND permission_name IN ('医药','消费','科技','智造','策略') `
+	listPermission, err := models.GetChartPermissionReportAll(condition)
+	if err != nil {
+		br.Msg = "获取信息失败"
+		br.ErrMsg = "获取品种信息失败,Err:" + err.Error()
+		return
+	}
+
 	resp.List = list
+	resp.ListPermission = listPermission
 	br.Ret = 200
 	br.Success = true
 	br.Msg = "获取成功"

+ 2 - 1
models/cygx_tag.go

@@ -143,5 +143,6 @@ type CygxTagIdReq struct {
 }
 
 type CygxTagListResp struct {
-	List []*CygxTagList `description:"TagId"`
+	List           []*CygxTagList `description:"TagId"`
+	ListPermission []*ChartPermissionResp
 }