|
@@ -96,7 +96,7 @@ func (ptr *CooperationStatisticsService) SearchContractDividends(queryOptions ma |
|
@@ -96,7 +96,7 @@ func (ptr *CooperationStatisticsService) SearchContractDividends(queryOptions ma |
|
96
|
contracts, err = ptr.getUserContracts(request.UserBaseId, queryOptions)
|
96
|
contracts, err = ptr.getUserContracts(request.UserBaseId, queryOptions)
|
|
97
|
} else if request.OrgId > 0 {
|
97
|
} else if request.OrgId > 0 {
|
|
98
|
queryOptions["orgId"] = request.OrgId
|
98
|
queryOptions["orgId"] = request.OrgId
|
|
99
|
- contracts, err = ptr.getCompanyContracts(request.UserId, queryOptions)
|
99
|
+ contracts, err = ptr.getCompanyContracts(request.OrgId, request.UserId, queryOptions)
|
|
100
|
}
|
100
|
}
|
|
101
|
if err != nil {
|
101
|
if err != nil {
|
|
102
|
return nil, err
|
102
|
return nil, err
|
|
@@ -154,12 +154,12 @@ func (ptr *CooperationStatisticsService) getUserContracts(userBaseId int64, quer |
|
@@ -154,12 +154,12 @@ func (ptr *CooperationStatisticsService) getUserContracts(userBaseId int64, quer |
|
154
|
// getCompanyContracts 获取组织合约列表
|
154
|
// getCompanyContracts 获取组织合约列表
|
|
155
|
//
|
155
|
//
|
|
156
|
// p1 p1_desc
|
156
|
// p1 p1_desc
|
|
157
|
-func (ptr *CooperationStatisticsService) getCompanyContracts(userId int64, queryOptions map[string]interface{}) ([]*domain.CooperationContract, error) {
|
157
|
+func (ptr *CooperationStatisticsService) getCompanyContracts(orgId, userId int64, queryOptions map[string]interface{}) ([]*domain.CooperationContract, error) {
|
|
158
|
var contracts = make([]*domain.CooperationContract, 0)
|
158
|
var contracts = make([]*domain.CooperationContract, 0)
|
|
159
|
if userId == 0 {
|
159
|
if userId == 0 {
|
|
160
|
return contracts, nil
|
160
|
return contracts, nil
|
|
161
|
}
|
161
|
}
|
|
162
|
- contractNumbers, err := ptr.getRelevantContracts(map[string]interface{}{"userId": userId})
|
162
|
+ contractNumbers, err := ptr.getRelevantContracts(map[string]interface{}{"orgId": orgId, "userId": userId})
|
|
163
|
if len(contractNumbers) == 0 {
|
163
|
if len(contractNumbers) == 0 {
|
|
164
|
return contracts, nil
|
164
|
return contracts, nil
|
|
165
|
}
|
165
|
}
|