...
|
...
|
@@ -58,7 +58,8 @@ func (dao *CreditAccountDao) DividendsStatistics(queryOptions map[string]interfa |
|
|
creditAccount := new(models.CreditAccount)
|
|
|
query := dao.transactionContext.PgTx.Model(creditAccount)
|
|
|
query.ColumnExpr(`sum(settlement_amount) total`)
|
|
|
query.ColumnExpr(`sum((case when payment_status = 1 then actually_paid_amount else 0 end)) paid`)
|
|
|
query.ColumnExpr(`sum((case when payment_status = 2 then actually_paid_amount else 0 end)) paid`)
|
|
|
query.ColumnExpr(`sum((case when payment_status = 1 then settlement_amount else 0 end)) unpaid`)
|
|
|
query.ColumnExpr(`sum((case when settlement_time is not null then settlement_amount else 0 end)) accounted `)
|
|
|
if v, ok := queryOptions["beginTime"]; ok && !(v.(time.Time).IsZero()) {
|
|
|
query.Where(`created_at>? `, queryOptions["beginTime"])
|
...
|
...
|
|