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