From 462fb4058db1d5f95de90bd28aafaa9c59092660 Mon Sep 17 00:00:00 2001 From: M_Kececi Date: Fri, 19 Jun 2026 13:05:15 +0300 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- svc/routes/wholesale_campaigns.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/svc/routes/wholesale_campaigns.go b/svc/routes/wholesale_campaigns.go index 9490bbb..a7fd113 100644 --- a/svc/routes/wholesale_campaigns.go +++ b/svc/routes/wholesale_campaigns.go @@ -984,10 +984,15 @@ LIMIT 1 for itemID, tokens := range tokenByItem { sortedTokens := sortTokens(tokens) sortedIDs := sortDimIDs(idsByItem[itemID]) - if len(sortedTokens) == 0 || len(sortedTokens) != len(sortedIDs) { + if len(sortedTokens) == 0 || len(sortedIDs) == 0 { continue } - for i, token := range sortedTokens { + limit := len(sortedTokens) + if len(sortedIDs) < limit { + limit = len(sortedIDs) + } + for i := 0; i < limit; i++ { + token := sortedTokens[i] id := sortedIDs[i] if token == "" || id <= 0 { continue