作者 yangfu

统计修改

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