...
|
...
|
@@ -59,18 +59,25 @@ func (ptr *CooperationStatisticsService) cooperationCompanyStatistics(userBaseId |
|
|
}
|
|
|
|
|
|
// 3.个人分红统计
|
|
|
creditAccountDao, _ := dao.NewCreditAccountDao(ptr.transactionContext)
|
|
|
var allDividends = &CreditAccountStatisticsResponse{}
|
|
|
if err := creditAccountDao.DividendsStatistics(map[string]interface{}{"userBaseId": userBaseId, "orgId": orgId}, allDividends); err != nil {
|
|
|
//creditAccountDao, _ := dao.NewCreditAccountDao(ptr.transactionContext)
|
|
|
//var allDividends = &CreditAccountStatisticsResponse{}
|
|
|
//if err := creditAccountDao.DividendsStatistics(map[string]interface{}{"userBaseId": userBaseId, "orgId": orgId}, allDividends); err != nil {
|
|
|
// return nil, err
|
|
|
//}
|
|
|
//allDividends.Accounting = allDividends.Total - allDividends.Accounted
|
|
|
|
|
|
creditAccountDao, _ := dao.NewDividendsEstimateDao(ptr.transactionContext)
|
|
|
var allDividends float64
|
|
|
if allDividends, err = creditAccountDao.CountDividendsEstimateDividendsAmount(map[string]interface{}{"userBaseId": userBaseId, "orgId": orgId}); err != nil {
|
|
|
return nil, err
|
|
|
}
|
|
|
allDividends.Accounting = allDividends.Total - allDividends.Accounted
|
|
|
//allDividends.Accounting = allDividends.Total - allDividends.Accounted
|
|
|
|
|
|
var ret = &cooperationCompanyStatisticsResponse{
|
|
|
OrgId: orgId,
|
|
|
CooperationProjectCount: cooperationProjectCount,
|
|
|
CooperationContractCount: cooperationContractCount,
|
|
|
DividendsIncome: utils.Round(allDividends.Accounted, 2),
|
|
|
DividendsIncome: utils.Round(allDividends, 2),
|
|
|
}
|
|
|
return ret, nil
|
|
|
}
|
...
|
...
|
|