From e0418ad25ae9c423e4ee8da94877df8f1773a785 Mon Sep 17 00:00:00 2001 From: gazebo Date: Thu, 12 Sep 2019 18:24:12 +0800 Subject: [PATCH] =?UTF-8?q?-=20=E4=BF=AE=E5=A4=8DGetAndStoreCitiesShops?= =?UTF-8?q?=E4=B8=AD=E5=9F=8E=E5=B8=82=E7=BB=A7=E7=BB=AD=E7=9A=84bug?= =?UTF-8?q?=EF=BC=88=E6=89=BE=E4=B8=8D=E5=88=B0=E5=9F=8E=E5=B8=82=E7=9A=84?= =?UTF-8?q?=E6=83=85=E5=86=B5=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/netspider/netspider.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/business/netspider/netspider.go b/business/netspider/netspider.go index 7885b67b4..61d635fac 100644 --- a/business/netspider/netspider.go +++ b/business/netspider/netspider.go @@ -152,8 +152,11 @@ func GetAndStoreCitiesShops(ctx *jxcontext.Context, vendorIDs []int, cityCodeLis if err2 := dao.GetRow(db, &lastShop, sql); err2 == nil { index := -1 for k, v := range cityCodeList { - if v == lastShop.CityCode { - index = k + 1 + if v >= lastShop.CityCode { + index = k + if v == lastShop.CityCode { + index++ + } if index >= len(cityCodeList) { index = -1 }