Эх сурвалжийг харах

Merge branch 'cygx_11.1.1' of http://8.136.199.33:3000/hongze/hongze_cygx into debug

xingzai 1 жил өмнө
parent
commit
dc6947ea06

+ 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

@@ -442,6 +442,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)
 			}