fix bug:page size is zero

This commit is contained in:
EUForest 2025-10-14 15:07:35 +08:00
parent 15beff410b
commit f67c2e34dc
3 changed files with 3 additions and 3 deletions

View File

@ -656,7 +656,7 @@ type (
// public announcement // public announcement
QueryAnnouncementRequest { QueryAnnouncementRequest {
Page int `form:"page"` Page int `form:"page"`
Size int `form:"size"` Size int `form:"size,default=15"`
Pinned *bool `form:"pinned"` Pinned *bool `form:"pinned"`
Popup *bool `form:"popup"` Popup *bool `form:"popup"`
} }

View File

@ -43,7 +43,7 @@ func (m *customAnnouncementModel) GetAnnouncementListByPage(ctx context.Context,
if filter.Search != "" { if filter.Search != "" {
conn = conn.Where("`title` LIKE ? OR `content` LIKE ?", "%"+filter.Search+"%", "%"+filter.Search+"%") conn = conn.Where("`title` LIKE ? OR `content` LIKE ?", "%"+filter.Search+"%", "%"+filter.Search+"%")
} }
return conn.Count(&total).Offset((page - 1) * size).Limit(size).Find(v).Error return conn.Count(&total).Offset((page - 1) * size).Limit(size).Find(&list).Error
}) })
return total, list, err return total, list, err
} }

View File

@ -1540,7 +1540,7 @@ type PurchaseOrderResponse struct {
type QueryAnnouncementRequest struct { type QueryAnnouncementRequest struct {
Page int `form:"page"` Page int `form:"page"`
Size int `form:"size"` Size int `form:"size,default=15"`
Pinned *bool `form:"pinned"` Pinned *bool `form:"pinned"`
Popup *bool `form:"popup"` Popup *bool `form:"popup"`
} }