This commit is contained in:
richboo111
2022-11-16 15:29:07 +08:00
parent b6fddaa53e
commit 7419670ad9
2 changed files with 7 additions and 5 deletions

View File

@@ -6644,10 +6644,10 @@ func BatchSetRestockingPrice(ctx *jxcontext.Context, preData map[string][]mtwmap
for k, v := range preData {
//获取京西平台storeID
globals.SugarLogger.Debugf("k==============%s", k)
if storeID, vendorOrgCode, err := dao.GetCodeAndIDByMeiTuan(k); err != nil {
if storeID, err := dao.GetCodeAndIDByMeiTuan(k); err != nil {
return errors.New(fmt.Sprintf("获取京西本地门店ID失败:%v 请重试", err))
} else {
globals.SugarLogger.Debugf("检查数据storeID=%d vendorOrgCode=%s", storeID, vendorOrgCode)
globals.SugarLogger.Debugf("检查数据storeID===============%d", storeID)
for _, i := range v {
param := &mtwmapi.SpuData{
AppSpuCode: i.AppSpuCode,

View File

@@ -3,6 +3,7 @@ package dao
import (
"errors"
"fmt"
"git.rosy.net.cn/jx-callback/globals"
"sort"
"strings"
"time"
@@ -1632,7 +1633,8 @@ func InsertIntoFreightTemplate(storeID int, vendorStoreID string, templateID, wa
}
//只获取美团平台的京西storeID
func GetCodeAndIDByMeiTuan(vendorStoreID string) (storeID int, vendorOrgCode string, err error) {
err = GetRow(GetDB(), &storeID, "SELECT s.store_id,s.vendor_org_code FROM store_map s WHERE s.vendor_store_id = ? AND s.vendor_id = ? ", vendorStoreID, model.VendorIDMTWM)
return storeID, vendorStoreID, err
func GetCodeAndIDByMeiTuan(vendorStoreID string) (storeID int, err error) {
err = GetRow(GetDB(), &storeID, "SELECT s.store_id FROM store_map s WHERE s.vendor_store_id = ? AND s.vendor_id = ? ", vendorStoreID, model.VendorIDMTWM)
globals.SugarLogger.Debugf("GetCodeAndIDByMeiTuan storeID===========%d", storeID)
return storeID, err
}