From 7b014c2c719fa890e65a427b1b7dabbfa68726de Mon Sep 17 00:00:00 2001 From: yangduo Date: Thu, 11 Jul 2024 16:26:23 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=B4=A8=E6=8A=BC=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/v1/market/marketsecondary.go | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/server/marketserver/api/v1/market/marketsecondary.go b/server/marketserver/api/v1/market/marketsecondary.go index ea3dc576..09336a8c 100644 --- a/server/marketserver/api/v1/market/marketsecondary.go +++ b/server/marketserver/api/v1/market/marketsecondary.go @@ -23,6 +23,7 @@ func (this *MarketApi) LockList(c *gin.Context) { } `json:"search"` Filter struct { ItemIds []interface{} `json:"item_ids"` + HeroRanks []interface{} `json:"hero_ranks"` } `json:"filter"` Sort struct { Fields [] struct { @@ -67,6 +68,27 @@ WHERE A.idx > %d AND A.net_id = %d AND A.last_owner_address= '%s' AND A.owner_ad inSub += ")" q5.AppendSlice(&subFilters, f5.GetDbFilter().Custom(inSub).And()) } + } + { + heroRanks := map[int32]int32{} + for _, val := range(reqJson.Filter.HeroRanks) { + rank := q5.SafeToInt32(val) + heroRanks[rank] = 1 + } + if len(heroRanks) > 0 { + inSub := `hero_quality IN (` + i := 0 + for key, _ := range(heroRanks) { + if i == 0 { + inSub += q5.ToString(key) + } else { + inSub += "," + q5.ToString(key) + } + i += 1 + } + inSub += ")" + q5.AppendSlice(&subFilters, f5.GetDbFilter().Custom(inSub).And()) + } } rspObj := struct {