From 4a5b0bbae2b194c0d26ca967f507716430c7d70c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Mon, 25 May 2020 13:37:14 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=AC=E4=B8=9C=E5=95=86=E5=9F=8E=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E5=9F=8E=E5=B8=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxstore/tempop/tempop.go | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/business/jxstore/tempop/tempop.go b/business/jxstore/tempop/tempop.go index 469f1eb5a..b7063bbc8 100644 --- a/business/jxstore/tempop/tempop.go +++ b/business/jxstore/tempop/tempop.go @@ -1583,9 +1583,9 @@ func UploadJdsImage(ctx *jxcontext.Context) (err error) { // } // } - var stores []*model.StoreMap + var stores []*model.Store sql := ` - SELECT a.* + SELECT b.* FROM store_map a, store b WHERE a.store_id = b.id AND a.vendor_store_id = '' AND a.vendor_id = 5 AND a.deleted_at = ? @@ -1596,17 +1596,15 @@ func UploadJdsImage(ctx *jxcontext.Context) (err error) { err = dao.GetRows(db, &stores, sql, sqlParams) result1, _ := api.JdShopAPI.GetProvince() for _, v := range stores { + place, _ := dao.GetPlaceByCode(db, v.DistrictCode) for _, vv := range result1 { - if vv.AreaID == 1 || vv.AreaID == 2 || vv.AreaID == 3 || vv.AreaID == 4 { - continue - } result2, _ := api.JdShopAPI.GetCity(vv.AreaID) for _, vvv := range result2 { result3, _ := api.JdShopAPI.GetCounty(vvv.AreaID) for _, vvvv := range result3 { - if vvvv.AreaName == v.JdsStreetName { - v.JdsStreetCode = vvvv.AreaID - dao.UpdateEntity(db, v, "JdsStreetCode") + if vvvv.AreaName == place.Name { + place.JdsCode = vvvv.AreaID + dao.UpdateEntity(db, place, "JdsCode") break } }