fix(invoice):修正对于发票的检索。
This commit is contained in:
parent
b7eaaffc3a
commit
9dc846c044
|
@ -40,6 +40,7 @@ func (ir _InvoiceRepository) ListInvoice(pid *string, startDate, endDate *types.
|
|||
Select("i.*")
|
||||
countQuery := ir.ds.
|
||||
From(goqu.T("invoice").As("i")).
|
||||
Join(goqu.T("tenement").As("t"), goqu.On(goqu.I("i.tenement_id").Eq(goqu.I("t.id")))).
|
||||
Select(goqu.COUNT("*"))
|
||||
|
||||
if pid != nil && len(*pid) > 0 {
|
||||
|
@ -76,8 +77,10 @@ func (ir _InvoiceRepository) ListInvoice(pid *string, startDate, endDate *types.
|
|||
if endDate != nil {
|
||||
queryRange.SetUpper(endDate.ToEndingOfDate())
|
||||
}
|
||||
if !queryRange.IsEmptyOrWild() {
|
||||
invoiceQuery = invoiceQuery.Where(goqu.L("i.issued_at <@ ?", queryRange))
|
||||
countQuery = countQuery.Where(goqu.L("i.issued_at <@ ?", queryRange))
|
||||
}
|
||||
|
||||
startRow := (page - 1) * config.ServiceSettings.ItemsPageSize
|
||||
invoiceQuery = invoiceQuery.
|
||||
|
|
Loading…
Reference in New Issue
Block a user