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 }