作者 yangfu

统计修改

... ... @@ -102,6 +102,7 @@ func (dao *CreditAccountDao) CooperationUsersDividendsStatistics(queryOptions ma
query.ColumnExpr(`sum(good_amount_count) dividends_order_amount`)
query.ColumnExpr(`sum(settlement_amount) divides_amount`)
query.ColumnExpr(`sum((case when payment_status = 2 then actually_paid_amount else 0 end)) actually_paid_amount`)
query.ColumnExpr(`sum((case when payment_status = 1 then settlement_amount else 0 end)) un_paid_amount`)
query.ColumnExpr(`max(participator->>'userId') user_id`)
query.ColumnExpr(`max(participator#>>'{userInfo,userName}') user_name`)
if _, ok := queryOptions["beginTime"]; ok && !queryOptions["beginTime"].(time.Time).IsZero() {
... ...
... ... @@ -339,6 +339,9 @@ func (ptr *CooperationStatisticsService) GetContractDividends(queryOptions map[s
"dividendsEstimateTime": a.CreatedAt.Unix() * 1000,
"orderOrReturnedOrderNum": a.DividendsEstimateOrderNumber,
}
if a.PaymentStatus == 0 {
item["dividendsAccountStatus"] = 1
}
if v, ok := mapOrderGoods[a.OrderGoodId]; ok {
item["orderGoodName"] = v.OrderGoodName
if v.OrderGoodAmount > 0 {
... ...