This commit is contained in:
richboo111
2022-11-01 09:56:52 +08:00
parent e4fffa9cd1
commit 1a2be86da9
3 changed files with 29 additions and 22 deletions

View File

@@ -93,14 +93,14 @@ func CreateFenceByStore(appOrgCode string, storeID int64) (fenceID string, err e
var (
db *dao.DaoDB
localStore *LocalStore
verticeses []warehouse_createFence_request.VerticesItem
vertex []warehouse_createFence_request.VerticesItem
)
sqlParam := []interface{}{
model.VendorIDDD,
}
sqlStr := ` SELECT t.lng,t.lat,t.delivery_range_type,t.delivery_range,s.vendor_store_id FROM store t
LEFT JOIN store_map s ON t.id = s.store_id
WHERE s.vendor_id= ? `
WHERE s.vendor_id = ? `
if storeID != 0 {
sqlStr += " AND t.id = ? "
sqlParam = append(sqlParam, storeID)
@@ -131,9 +131,9 @@ func CreateFenceByStore(appOrgCode string, storeID int64) (fenceID string, err e
Longitude: utils.Str2Float64(s2[0]),
Latitude: utils.Str2Float64(s2[1]),
}
verticeses = append(verticeses, vertices)
vertex = append(vertex, vertices)
}
param.FenceInfo.Polygon.Vertices = verticeses
param.FenceInfo.Polygon.Vertices = vertex
}
resp, err := getAPI(appOrgCode, 0, "").CreateFence(param)
if err != nil {