mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-19 10:46:58 +08:00
fix(region): account arrears
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user