File tree Expand file tree Collapse file tree 2 files changed +8
-7
lines changed
Expand file tree Collapse file tree 2 files changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -175,12 +175,6 @@ func ListHoles(c *fiber.Ctx) error {
175175 if err != nil {
176176 return err
177177 }
178- if query .Size == 0 {
179- query .Size = query .Size0
180- }
181- if query .Offset .IsZero () {
182- query .Offset = query .Offset0
183- }
184178
185179 var holes Holes
186180 err = DB .Transaction (func (tx * gorm.DB ) error {
Original file line number Diff line number Diff line change @@ -36,8 +36,15 @@ type ListOldModel struct {
3636}
3737
3838func (q * ListOldModel ) SetDefaults () {
39+ if q .Size == 0 {
40+ q .Size = q .Size0
41+ }
3942 if q .Offset .IsZero () {
40- q .Offset = common.CustomTime {Time : time .Now ()}
43+ if q .Offset0 .IsZero () {
44+ q .Offset = common.CustomTime {Time : time .Now ()}
45+ } else {
46+ q .Offset = q .Offset0
47+ }
4148 }
4249 if q .CreatedStart == nil {
4350 q .CreatedStart = & common.CustomTime {Time : time.Time {}} // 默认值为零时间
You can’t perform that action at this time.
0 commit comments