|
@@ -52,16 +52,32 @@ func (this *ReportController) TradeList() {
|
|
|
br.ErrMsg = "获取品种信息失败,Err:" + err.Error()
|
|
|
return
|
|
|
}
|
|
|
+ var condition string
|
|
|
+ var pars []interface{}
|
|
|
for k, v := range list {
|
|
|
- list[k].UpdateTime = utils.TimeRemoveHms(v.UpdateTime)
|
|
|
- count, err := models.CheckThisCategoryNewArticleIsRead(uid, v.CategoryId)
|
|
|
- if err != nil {
|
|
|
+ if v.PolymerizationId != "" {
|
|
|
+ condition = ` AND a.category_id IN(` + v.PolymerizationId + `)`
|
|
|
+ } else {
|
|
|
+ condition = ` AND a.category_id IN(` + strconv.Itoa(v.CategoryId) + `)`
|
|
|
+ }
|
|
|
+ listArticle, err := models.GetHomeList(condition, pars, 0, 1)
|
|
|
+ if err != nil && err.Error() != utils.ErrNoRow() {
|
|
|
br.Msg = "获取信息失败"
|
|
|
- br.ErrMsg = "获取帖子总数失败,Err:" + err.Error()
|
|
|
+ br.Msg = "GetHomeList,Err:" + err.Error()
|
|
|
return
|
|
|
}
|
|
|
- if count == 0 && user.CreatedTime.Before(utils.StrTimeToTime(v.UpdateTime)) && utils.StrTimeToTime(utils.OnlineTime).Before(utils.StrTimeToTime(v.UpdateTime)) {
|
|
|
- list[k].IsRed = true
|
|
|
+ if len(listArticle) > 0 {
|
|
|
+ list[k].UpdateTime = utils.StrTimeToTime(listArticle[0].PublishDate).Format(utils.FormatDate) //时间字符串格式转时间格式
|
|
|
+
|
|
|
+ count, err := models.CheckThisCategoryNewArticleIsRead(uid, v.CategoryId)
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "获取信息失败"
|
|
|
+ br.ErrMsg = "获取帖子总数失败,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if count == 0 && user.CreatedTime.Before(utils.StrTimeToTime(v.UpdateTime)) && utils.StrTimeToTime(utils.OnlineTime).Before(utils.StrTimeToTime(v.UpdateTime)) {
|
|
|
+ list[k].IsRed = true
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
resp := new(models.TradeReportMappingResp)
|
|
@@ -457,20 +473,41 @@ func (this *ReportController) List() {
|
|
|
imgUrlChartPermission = vslice[len(vslice)-1]
|
|
|
mapChartPermission[permissionName] = imgUrlChartPermission
|
|
|
}
|
|
|
+ var condition string
|
|
|
+ //var pars []interface{}
|
|
|
+ //
|
|
|
+ if detail.PolymerizationId != "" {
|
|
|
+ condition = ` AND category_id IN(` + detail.PolymerizationId + `)`
|
|
|
+ } else {
|
|
|
+ condition = ` AND category_id IN(` + strconv.Itoa(categoryId) + `)`
|
|
|
+ }
|
|
|
|
|
|
- total, err = models.GetReportIndustrialCount(categoryId, industrialManagementId)
|
|
|
+ total, err = models.GetHomeCount(condition, pars)
|
|
|
if err != nil {
|
|
|
br.Msg = "获取信息失败"
|
|
|
- br.ErrMsg = "获取帖子总数失败,Err:" + err.Error()
|
|
|
+ br.Msg = "获取帖子总数失败,Err:" + err.Error()
|
|
|
return
|
|
|
}
|
|
|
- page = paging.GetPaging(currentIndex, pageSize, total)
|
|
|
- list, err := models.GetReportIndustrialList(pars, categoryId, industrialManagementId, uid, startSize, pageSize)
|
|
|
+ list, err := models.GetHomeList(condition, pars, startSize, pageSize)
|
|
|
if err != nil {
|
|
|
br.Msg = "获取信息失败"
|
|
|
- br.ErrMsg = "获取帖子数据失败,Err:" + err.Error()
|
|
|
+ br.Msg = "获取帖子数据失败,Err:" + err.Error()
|
|
|
return
|
|
|
}
|
|
|
+
|
|
|
+ //total, err = models.GetReportIndustrialCount(categoryId, industrialManagementId)
|
|
|
+ //if err != nil {
|
|
|
+ // br.Msg = "获取信息失败"
|
|
|
+ // br.ErrMsg = "获取帖子总数失败,Err:" + err.Error()
|
|
|
+ // return
|
|
|
+ //}
|
|
|
+ page = paging.GetPaging(currentIndex, pageSize, total)
|
|
|
+ //list, err := models.GetReportIndustrialList(pars, categoryId, industrialManagementId, uid, startSize, pageSize)
|
|
|
+ //if err != nil {
|
|
|
+ // br.Msg = "获取信息失败"
|
|
|
+ // br.ErrMsg = "获取帖子数据失败,Err:" + err.Error()
|
|
|
+ // return
|
|
|
+ //}
|
|
|
//对应分类的所图片
|
|
|
detailCategoryUrl, err := models.GetConfigByCode("category_map_img_url")
|
|
|
if err != nil {
|