Browse Source

Merge branch 'small_298' into debug

xiziwen 1 month ago
parent
commit
26f1c69619
4 changed files with 5 additions and 4 deletions
  1. 1 1
      controller/public.go
  2. 2 2
      go.mod
  3. 1 0
      go.sum
  4. 1 1
      models/tables/banner/query.go

+ 1 - 1
controller/public.go

@@ -466,7 +466,7 @@ func BannerList(c *gin.Context) {
 	cond := " enable = 1 "
 
 	if isHomepage != 1 {
-		cond += " AND id <> 9999"
+		cond += " AND remark <> '调研合集' "
 	}
 
 	list, err := banner.GetBannerList(cond, page, limit)

+ 2 - 2
go.mod

@@ -15,6 +15,7 @@ require (
 	github.com/nosixtools/solarlunar v0.0.0-20211112060703-1b6dea7b4a19
 	github.com/olivere/elastic/v7 v7.0.32
 	github.com/op/go-logging v0.0.0-20160315200505-970db520ece7
+	github.com/qiniu/qmgo v1.1.8
 	github.com/rdlucklib/rdluck_tools v1.0.3
 	github.com/shopspring/decimal v1.3.1
 	github.com/silenceper/wechat/v2 v2.1.4
@@ -25,6 +26,7 @@ require (
 	github.com/swaggo/swag v1.8.1
 	github.com/tosone/minimp3 v1.0.1
 	github.com/wenzhenxi/gorsa v0.0.0-20220418014903-15feec0f05a6
+	go.mongodb.org/mongo-driver v1.15.0
 	golang.org/x/image v0.3.0
 	gopkg.in/gomail.v2 v2.0.0-20160411212932-81ebce5c23df
 	gorm.io/driver/mysql v1.4.5
@@ -75,7 +77,6 @@ require (
 	github.com/pelletier/go-toml v1.9.5 // indirect
 	github.com/pelletier/go-toml/v2 v2.0.5 // indirect
 	github.com/pkg/errors v0.9.1 // indirect
-	github.com/qiniu/qmgo v1.1.8 // indirect
 	github.com/sirupsen/logrus v1.9.0 // indirect
 	github.com/spf13/afero v1.9.2 // indirect
 	github.com/spf13/cast v1.5.0 // indirect
@@ -90,7 +91,6 @@ require (
 	github.com/xdg-go/scram v1.1.2 // indirect
 	github.com/xdg-go/stringprep v1.0.4 // indirect
 	github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d // indirect
-	go.mongodb.org/mongo-driver v1.15.0 // indirect
 	golang.org/x/crypto v0.17.0 // indirect
 	golang.org/x/net v0.10.0 // indirect
 	golang.org/x/sync v0.1.0 // indirect

+ 1 - 0
go.sum

@@ -533,6 +533,7 @@ golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
 golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
 golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
 golang.org/x/mod v0.8.0 h1:LUYupSeNrTNCGzR/hVBk2NHZO4hXcVaW1k4Qx7rjPx8=
+golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
 golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
 golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
 golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=

+ 1 - 1
models/tables/banner/query.go

@@ -4,7 +4,7 @@ import "hongze/hongze_yb/global"
 
 // GetBannerList
 func GetBannerList(cond string, page, limit int) (list []*Banner, err error) {
-	err = global.DEFAULT_MYSQL.Where(cond).Limit(limit).Offset((page - 1) * limit).Find(&list).Error
+	err = global.DEFAULT_MYSQL.Where(cond).Order("create_time desc").Limit(limit).Offset((page - 1) * limit).Find(&list).Error
 	return
 }