作者 yangfu

共创合约列表修改

1 package domain_service 1 package domain_service
2 2
3 import ( 3 import (
4 - "encoding/json"  
5 "fmt" 4 "fmt"
6 "github.com/go-pg/pg/v10" 5 "github.com/go-pg/pg/v10"
7 pgTransaction "github.com/linmadan/egglib-go/transaction/pg" 6 pgTransaction "github.com/linmadan/egglib-go/transaction/pg"
@@ -90,10 +89,10 @@ func (ptr *CooperationStatisticsService) SearchContractDividends(queryOptions ma @@ -90,10 +89,10 @@ func (ptr *CooperationStatisticsService) SearchContractDividends(queryOptions ma
90 // 1.根据个人、企业查询合约列表 89 // 1.根据个人、企业查询合约列表
91 var contracts []*domain.CooperationContract 90 var contracts []*domain.CooperationContract
92 var err error 91 var err error
93 - if _, ok := queryOptions["userBaseId"]; ok { 92 + if request.UserBaseId > 0 {
94 contracts, err = ptr.getUserContracts(queryOptions) 93 contracts, err = ptr.getUserContracts(queryOptions)
95 - } else if v, ok := queryOptions["orgId"]; ok {  
96 - queryOptions["orgId"], _ = (v.(json.Number)).Int64() 94 + } else if request.OrgId > 0 {
  95 + queryOptions["orgId"] = request.OrgId
97 contracts, err = ptr.getCompanyContracts(queryOptions) 96 contracts, err = ptr.getCompanyContracts(queryOptions)
98 } 97 }
99 if err != nil { 98 if err != nil {
@@ -152,7 +151,6 @@ func (ptr *CooperationStatisticsService) getUserContracts(queryOptions map[strin @@ -152,7 +151,6 @@ func (ptr *CooperationStatisticsService) getUserContracts(queryOptions map[strin
152 // p1 p1_desc 151 // p1 p1_desc
153 func (ptr *CooperationStatisticsService) getCompanyContracts(queryOptions map[string]interface{}) ([]*domain.CooperationContract, error) { 152 func (ptr *CooperationStatisticsService) getCompanyContracts(queryOptions map[string]interface{}) ([]*domain.CooperationContract, error) {
154 contractRepository, _ := repository.NewCooperationContractRepository(ptr.transactionContext) 153 contractRepository, _ := repository.NewCooperationContractRepository(ptr.transactionContext)
155 - // TODO: 参数查询条件  
156 _, contracts, err := contractRepository.Find(queryOptions) 154 _, contracts, err := contractRepository.Find(queryOptions)
157 return contracts, err 155 return contracts, err
158 } 156 }