浏览代码

test

tags/v4.3.1
huangjiajun 1年前
父节点
当前提交
565c565af0
共有 1 个文件被更改,包括 4 次插入1 次删除
  1. +4
    -1
      rule/self_buy_global.go

+ 4
- 1
rule/self_buy_global.go 查看文件

@@ -47,10 +47,13 @@ func AddOrder(eg *xorm.Engine, req map[string]string) {
if zhios_order_relate_utils.StrToFloat64(max.OtherPrice) > 0 {
num := int(zhios_order_relate_utils.StrToFloat64(max.OtherPrice) / onemoney)
leave = zhios_order_relate_utils.StrToFloat64(max.OtherPrice) - onemoney*float64(num)
if leave < 0 {
leave = 0
}
}
nowMoney := leave + price*capitalPoolMul
nowNum := int(nowMoney / onemoney)
max.Num = nowNum
max.Num += nowNum
max.LeavePrice = zhios_order_relate_utils.Float64ToStrByPrec(zhios_order_relate_utils.StrToFloat64(max.LeavePrice)+zhios_order_relate_utils.StrToFloat64(req["price"]), 3)
max.OtherPrice = zhios_order_relate_utils.Float64ToStrByPrec(zhios_order_relate_utils.StrToFloat64(max.OtherPrice)+zhios_order_relate_utils.StrToFloat64(req["price"]), 3)
max.UpdateTime = time.Now()


正在加载...
取消
保存