|
@@ -132,9 +132,8 @@ func (this *MobileReportController) TradeList() {
|
|
|
// @Title 产业报告分类列表接口
|
|
|
// @Description 获取产业报告分类列表接口
|
|
|
// @Param ChartPermissionId query int true "分类ID"
|
|
|
-// @Param IsNewLabel query string false "是否属于新标签,1是,0否"
|
|
|
-// @Param IsDeepLabel query string false "是否属于深标签,1是,0否"
|
|
|
-// @Param OrderColumn query string false "排序字段 ,NewTime 最近更新 ,Recommend弘则推荐"
|
|
|
+// @Param DeepCover query string false "是否选择深度覆盖,1是,0否 不填默认为0"
|
|
|
+// @Param RecommendFocus query string false "是否选择推荐关注,1是,0否 不填默认为0"
|
|
|
// @Param PageSize query int true "每页数据条数"
|
|
|
// @Param CurrentIndex query int true "当前页页码,从1开始"
|
|
|
// @Success 200 {object} models.IndustrialManagementList
|
|
@@ -155,10 +154,10 @@ func (this *MobileReportController) IndustryList() {
|
|
|
ChartPermissionId, _ := this.GetInt("ChartPermissionId")
|
|
|
orderColumn := this.GetString("OrderColumn")
|
|
|
orderColumnNew := this.GetString("OrderColumn")
|
|
|
- isNewLabel := this.GetString("IsNewLabel")
|
|
|
- isDeepLabel := this.GetString("IsDeepLabel")
|
|
|
pageSize, _ := this.GetInt("PageSize")
|
|
|
currentIndex, _ := this.GetInt("CurrentIndex")
|
|
|
+ deepCover, _ := this.GetInt("DeepCover")
|
|
|
+ recommendFocus, _ := this.GetInt("RecommendFocus")
|
|
|
var orderSrt string
|
|
|
var condition string
|
|
|
var startSize int
|
|
@@ -171,16 +170,40 @@ func (this *MobileReportController) IndustryList() {
|
|
|
}
|
|
|
|
|
|
startSize = paging.StartIndex(currentIndex, pageSize)
|
|
|
- if isNewLabel == "1" {
|
|
|
- condition += ` AND is_new_label = ` + isNewLabel
|
|
|
- }
|
|
|
- if isDeepLabel == "1" {
|
|
|
- condition += ` AND is_deep_label = ` + isDeepLabel
|
|
|
- }
|
|
|
-
|
|
|
if ChartPermissionId > 0 {
|
|
|
condition += ` AND man.chart_permission_id IN (` + strconv.Itoa(ChartPermissionId) + `)`
|
|
|
}
|
|
|
+ // 深度覆盖
|
|
|
+ if deepCover == 1 {
|
|
|
+ // 查询深标签产业报告数
|
|
|
+ var deepCondition string
|
|
|
+ var deepPars []interface{}
|
|
|
+ deepCondition += ` AND man.is_deep_label = 1`
|
|
|
+ if ChartPermissionId > 0 {
|
|
|
+ deepCondition += ` AND man.chart_permission_id = ?`
|
|
|
+ deepPars = append(deepPars, ChartPermissionId)
|
|
|
+ }
|
|
|
+ industryCountList, e := models.GetIndustryArtCountByCondition(deepCondition, deepPars)
|
|
|
+ if e != nil {
|
|
|
+ br.Msg = "获取信息失败"
|
|
|
+ br.ErrMsg = "获取深标签产业报告数失败, Err: " + e.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ deepIdArr := make([]string, 0)
|
|
|
+ for i := range industryCountList {
|
|
|
+ if industryCountList[i].ArtNum > 10 {
|
|
|
+ deepIdArr = append(deepIdArr, strconv.Itoa(industryCountList[i].IndustrialManagementId))
|
|
|
+ }
|
|
|
+ }
|
|
|
+ deepIds := strings.Join(deepIdArr, ",")
|
|
|
+ if deepIds != "" {
|
|
|
+ condition = `AND man.industrial_management_id IN (` + deepIds + `)`
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 推荐关注
|
|
|
+ if recommendFocus == 1 {
|
|
|
+ condition += ` AND man.recommended_index >= 50`
|
|
|
+ }
|
|
|
|
|
|
var list []*models.IndustrialManagement
|
|
|
total, err := models.GetIndustrialManagementAllCount(condition)
|