Merge branch 'jdshop' of https://e.coding.net/rosydev/jx-callback into jdshop
This commit is contained in:
@@ -6092,3 +6092,7 @@ func BatchCreateFreeShipTemplate(relInfo map[string][]tiktok_store.RelInfo, ship
|
||||
}
|
||||
return "", nil
|
||||
}
|
||||
|
||||
func GetVendorStoreBind(vendorStoreId string, vendorId int) (int, error) {
|
||||
return dao.GetCodeAndIDByMeiTuan(vendorStoreId, vendorId)
|
||||
}
|
||||
|
||||
@@ -6642,7 +6642,7 @@ func SyncTiktokMainIdToLocal(ctx *jxcontext.Context, param *tiktok_store.MainSku
|
||||
func BatchSetRestockingPrice(ctx *jxcontext.Context, preData map[string][]mtwmapi.SpuData) error {
|
||||
var params []*mtwmapi.SpuData
|
||||
for k, v := range preData {
|
||||
if storeID, err := dao.GetCodeAndIDByMeiTuan(k); err != nil {
|
||||
if storeID, err := dao.GetCodeAndIDByMeiTuan(k, model.VendorIDMTWM); err != nil {
|
||||
return errors.New(fmt.Sprintf("获取京西本地门店ID失败:%v 请重试", err))
|
||||
} else {
|
||||
for _, i := range v {
|
||||
|
||||
@@ -1632,7 +1632,7 @@ func InsertIntoFreightTemplate(storeID int, vendorStoreID string, templateID, wa
|
||||
}
|
||||
|
||||
//只获取美团平台的京西storeID
|
||||
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)
|
||||
func GetCodeAndIDByMeiTuan(vendorStoreID string, vendorId int) (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, vendorId)
|
||||
return storeID, err
|
||||
}
|
||||
|
||||
@@ -126,6 +126,7 @@ func (p *PurchaseHandler) createOrUpdateStoreSkus(ctx *jxcontext.Context, storeI
|
||||
if isCreate {
|
||||
syncType = "创建商品"
|
||||
for _, storeSku := range storeSkuList { // 创建商品
|
||||
globals.SugarLogger.Debugf("=========param %s", utils.Format4Output(storeSku, false))
|
||||
// 如果当前商品,主商品id,子商品id都已经存在了,就不在创建了,主要防止,后期更新时,某些商品为创建成功,批量修改数据库再去批量创建报错(商品已创建)
|
||||
if storeSku.VendorMainId != "" && storeSku.VendorSkuID != "" && len(storeSku.VendorSkuID) == 19 {
|
||||
continue
|
||||
|
||||
Reference in New Issue
Block a user