瀏覽代碼

Merge remote-tracking branch 'origin/small_298'

Roc 1 月之前
父節點
當前提交
27b21bdf96
共有 2 個文件被更改,包括 2 次插入2 次删除
  1. 1 1
      controller/public.go
  2. 1 1
      models/tables/banner/query.go

+ 1 - 1
controller/public.go

@@ -465,7 +465,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)

+ 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
 }