From 2937ad574c1805c44f1086acc56df6648fa1fcf2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Thu, 3 Dec 2020 11:51:18 +0800 Subject: [PATCH] storename --- business/jxstore/tempop/tempop.go | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/business/jxstore/tempop/tempop.go b/business/jxstore/tempop/tempop.go index 2e2446166..9fc40b720 100644 --- a/business/jxstore/tempop/tempop.go +++ b/business/jxstore/tempop/tempop.go @@ -1620,17 +1620,18 @@ func UploadJdsImage(ctx *jxcontext.Context) (err error) { data2, _, _ := jxutils.DownloadFileByURL(store.Licence) fileName := store.Licence[strings.LastIndex(store.Licence, "/")+1 : len(store.Licence)] url2, _ := api.JdShop2API.UploadImageNew(data2, fileName) - if strings.Contains(v.StoreName, "(") { - v.StoreName = v.StoreName[0:strings.Index(v.StoreName, "(")] + v.StoreName[strings.Index(v.StoreName, ")")+3:len(v.StoreName)] + storeName := store.Name + if strings.Contains(storeName, "(") { + storeName = storeName[0:strings.Index(storeName, "(")] + storeName[strings.Index(storeName, ")")+3:len(storeName)] } - if strings.Contains(v.StoreName, ".") { - v.StoreName = v.StoreName[0:strings.Index(v.StoreName, ".")] + v.StoreName[strings.Index(v.StoreName, ".")+1:len(v.StoreName)] + if strings.Contains(storeName, ".") { + storeName = storeName[0:strings.Index(storeName, ".")] + storeName[strings.Index(storeName, ".")+1:len(storeName)] } - if strings.Contains(v.StoreName, "-") { - v.StoreName = v.StoreName[0:strings.Index(v.StoreName, "-")] + v.StoreName[strings.Index(v.StoreName, "-")+1:len(v.StoreName)] + if strings.Contains(storeName, "-") { + storeName = storeName[0:strings.Index(storeName, "-")] + storeName[strings.Index(storeName, "-")+1:len(storeName)] } param := &jdshopapi.UpdateBasicParam{ - StoreName: "京西菜市" + strings.ReplaceAll(v.StoreName, "店", "") + "生鲜店", + StoreName: "京西菜市" + strings.ReplaceAll(storeName, "店", "") + "生鲜店", CategoryID2: 62, Coordinate: utils.Float64ToStr(jxutils.IntCoordinate2Standard(store.Lat)) + "," + utils.Float64ToStr(jxutils.IntCoordinate2Standard(store.Lng)), BussinessBeginTime: int2TimeStr(int(store.OpenTime1)),