...
|
...
|
@@ -111,10 +111,10 @@ func (dao *CreditAccountDao) CooperationUsersDividendsStatistics(queryOptions ma |
|
|
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() {
|
|
|
query.Where(`created_at>? `, queryOptions["beginTime"])
|
|
|
query.Where(`created_at<? `, queryOptions["endTime"])
|
|
|
}
|
|
|
//if _, ok := queryOptions["beginTime"]; ok && !queryOptions["beginTime"].(time.Time).IsZero() {
|
|
|
// query.Where(`created_at>? `, queryOptions["beginTime"])
|
|
|
// query.Where(`created_at<? `, queryOptions["endTime"])
|
|
|
//}
|
|
|
if v, ok := queryOptions["userBaseId"]; ok && v.(int64) > 0 {
|
|
|
query.Where(fmt.Sprintf(`participator->>'userBaseId'='%v' `, v))
|
|
|
}
|
...
|
...
|
@@ -130,6 +130,12 @@ func (dao *CreditAccountDao) CooperationUsersDividendsStatistics(queryOptions ma |
|
|
if v, ok := queryOptions["endTime"]; ok && !v.(time.Time).IsZero() {
|
|
|
query.Where("created_at < ?", v)
|
|
|
}
|
|
|
if v, ok := queryOptions["paymentBeginTime"]; ok && !(v.(time.Time).IsZero()) {
|
|
|
query.Where(`payment_time>=? `, queryOptions["paymentBeginTime"])
|
|
|
}
|
|
|
if v, ok := queryOptions["paymentEndTime"]; ok && !(v.(time.Time).IsZero()) {
|
|
|
query.Where(`payment_time<? `, queryOptions["paymentEndTime"])
|
|
|
}
|
|
|
if v, ok := queryOptions["cooperationContractNumbers"]; ok && len(v.([]string)) > 0 {
|
|
|
//query.Where("cooperation_contract_number in (?)", pg.In(v))
|
|
|
query.Where(domain.ConditionInContractNumbers(v.([]string)))
|
...
|
...
|
|