|
@@ -83,32 +83,27 @@ func (this *MobileReportController) TradeList() {
|
|
|
}
|
|
|
|
|
|
for k, v := range list {
|
|
|
- list[k].UpdateTime = utils.TimeRemoveHms(v.UpdateTime)
|
|
|
- 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
|
|
|
- }
|
|
|
+
|
|
|
var condition string
|
|
|
var pars []interface{}
|
|
|
|
|
|
- categoryIdSet, errCategory := models.GetdetailByCategoryIdSet(v.CategoryId)
|
|
|
- if errCategory != nil {
|
|
|
- br.Msg = "获取信息失败"
|
|
|
- br.ErrMsg = "获取信息失败,Err:" + errCategory.Error() + "categoryID 不存在:" + strconv.Itoa(v.CategoryId)
|
|
|
- return
|
|
|
- }
|
|
|
- if categoryIdSet != "" {
|
|
|
- condition = ` AND a.category_id IN(` + categoryIdSet + `)`
|
|
|
+ //categoryIdSet, errCategory := models.GetdetailByCategoryIdSet(v.CategoryId)
|
|
|
+ //if errCategory != nil {
|
|
|
+ // br.Msg = "获取信息失败"
|
|
|
+ // br.ErrMsg = "获取信息失败,Err:" + errCategory.Error() + "categoryID 不存在:" + strconv.Itoa(v.CategoryId)
|
|
|
+ // return
|
|
|
+ //}
|
|
|
+ //if categoryIdSet != "" {
|
|
|
+ // condition = ` AND a.category_id IN(` + categoryIdSet + `)`
|
|
|
+ //} else {
|
|
|
+ // condition = ` AND a.category_id IN(` + strconv.Itoa(v.CategoryId) + `)`
|
|
|
+ //}
|
|
|
+
|
|
|
+ if v.PolymerizationId != "" {
|
|
|
+ condition = ` AND a.category_id IN(` + v.PolymerizationId + `)`
|
|
|
} else {
|
|
|
condition = ` AND a.category_id IN(` + strconv.Itoa(v.CategoryId) + `)`
|
|
|
}
|
|
|
- //condition = " AND a.category_id_two = " + strconv.Itoa(v.CategoryId)
|
|
|
- //condition += " OR a.category_id = " + strconv.Itoa(v.CategoryId)
|
|
|
|
|
|
if ChartPermissionId != utils.CE_LUE_ID {
|
|
|
var pageSize int
|
|
@@ -125,6 +120,19 @@ func (this *MobileReportController) TradeList() {
|
|
|
br.Msg = "GetHomeList,Err:" + err.Error()
|
|
|
return
|
|
|
}
|
|
|
+
|
|
|
+ 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
|
|
|
+ }
|
|
|
+ }
|
|
|
list[k].ListArticle = listArticle
|
|
|
} else {
|
|
|
if mapCategory[v.CategoryId] > 0 {
|
|
@@ -134,7 +142,6 @@ func (this *MobileReportController) TradeList() {
|
|
|
}
|
|
|
}
|
|
|
resp := new(models.TradeReportMappingResp)
|
|
|
-
|
|
|
if len(list) == 0 {
|
|
|
list = make([]*models.TradeReportMapping, 0)
|
|
|
}
|
|
@@ -527,14 +534,14 @@ func (this *MobileReportController) List() {
|
|
|
//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 + `)`
|
|
|
+ //categoryIdSet, errCategory := models.GetdetailByCategoryIdSet(categoryId)
|
|
|
+ //if errCategory != nil {
|
|
|
+ // br.Msg = "获取信息失败"
|
|
|
+ // br.ErrMsg = "获取信息失败,Err:" + errCategory.Error() + "categoryID 不存在:" + strconv.Itoa(categoryId)
|
|
|
+ // return
|
|
|
+ //}
|
|
|
+ if detail.PolymerizationId != "" {
|
|
|
+ condition = ` AND category_id IN(` + detail.PolymerizationId + `)`
|
|
|
} else {
|
|
|
condition = ` AND category_id IN(` + strconv.Itoa(categoryId) + `)`
|
|
|
}
|