From ad6b5f31443955ffd9533ab421b3c741acc70581 Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Tue, 9 May 2023 14:30:05 +0800 Subject: [PATCH] test --- db/db_mall_ord_capital_pool_total.go | 4 ++-- rule/self_buy_global.go | 35 +++++++++++++++++----------- 2 files changed, 24 insertions(+), 15 deletions(-) diff --git a/db/db_mall_ord_capital_pool_total.go b/db/db_mall_ord_capital_pool_total.go index 5227d17..26966cb 100644 --- a/db/db_mall_ord_capital_pool_total.go +++ b/db/db_mall_ord_capital_pool_total.go @@ -6,9 +6,9 @@ import ( "xorm.io/xorm" ) -func GetMaxPrice(eg *xorm.Engine, uid string) *model.MallOrdCapitalPoolTotal { +func GetMaxPrice(eg *xorm.Engine, uid string, price float64) *model.MallOrdCapitalPoolTotal { var data model.MallOrdCapitalPoolTotal - get, err := eg.Where("uid=? and type=?", uid, 0).Get(&data) + get, err := eg.Where("uid=? and type=? and other_price= minMoney { //如果超过了498 + leavePrice = sum - minMoney + if leavePrice > 0 { + getPrice(eg, req, minMoney, leavePrice) + } + leavePrice = minMoney - zhios_order_relate_utils.StrToFloat64(max.OtherPrice) + max.Num = 1 + } + max.LeavePrice = zhios_order_relate_utils.Float64ToStrByPrec(zhios_order_relate_utils.StrToFloat64(max.LeavePrice)+leavePrice, 3) + max.OtherPrice = zhios_order_relate_utils.Float64ToStrByPrec(zhios_order_relate_utils.StrToFloat64(max.OtherPrice)+leavePrice, 3) + max.UpdateTime = time.Now() + eg.Where("id=?", max.Id).AllCols().Update(max) + } +} func Pool(eg *xorm.Engine, price string) error { if zhios_order_relate_utils.StrToFloat64(price) == 0 {