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.*")
|
Select("i.*")
|
||||||
countQuery := ir.ds.
|
countQuery := ir.ds.
|
||||||
From(goqu.T("invoice").As("i")).
|
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("*"))
|
Select(goqu.COUNT("*"))
|
||||||
|
|
||||||
if pid != nil && len(*pid) > 0 {
|
if pid != nil && len(*pid) > 0 {
|
||||||
|
@ -76,8 +77,10 @@ func (ir _InvoiceRepository) ListInvoice(pid *string, startDate, endDate *types.
|
||||||
if endDate != nil {
|
if endDate != nil {
|
||||||
queryRange.SetUpper(endDate.ToEndingOfDate())
|
queryRange.SetUpper(endDate.ToEndingOfDate())
|
||||||
}
|
}
|
||||||
invoiceQuery = invoiceQuery.Where(goqu.L("i.issued_at <@ ?", queryRange))
|
if !queryRange.IsEmptyOrWild() {
|
||||||
countQuery = countQuery.Where(goqu.L("i.issued_at <@ ?", queryRange))
|
invoiceQuery = invoiceQuery.Where(goqu.L("i.issued_at <@ ?", queryRange))
|
||||||
|
countQuery = countQuery.Where(goqu.L("i.issued_at <@ ?", queryRange))
|
||||||
|
}
|
||||||
|
|
||||||
startRow := (page - 1) * config.ServiceSettings.ItemsPageSize
|
startRow := (page - 1) * config.ServiceSettings.ItemsPageSize
|
||||||
invoiceQuery = invoiceQuery.
|
invoiceQuery = invoiceQuery.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user