瀏覽代碼

我的收藏未绑定手机号出参字段添加

xingzai 2 年之前
父節點
當前提交
81e7ba38c2
共有 4 個文件被更改,包括 16 次插入5 次删除
  1. 8 2
      controllers/chart.go
  2. 2 0
      controllers/report.go
  3. 3 2
      models/chart.go
  4. 3 1
      models/report.go

+ 8 - 2
controllers/chart.go

@@ -58,9 +58,16 @@ func (this *ChartController) Collection() {
 		return
 	}
 	mobile := user.Mobile
+	resp := new(models.HomeChartListItem)
 	if mobile == "" {
-		br.Msg = "请绑定手机号!"
+		br.Ret = 200
+		br.Success = true
+		br.Msg = "获取成功"
+		br.Data = resp
+		resp.IsBindingMobile = false
 		return
+	} else {
+		resp.IsBindingMobile = true
 	}
 	pageSize, _ := this.GetInt("PageSize")
 	currentIndex, _ := this.GetInt("CurrentIndex")
@@ -78,7 +85,6 @@ func (this *ChartController) Collection() {
 		return
 	}
 	page := paging.GetPaging(currentIndex, pageSize, total)
-	resp := new(models.HomeChartListItem)
 	resp.List = list
 	resp.Paging = page
 	br.Ret = 200

+ 2 - 0
controllers/report.go

@@ -1146,6 +1146,8 @@ func (this *ReportController) IsShow() {
 	if total > 0 {
 		resp.IsShow = true
 	}
+	resp.IsShowChart = true
+	resp.IsShowResearch = true
 	br.Ret = 200
 	br.Success = true
 	br.Data = resp

+ 3 - 2
models/chart.go

@@ -147,8 +147,9 @@ type HomeChartListResp struct {
 }
 
 type HomeChartListItem struct {
-	Paging *paging.PagingItem
-	List   []*HomeChartListResp `description:"图表列表"`
+	IsBindingMobile bool `description:"是否绑定过手机号"`
+	Paging          *paging.PagingItem
+	List            []*HomeChartListResp `description:"图表列表"`
 }
 
 type ChartCollectReq struct {

+ 3 - 1
models/report.go

@@ -217,7 +217,9 @@ func GetWhichDepartmentCount(condition string) (count int, err error) {
 }
 
 type IsShow struct {
-	IsShow bool `description:"是否展示"`
+	IsShow         bool `description:"是否展示"`
+	IsShowResearch bool `description:"研选是否展示限免"`
+	IsShowChart    bool `description:"图表是否展示限免"`
 }
 
 //获取用户是否有查看权限