From 3466a5fccda19d1d80f7e8420dfef790b2415403 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, 24 Sep 2020 09:49:18 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=A1=E6=A0=B8=E9=97=A8=E5=BA=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxstore/cms/store.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/business/jxstore/cms/store.go b/business/jxstore/cms/store.go index 468b23af0..f1084d422 100644 --- a/business/jxstore/cms/store.go +++ b/business/jxstore/cms/store.go @@ -3570,6 +3570,19 @@ func CreateStoreAudit(ctx *jxcontext.Context, storeAudit *model.StoreAudit) (err if len(storeAudits) > 0 { return fmt.Errorf("您已申请过入驻,请不要重复申请!") } + if storeAudit.Address == "" { + return fmt.Errorf("门店地址必填!") + } + if storeAudit.Lng == 0 || storeAudit.Lat == 0 { + lng, lat, _ := api.AutonaviAPI.GetCoordinateFromAddressByPage(storeAudit.Address) + if lng != 0 && lat != 0 { + storeAudit.Lng = jxutils.StandardCoordinate2Int(lng) + storeAudit.Lat = jxutils.StandardCoordinate2Int(lat) + } else { + return fmt.Errorf("请填写正确的门店地址!") + } + } + if storeAudit.UserID == "" { storeAudit.UserID = ctx.GetUserID() }