|
@@ -111,10 +111,10 @@ func (dao *CreditAccountDao) CooperationUsersDividendsStatistics(queryOptions ma |
|
@@ -111,10 +111,10 @@ func (dao *CreditAccountDao) CooperationUsersDividendsStatistics(queryOptions ma |
111
|
query.ColumnExpr(`sum((case when payment_status = 1 then settlement_amount else 0 end)) un_paid_amount`)
|
111
|
query.ColumnExpr(`sum((case when payment_status = 1 then settlement_amount else 0 end)) un_paid_amount`)
|
112
|
query.ColumnExpr(`max(participator->>'userId') user_id`)
|
112
|
query.ColumnExpr(`max(participator->>'userId') user_id`)
|
113
|
query.ColumnExpr(`max(participator#>>'{userInfo,userName}') user_name`)
|
113
|
query.ColumnExpr(`max(participator#>>'{userInfo,userName}') user_name`)
|
114
|
- if _, ok := queryOptions["beginTime"]; ok && !queryOptions["beginTime"].(time.Time).IsZero() {
|
|
|
115
|
- query.Where(`created_at>? `, queryOptions["beginTime"])
|
|
|
116
|
- query.Where(`created_at<? `, queryOptions["endTime"])
|
|
|
117
|
- }
|
114
|
+ //if _, ok := queryOptions["beginTime"]; ok && !queryOptions["beginTime"].(time.Time).IsZero() {
|
|
|
115
|
+ // query.Where(`created_at>? `, queryOptions["beginTime"])
|
|
|
116
|
+ // query.Where(`created_at<? `, queryOptions["endTime"])
|
|
|
117
|
+ //}
|
118
|
if v, ok := queryOptions["userBaseId"]; ok && v.(int64) > 0 {
|
118
|
if v, ok := queryOptions["userBaseId"]; ok && v.(int64) > 0 {
|
119
|
query.Where(fmt.Sprintf(`participator->>'userBaseId'='%v' `, v))
|
119
|
query.Where(fmt.Sprintf(`participator->>'userBaseId'='%v' `, v))
|
120
|
}
|
120
|
}
|
|
@@ -130,6 +130,12 @@ func (dao *CreditAccountDao) CooperationUsersDividendsStatistics(queryOptions ma |
|
@@ -130,6 +130,12 @@ func (dao *CreditAccountDao) CooperationUsersDividendsStatistics(queryOptions ma |
130
|
if v, ok := queryOptions["endTime"]; ok && !v.(time.Time).IsZero() {
|
130
|
if v, ok := queryOptions["endTime"]; ok && !v.(time.Time).IsZero() {
|
131
|
query.Where("created_at < ?", v)
|
131
|
query.Where("created_at < ?", v)
|
132
|
}
|
132
|
}
|
|
|
133
|
+ if v, ok := queryOptions["paymentBeginTime"]; ok && !(v.(time.Time).IsZero()) {
|
|
|
134
|
+ query.Where(`payment_time>=? `, queryOptions["paymentBeginTime"])
|
|
|
135
|
+ }
|
|
|
136
|
+ if v, ok := queryOptions["paymentEndTime"]; ok && !(v.(time.Time).IsZero()) {
|
|
|
137
|
+ query.Where(`payment_time<? `, queryOptions["paymentEndTime"])
|
|
|
138
|
+ }
|
133
|
if v, ok := queryOptions["cooperationContractNumbers"]; ok && len(v.([]string)) > 0 {
|
139
|
if v, ok := queryOptions["cooperationContractNumbers"]; ok && len(v.([]string)) > 0 {
|
134
|
//query.Where("cooperation_contract_number in (?)", pg.In(v))
|
140
|
//query.Where("cooperation_contract_number in (?)", pg.In(v))
|
135
|
query.Where(domain.ConditionInContractNumbers(v.([]string)))
|
141
|
query.Where(domain.ConditionInContractNumbers(v.([]string)))
|