You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
509 B
28 lines
509 B
package income |
|
|
|
import ( |
|
"context" |
|
"time" |
|
|
|
model "go-common/app/job/main/growup/model/income" |
|
) |
|
|
|
func (s *Service) columnCharges(c context.Context, date time.Time, ch chan []*model.ColumnCharge) (err error) { |
|
defer func() { |
|
close(ch) |
|
}() |
|
var id int64 |
|
for { |
|
var charges []*model.ColumnCharge |
|
charges, err = s.dao.ColumnDailyCharge(c, date, id, _limitSize) |
|
if err != nil { |
|
return |
|
} |
|
ch <- charges |
|
if len(charges) < _limitSize { |
|
break |
|
} |
|
id = charges[len(charges)-1].ID |
|
} |
|
return |
|
}
|
|
|