fix(region): account arrears

This commit is contained in:
Qu Xuan
2021-04-26 18:02:50 +08:00
parent ef9a9b2935
commit f68afc4aa6
3 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -283,7 +283,7 @@ func (self *SAliyunProvider) GetBalance() (float64, string, error) {
}
status := api.CLOUD_PROVIDER_HEALTH_NORMAL
if balance.CreditAmount+balance.MybankCreditAmount <= 0 {
if balance.AvailableAmount <= 0 {
if balance.AvailableAmount < 0 {
status = api.CLOUD_PROVIDER_HEALTH_ARREARS
} else if balance.AvailableAmount < 100 {
status = api.CLOUD_PROVIDER_HEALTH_INSUFFICIENT
+1 -1
View File
@@ -199,7 +199,7 @@ func (self *SHuaweiProvider) GetBalance() (float64, string, error) {
return 0.0, api.CLOUD_PROVIDER_HEALTH_UNKNOWN, err
}
status := api.CLOUD_PROVIDER_HEALTH_NORMAL
if balance.AvailableAmount <= 0.0 && balance.CreditAmount <= 0.0 {
if balance.AvailableAmount < 0.0 && balance.CreditAmount < 0.0 {
status = api.CLOUD_PROVIDER_HEALTH_ARREARS
}
return balance.AvailableAmount, status, nil
+1 -1
View File
@@ -294,7 +294,7 @@ func (self *SQcloudProvider) GetBalance() (float64, string, error) {
return 0.0, api.CLOUD_PROVIDER_HEALTH_UNKNOWN, err
}
status := api.CLOUD_PROVIDER_HEALTH_NORMAL
if balance.AvailableAmount <= 0.0 {
if balance.AvailableAmount < 0.0 {
status = api.CLOUD_PROVIDER_HEALTH_ARREARS
}
return balance.AvailableAmount, status, nil