huangjiajun 11 miesięcy temu
rodzic
commit
0d598e624b
1 zmienionych plików z 4 dodań i 0 usunięć
  1. +4
    -0
      rule/appreciation.go

+ 4
- 0
rule/appreciation.go Wyświetl plik

@@ -3,6 +3,7 @@ package rule
import ( import (
"code.fnuoos.com/go_rely_warehouse/zyos_go_order_relate_rule.git/db/model" "code.fnuoos.com/go_rely_warehouse/zyos_go_order_relate_rule.git/db/model"
"code.fnuoos.com/go_rely_warehouse/zyos_go_order_relate_rule.git/md" "code.fnuoos.com/go_rely_warehouse/zyos_go_order_relate_rule.git/md"
zhios_order_relate_utils "code.fnuoos.com/go_rely_warehouse/zyos_go_order_relate_rule.git/utils"
"code.fnuoos.com/go_rely_warehouse/zyos_go_order_relate_rule.git/utils/cache" "code.fnuoos.com/go_rely_warehouse/zyos_go_order_relate_rule.git/utils/cache"
"errors" "errors"
"github.com/shopspring/decimal" "github.com/shopspring/decimal"
@@ -31,6 +32,9 @@ func CalcAppreciationValue(session *xorm.Session) (err error, value float64) {
if !has { if !has {
return errors.New("未查询到`增值积分资产总值`记录"), value return errors.New("未查询到`增值积分资产总值`记录"), value
} }
if zhios_order_relate_utils.StrToFloat64(appreciationBase.Sum) == 0 { //默认是1
return nil, 1
}
sum, _ := decimal.NewFromString(appreciationBase.Sum) //总资产 sum, _ := decimal.NewFromString(appreciationBase.Sum) //总资产
flowSum, _ := decimal.NewFromString(appreciationBase.FlowSum) //流通资产 flowSum, _ := decimal.NewFromString(appreciationBase.FlowSum) //流通资产
value, _ = sum.Div(flowSum).Float64() value, _ = sum.Div(flowSum).Float64()


Ładowanie…
Anuluj
Zapisz