|
@@ -242,16 +242,47 @@ func (this *MobileReportController) IndustryList() {
|
|
|
} else {
|
|
|
orderSrt = "man.recommended_index DESC,update_time DESC"
|
|
|
}
|
|
|
- if ChartPermissionId == 0 {
|
|
|
- ChartPermissionId = 20
|
|
|
- }
|
|
|
|
|
|
- list, err = models.GetIndustrialManagementAll(uid, condition, orderSrt, startSize, pageSize, isBillboard)
|
|
|
- if err != nil {
|
|
|
- br.Msg = "获取信息失败"
|
|
|
- br.ErrMsg = "获取品种信息失败,Err:" + err.Error()
|
|
|
- return
|
|
|
+ if isBillboard {
|
|
|
+ // 查询有已归类行业报告的行业IDs
|
|
|
+ activeIndustryIds, e := models.GetActiveArticleIndustryIds()
|
|
|
+ if e != nil {
|
|
|
+ br.Msg = "获取失败"
|
|
|
+ br.ErrMsg = "获取已归类行业失败, Err:" + e.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ activeIndustryLen := len(activeIndustryIds)
|
|
|
+ //topNum := pageSize
|
|
|
+ condition = ""
|
|
|
+ var parsBd []interface{}
|
|
|
+ if ChartPermissionId > 0 {
|
|
|
+ condition += ` AND man.chart_permission_id = ? `
|
|
|
+ parsBd = append(parsBd, ChartPermissionId)
|
|
|
+ }
|
|
|
+ if activeIndustryLen > 0 {
|
|
|
+ condition += ` AND man.industrial_management_id IN (` + utils.GetOrmInReplace(activeIndustryLen) + `)`
|
|
|
+ parsBd = append(parsBd, activeIndustryIds)
|
|
|
+ }
|
|
|
+ nowTime := time.Now().Local()
|
|
|
+ startTime := nowTime.AddDate(0, -1, 0)
|
|
|
+ endTime := nowTime.AddDate(0, 0, -1)
|
|
|
+ condition += ` AND idf.create_time BETWEEN ? AND ?`
|
|
|
+ parsBd = append(parsBd, startTime, endTime)
|
|
|
+ list, e = models.GetTopIndustryFollowData(0, pageSize, condition, parsBd)
|
|
|
+ if e != nil {
|
|
|
+ br.Msg = "获取失败"
|
|
|
+ br.ErrMsg = "获取关注度最高的产业数据失败, Err:" + e.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ list, err = models.GetIndustrialManagementAll(uid, condition, orderSrt, startSize, pageSize, isBillboard)
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "获取信息失败"
|
|
|
+ br.ErrMsg = "获取品种信息失败,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
list, err = services.HandleIndustryList(list, user)
|
|
|
if err != nil {
|
|
|
br.Msg = "获取信息失败"
|
|
@@ -477,8 +508,20 @@ func (this *MobileReportController) List() {
|
|
|
imgUrlChart = vslice[len(vslice)-1]
|
|
|
mapCategoryUrl[categoryIdStr] = imgUrlChart
|
|
|
}
|
|
|
- condition += ` AND category_id_two=? `
|
|
|
- pars = append(pars, categoryId)
|
|
|
+ //condition += ` AND category_id_two=? `
|
|
|
+ //pars = append(pars, categoryId)
|
|
|
+
|
|
|
+ categoryIdSet, errCategory := models.GetdetailByCategoryIdSet(categoryId)
|
|
|
+ if errCategory != nil {
|
|
|
+ br.Msg = "获取信息失败"
|
|
|
+ br.ErrMsg = "获取信息失败,Err:" + errCategory.Error() + "categoryID 不存在:" + strconv.Itoa(categoryId)
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if categoryIdSet != "" {
|
|
|
+ condition = ` AND category_id IN(` + categoryIdSet + `)`
|
|
|
+ } else {
|
|
|
+ condition = ` AND category_id IN(` + strconv.Itoa(categoryId) + `)`
|
|
|
+ }
|
|
|
|
|
|
if industrialManagementId > 0 {
|
|
|
industrialManageentList, err := models.GetIndustrialArticleGroupManagementByIndustrialManagementId(industrialManagementId)
|