From c95586944247600755712303c22aeb0a5adfb91b Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Tue, 9 May 2023 15:24:16 +0800 Subject: [PATCH] test --- rule/self_buy_global.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/rule/self_buy_global.go b/rule/self_buy_global.go index d31c76a..363c4c0 100644 --- a/rule/self_buy_global.go +++ b/rule/self_buy_global.go @@ -7,6 +7,7 @@ import ( zhios_order_relate_utils "code.fnuoos.com/go_rely_warehouse/zyos_go_order_relate_rule.git/utils" "errors" "github.com/jinzhu/copier" + "strings" "time" "xorm.io/xorm" ) @@ -229,7 +230,12 @@ func OneDoing(sess *xorm.Session, data model.MallOrdCapitalPoolTotal, oneMoney, } //剩余有钱 并且是普通商品的 还有普通商品的金额大于最小分配金额 if zhios_order_relate_utils.StrToFloat64(data.LeavePrice) > 0 && data.Type == 0 && zhios_order_relate_utils.StrToFloat64(data.OtherPrice) >= minMoney { - data.Num = int(zhios_order_relate_utils.StrToFloat64(data.LeavePrice) / minMoney) + Num := zhios_order_relate_utils.StrToFloat64(data.LeavePrice) / minMoney + if strings.Contains(zhios_order_relate_utils.Float64ToStr(Num), ".") { + data.Num = int(Num) + 1 + } else { + data.Num = int(Num) + } if data.Num == 0 { data.Num = 1 }