Ver Fonte

no message

xingzai há 1 ano atrás
pai
commit
457db45e22
2 ficheiros alterados com 7 adições e 3 exclusões
  1. 3 3
      controllers/home.go
  2. 4 0
      services/resource_data.go

+ 3 - 3
controllers/home.go

@@ -829,9 +829,6 @@ func (this *HomeController) NewList() {
 
 	//fmt.Println("condition:",condition)
 
-	//查询近一个月的数据
-	conditionInit = " AND publish_date  >   '" + time.Now().AddDate(0, 0, -30).Format(utils.FormatDateTime) + "'"
-
 	if tagIds != "" {
 		conditionTagIdsInit, err := services.GetConditionInitByTagIds(tagIds)
 		if err != nil {
@@ -840,6 +837,9 @@ func (this *HomeController) NewList() {
 			return
 		}
 		conditionInit += conditionTagIdsInit
+	} else {
+		//查询近一个月的数据
+		conditionInit = " AND publish_date  >   '" + time.Now().AddDate(0, 0, -30).Format(utils.FormatDateTime) + "'"
 	}
 
 	//conditionInit += `  AND source IN ('newchart')`

+ 4 - 0
services/resource_data.go

@@ -441,6 +441,10 @@ func GetResourceDataList(condition string, pars []interface{}, startSize, pageSi
 
 	for _, vList := range list {
 		for _, v := range mapItems {
+			//如果这些类型都为空,那么就不合并
+			if v.Article == nil && v.Newchart == nil && v.Roadshow == nil && v.Activity == nil && v.Activityvideo == nil && v.Activityvoice == nil && v.Activityspecial == nil && v.Researchsummary == nil && v.Minutessummary == nil && v.Meetingreviewchapt == nil && v.ProductInterior == nil && v.IndustrialResource == nil && v.ReportSelection == nil {
+				continue
+			}
 			if v.SourceId == vList.SourceId {
 				items = append(items, v)
 			}