作者 陈志颖

Merge branch 'dev' of http://gitlab.fjmaimaimai.com/allied-creation/allied-creat…

…ion-cooperation into dev
@@ -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)))
@@ -590,8 +590,8 @@ func (ptr *CooperationStatisticsService) CompanyPaymentHistoryStatistics(queryOp @@ -590,8 +590,8 @@ func (ptr *CooperationStatisticsService) CompanyPaymentHistoryStatistics(queryOp
590 OrgId int64 `json:"orgId" valid:"Required"` 590 OrgId int64 `json:"orgId" valid:"Required"`
591 UserId int64 `json:"userId" valid:"Required"` 591 UserId int64 `json:"userId" valid:"Required"`
592 SortByActuallyPaidAmount int `json:"sortByActuallyPaidAmount" valid:"Required"` 592 SortByActuallyPaidAmount int `json:"sortByActuallyPaidAmount" valid:"Required"`
593 - BeginTime time.Time `json:"beginTime"`  
594 - EndTime time.Time `json:"endTime"` 593 + PaymentBeginTime time.Time `json:"paymentBeginTime"`
  594 + PaymentEndTime time.Time `json:"paymentEndTime"`
595 }{} 595 }{}
596 if err := LoadQueryObject(queryOptions, &request); err != nil { 596 if err := LoadQueryObject(queryOptions, &request); err != nil {
597 return nil, err 597 return nil, err
@@ -150,8 +150,8 @@ func (ptr *CooperationStatisticsService) PersonCompanyPaymentHistoryStatistics(q @@ -150,8 +150,8 @@ func (ptr *CooperationStatisticsService) PersonCompanyPaymentHistoryStatistics(q
150 UserBaseId int64 `json:"userBaseId" valid:"Required"` 150 UserBaseId int64 `json:"userBaseId" valid:"Required"`
151 OrgId int64 `json:"orgId" valid:"Required"` 151 OrgId int64 `json:"orgId" valid:"Required"`
152 SortByActuallyPaidAmount int `json:"sortByActuallyPaidAmount" valid:"Required"` 152 SortByActuallyPaidAmount int `json:"sortByActuallyPaidAmount" valid:"Required"`
153 - BeginTime time.Time `json:"paymentBeginTime"`  
154 - EndTime time.Time `json:"paymentEndTime"` 153 + PaymentBeginTime time.Time `json:"paymentBeginTime"`
  154 + PaymentEndTime time.Time `json:"paymentEndTime"`
155 }{} 155 }{}
156 if err := LoadQueryObject(queryOptions, &request); err != nil { 156 if err := LoadQueryObject(queryOptions, &request); err != nil {
157 return nil, err 157 return nil, err
@@ -45,7 +45,7 @@ func (serviceGateway *httplibBaseServiceGateway) createRequest(url string, metho @@ -45,7 +45,7 @@ func (serviceGateway *httplibBaseServiceGateway) createRequest(url string, metho
45 case "head": 45 case "head":
46 request = httplib.Head(url) 46 request = httplib.Head(url)
47 break 47 break
48 - : 48 + default:
49 request = httplib.Get(url) 49 request = httplib.Get(url)
50 } 50 }
51 return request.SetTimeout(serviceGateway.connectTimeout, serviceGateway.readWriteTimeout) 51 return request.SetTimeout(serviceGateway.connectTimeout, serviceGateway.readWriteTimeout)