From f641886c6e0d8c75216fd73c7787317781fd61a9 Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Wed, 2 Nov 2022 21:42:36 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BD=93=E6=97=A5=E6=9C=80=E5=A4=A7=E4=BA=A4?= =?UTF-8?q?=E6=98=93=E6=AC=A1=E6=95=B0=E8=B5=B0=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/troll/api_buyorsell.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/troll/api_buyorsell.go b/modules/troll/api_buyorsell.go index c214f8572..efaca41f2 100644 --- a/modules/troll/api_buyorsell.go +++ b/modules/troll/api_buyorsell.go @@ -34,6 +34,7 @@ func (this *apiComp) BuyOrSell(session comm.IUserSession, req *pb.TrollBuyOrSell code = pb.ErrorCode_DBError return } + dayMaxCount := this.configure.GetTrollRule(comm.TrollBuyCount) for k, v := range req.Items { if v == 0 { // 过滤数量为0 的消息 continue @@ -42,7 +43,7 @@ func (this *apiComp) BuyOrSell(session comm.IUserSession, req *pb.TrollBuyOrSell if !bSell { bSell = true trolltrain.SellCount += 1 // 交易次数+1 - if trolltrain.SellCount > 5 { + if trolltrain.SellCount > dayMaxCount { code = pb.ErrorCode_TrollMaxSellCount // 达到最大交易次数 直接返回 return }