ziwen 1 year ago
parent
commit
0f8df03198
1 changed files with 2 additions and 3 deletions
  1. 2 3
      controllers/home.go

+ 2 - 3
controllers/home.go

@@ -2,7 +2,6 @@ package controllers
 
 import (
 	"encoding/json"
-	"fmt"
 	"github.com/rdlucklib/rdluck_tools/paging"
 	"hongze/hongze_cygx/models"
 	"hongze/hongze_cygx/services"
@@ -779,10 +778,10 @@ func (this *HomeController) NewList() {
 	//查询近一个月的数据
 	conditionInit = " AND publish_date  >   '" + time.Now().AddDate(0, 0, -30).Format(utils.FormatDateTime) + "'"
 	//conditionInit += `  AND source IN ('newchart')`
-	if user.CompanyId <= 1 {
+	if user.CompanyId <= 1 || totalRai == 0 {
 		condition += " AND source IN ('roadshow','article') "
 		startSize = 0
-		pageSize = utils.PageSize5
+		pageSize = 4
 	} else {
 		condition += ` AND source NOT IN ('activity','activityspecial','newchart') ` + conditionInit
 		conditionActivity, err := services.GetActivityonditionList(user, "", "", "", "1,2,3", "", 0, 0, "", 0, 1)