作者 陈志颖

fix:获取现金池

... ... @@ -275,7 +275,7 @@ func (cashPoolService *CashPoolService) GetCashPool(getCashPoolQuery *query.GetC
if count, activities, err := exchangeActivityRepository.Find(listExchangeCashActivityQuery); err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
} else {
if count > 1 {
if count >= 0 {
lastActivityRate = activities[0].Rate
} else { // 未查询到相关兑换活动
lastActivityRate = 0
... ... @@ -290,7 +290,7 @@ func (cashPoolService *CashPoolService) GetCashPool(getCashPoolQuery *query.GetC
if systemSuMoneyStatistics == nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "无效的公司")
}
systemUnExchangeSuMoney := systemSuMoneyStatistics["systemUnExchangeSuMoney"].(float64) // 平台未兑换素币
systemUnExchangeSuMoney, _ := strconv.ParseFloat(fmt.Sprintf("%.2f", systemSuMoneyStatistics["systemUnExchangeSuMoney"].(float64)), 64) // 平台未兑换素币
// 查找当前公司现金池
if count, cashPools, err := cashPoolRepository.Find(tool_funs.SimpleStructToMap(getCashPoolQuery)); err != nil {
... ...