审核门店

This commit is contained in:
苏尹岚
2020-09-24 09:49:18 +08:00
parent 893ff3bd35
commit 3466a5fccd

View File

@@ -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()
}