This commit is contained in:
richboo111
2023-03-09 17:38:16 +08:00
parent a98c9517f1
commit 7d34670800
3 changed files with 23 additions and 11 deletions

View File

@@ -1,6 +1,7 @@
package tiktok_store
import (
"errors"
"fmt"
"strconv"
"strings"
@@ -172,19 +173,23 @@ func CreateFenceByStore(appOrgCode string, storeID int64) (fenceID string, err e
}
}
// 通过门店更新电子围栏
func UpdateFenceByStore(appOrgCode, outFenceID string, storeID int) error {
// 通过围栏id更新电子围栏
func UpdateFenceByStore(appOrgCode, outFenceID, storeID string) error {
var (
db *dao.DaoDB
localStore *LocalStore
vertex []warehouse_setFence_request.VerticesItem
param = &warehouse_setFence_request.WarehouseSetFenceParam{}
)
localID, err := dao.GetStoreDetail(db, utils.Str2Int(storeID), 0, "")
if err != nil {
return errors.New("获取门店id失败")
}
sqlParam := []interface{}{}
sqlStr := `SELECT t.lng,t.lat,t.delivery_range_type,t.delivery_range FROM store t`
if storeID != 0 {
if localID.Store.ID != 0 {
sqlStr += " WHERE t.id = ? "
sqlParam = append(sqlParam, storeID)
sqlParam = append(sqlParam, localID.Store.ID)
} else {
return fmt.Errorf("storeID必填")
}