This commit is contained in:
苏尹岚
2021-01-06 16:42:00 +08:00
parent 007fdd7342
commit 126b8679fe

View File

@@ -154,6 +154,9 @@ func PublishJob(ctx *jxcontext.Context, jobExt *model.JobExt) (errCode string, e
}
if job.Address != "" && (job.Lng == 0 || job.Lat == 0) {
lng, lat, _ := api.AutonaviAPI.GetCoordinateFromAddress(job.Address, "")
if lng == 0 || lat == 0 {
return errCode, fmt.Errorf("请填写完整且正确的门店地址!")
}
job.Lng = jxutils.StandardCoordinate2Int(lng)
job.Lat = jxutils.StandardCoordinate2Int(lat)
}