This commit is contained in:
richboo111
2022-11-02 10:17:39 +08:00
parent c6e934de1b
commit 1004ce21cf

View File

@@ -149,7 +149,7 @@ func CreateOrUpdateAll(vendorOrgCode string, storeID, vendorStoreID int64) (stri
if bindFreightIDs == 0 { //1未查询到绑定信息不算错误 if bindFreightIDs == 0 { //1未查询到绑定信息不算错误
//创建 //创建
if freightTemplateID, err := CreateFreightTemplate(int(storeID)); err != nil || freightTemplateID == 0 || utils.IsNil(freightTemplateID) { if freightTemplateID, err := CreateFreightTemplate(int(storeID)); err != nil || freightTemplateID == 0 || utils.IsNil(freightTemplateID) {
errList.AddErr(fmt.Errorf("创建运费模板失败%v", err)) errList.AddErr(fmt.Errorf("创建运费模板失败:%v", err))
} else { //绑定 } else { //绑定
if err = ShopBindStoreFreight(vendorOrgCode, vendorStoreID, freightTemplateID); err != nil { if err = ShopBindStoreFreight(vendorOrgCode, vendorStoreID, freightTemplateID); err != nil {
errList.AddErr(fmt.Errorf("京西菜市门店:%d 平台门店:%d 绑定运费模板:%d 失败:%v", storeID, vendorStoreID, freightTemplateID, err)) errList.AddErr(fmt.Errorf("京西菜市门店:%d 平台门店:%d 绑定运费模板:%d 失败:%v", storeID, vendorStoreID, freightTemplateID, err))
@@ -549,8 +549,8 @@ func ShopBindStoreFreight(vendorOrgCode string, storeID, freightID int64) error
// /shop/getStoreFreight 获取门店绑定运费模板 // /shop/getStoreFreight 获取门店绑定运费模板
func GetStoreFreight(vendorOrgCode string, storeID int64) (int64, error) { func GetStoreFreight(vendorOrgCode string, storeID int64) (int64, error) {
resp, err := getAPI(vendorOrgCode, int(storeID), "").GetStoreFreight(storeID) resp, err := getAPI(vendorOrgCode, int(storeID), "").GetStoreFreight(storeID)
if err != nil { if err != nil || len(resp) == 0 {
return 0, err return 0, errors.New(fmt.Sprintf("获取门店绑定运费模板失败:%v", err))
} }
return resp[0], nil return resp[0], nil
} }