1
This commit is contained in:
@@ -450,7 +450,6 @@ func syncStoreSkuNew(ctx *jxcontext.Context, parentTask tasksch.ITask, causeFlag
|
|||||||
var skus []*dao.StoreSkuSyncInfo
|
var skus []*dao.StoreSkuSyncInfo
|
||||||
if isFull {
|
if isFull {
|
||||||
skus, err = dao.GetFullStoreSkus(db, vendorID, storeID)
|
skus, err = dao.GetFullStoreSkus(db, vendorID, storeID)
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
skus, err = dao.GetStoreSkus(db, vendorID, storeID, skuIDs)
|
skus, err = dao.GetStoreSkus(db, vendorID, storeID, skuIDs)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -568,7 +568,7 @@ func GetStoreSkus2(db *DaoDB, vendorID, storeID int, skuIDs []int, mustDirty boo
|
|||||||
%s vendor_sku_id, t1.%s_sync_status sku_sync_status, t1.%s_price vendor_price, t1.%s_lock_time lock_time,t1.vendor_sku_attr_id,t1.vendor_main_id,
|
%s vendor_sku_id, t1.%s_sync_status sku_sync_status, t1.%s_price vendor_price, t1.%s_lock_time lock_time,t1.vendor_sku_attr_id,t1.vendor_main_id,
|
||||||
t1.store_id, t1.deleted_at bind_deleted_at,t1.status_sale_begin,t1.status_sale_end, t1.jds_ware_id, t1.stock, t1.mt_ladder_box_price,
|
t1.store_id, t1.deleted_at bind_deleted_at,t1.status_sale_begin,t1.status_sale_end, t1.jds_ware_id, t1.stock, t1.mt_ladder_box_price,
|
||||||
t2.*,
|
t2.*,
|
||||||
t3.id name_id, t3.prefix, t3.name, t3.unit, t3.upc, t3.status name_status, t3.category_id name_category_id, t3.yb_name_suffix,
|
t3.id name_id, t3.prefix, t3.name, t3.unit, t3.upc, t3.status name_status, t3.category_id name_category_id, t3.yb_name_suffix,t3.tiktok_attribute,
|
||||||
t3.jds_stock_switch, t3.preparation_time, t3.img_watermark, t3.ex_vendor_id, t3.img img_origin,
|
t3.jds_stock_switch, t3.preparation_time, t3.img_watermark, t3.ex_vendor_id, t3.img img_origin,
|
||||||
IF(t11.%s <> '', t11.%s, t3.img) img,
|
IF(t11.%s <> '', t11.%s, t3.img) img,
|
||||||
IF(t12.%s <> '', t12.%s, t3.img2) img2,
|
IF(t12.%s <> '', t12.%s, t3.img2) img2,
|
||||||
|
|||||||
@@ -205,6 +205,7 @@ type SkuName struct {
|
|||||||
BestSeller int `json:"bestSeller"` //畅销品 0不是 1是
|
BestSeller int `json:"bestSeller"` //畅销品 0不是 1是
|
||||||
Video string `json:"video"` //商品视频地址
|
Video string `json:"video"` //商品视频地址
|
||||||
VideoID string `orm:"column(video_id)" json:"videoID"` //商品视频美团ID
|
VideoID string `orm:"column(video_id)" json:"videoID"` //商品视频美团ID
|
||||||
|
TiktokAttribute string `orm:"column(tiktok_attribute);size(512)" json:"tiktok_attribute"` //抖音分类属性的存储
|
||||||
}
|
}
|
||||||
|
|
||||||
func (*SkuName) TableUnique() [][]string {
|
func (*SkuName) TableUnique() [][]string {
|
||||||
|
|||||||
@@ -306,12 +306,12 @@ func (p *PurchaseHandler) createOrUpdateStoreSkus(ctx *jxcontext.Context, storeI
|
|||||||
// spec_prices
|
// spec_prices
|
||||||
param.SpecPrices = GetSpecPrices(param.Specs, vendorStoreID, 0, storeSku)
|
param.SpecPrices = GetSpecPrices(param.Specs, vendorStoreID, 0, storeSku)
|
||||||
// ProductFormatNew 获取商品属性
|
// ProductFormatNew 获取商品属性
|
||||||
productFormatNew, err := GetProductFormatNew(param.CategoryLeafId, storeDetail.VendorOrgCode)
|
//productFormatNew, err := GetProductFormatNew(param.CategoryLeafId, storeDetail.VendorOrgCode)
|
||||||
globals.SugarLogger.Debugf("er=====productFormatNew=========%s", productFormatNew)
|
//globals.SugarLogger.Debugf("er=====productFormatNew=========%s", productFormatNew)
|
||||||
if err != nil {
|
//if err != nil {
|
||||||
return nil, err
|
// return nil, err
|
||||||
}
|
//}
|
||||||
param.ProductFormatNew = productFormatNew
|
//param.ProductFormatNew = productFormatNew
|
||||||
|
|
||||||
// 获取品牌
|
// 获取品牌
|
||||||
param.StandardBrandId, err = api.GetSkuBrand(param.CategoryLeafId)
|
param.StandardBrandId, err = api.GetSkuBrand(param.CategoryLeafId)
|
||||||
@@ -431,11 +431,11 @@ func (p *PurchaseHandler) createOrUpdateStoreSkus(ctx *jxcontext.Context, storeI
|
|||||||
// spec_prices
|
// spec_prices
|
||||||
param.SpecPrices = GetSpecPrices(param.Specs, vendorStoreID, utils.Str2Int64(storeSku.VendorSkuID), storeSku)
|
param.SpecPrices = GetSpecPrices(param.Specs, vendorStoreID, utils.Str2Int64(storeSku.VendorSkuID), storeSku)
|
||||||
// ProductFormatNew 获取商品属性
|
// ProductFormatNew 获取商品属性
|
||||||
productFormatNew, err := GetProductFormatNew(param.CategoryLeafId, storeDetail.VendorOrgCode)
|
//productFormatNew, err := GetProductFormatNew(param.CategoryLeafId, storeDetail.VendorOrgCode)
|
||||||
if err != nil {
|
//if err != nil {
|
||||||
return nil, err
|
// return nil, err
|
||||||
}
|
//}
|
||||||
param.ProductFormatNew = productFormatNew
|
//param.ProductFormatNew = productFormatNew
|
||||||
|
|
||||||
// 获取品牌
|
// 获取品牌
|
||||||
//brandID, err := api.GetSkuBrand(param.CategoryLeafId)
|
//brandID, err := api.GetSkuBrand(param.CategoryLeafId)
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import (
|
|||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
freightTemplate_create_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/freightTemplate_create/request"
|
freightTemplate_create_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/freightTemplate_create/request"
|
||||||
|
product_getCatePropertyV2_response "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/product_getCatePropertyV2/response"
|
||||||
shop_bindStoreFreight_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/shop_bindStoreFreight/request"
|
shop_bindStoreFreight_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/shop_bindStoreFreight/request"
|
||||||
shop_bindStoreSaleLimit_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/shop_bindStoreSaleLimit/request"
|
shop_bindStoreSaleLimit_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/shop_bindStoreSaleLimit/request"
|
||||||
trade_createTradeLimitTemplate_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/trade_createTradeLimitTemplate/request"
|
trade_createTradeLimitTemplate_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/trade_createTradeLimitTemplate/request"
|
||||||
@@ -125,30 +126,31 @@ func GetDeliveryTemp(api *tiktokShop.API, vendorStoreID string, storeDetail *dao
|
|||||||
}
|
}
|
||||||
|
|
||||||
// GetProductFormatNew 获取物品属性
|
// GetProductFormatNew 获取物品属性
|
||||||
func GetProductFormatNew(categoryLeftId int64, vendorOrgCode string) (string, error) {
|
func GetProductFormatNew(categoryLeftId int64, vendorOrgCode string) (*product_getCatePropertyV2_response.ProductGetCatePropertyV2Response, error) {
|
||||||
category, err := getAPI(vendorOrgCode, 0, "").GetCatePropertyV2(categoryLeftId)
|
category, err := getAPI(vendorOrgCode, 0, "").GetCatePropertyV2(categoryLeftId)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", err
|
return nil, err
|
||||||
}
|
}
|
||||||
format := make(map[string][]*tiktokShop.ProductFormatNewList, 0)
|
return category, nil
|
||||||
for _, v := range category.Data.Data {
|
//format := make(map[string][]*tiktokShop.ProductFormatNewList, 0)
|
||||||
if v.Required != 1 { // 必填属性必须填写
|
//for _, v := range category.Data.Data {
|
||||||
continue
|
// if v.Required != 1 { // 必填属性必须填写
|
||||||
}
|
// continue
|
||||||
for _, d := range v.Options {
|
// }
|
||||||
formateNew := &tiktokShop.ProductFormatNewList{
|
// for _, d := range v.Options {
|
||||||
Value: utils.Str2Int64(d.Value),
|
// formateNew := &tiktokShop.ProductFormatNewList{
|
||||||
Name: d.Name,
|
// Value: utils.Str2Int64(d.Value),
|
||||||
DiyType: v.DiyType,
|
// Name: d.Name,
|
||||||
}
|
// DiyType: v.DiyType,
|
||||||
format[utils.Int64ToStr(v.PropertyId)] = append(format[utils.Int64ToStr(v.CategoryId)], formateNew)
|
// }
|
||||||
}
|
// format[utils.Int64ToStr(v.PropertyId)] = append(format[utils.Int64ToStr(v.CategoryId)], formateNew)
|
||||||
}
|
// }
|
||||||
productFormatNew, err := json.Marshal(format)
|
//}
|
||||||
if err != nil {
|
//productFormatNew, err := json.Marshal(format)
|
||||||
return "", err
|
//if err != nil {
|
||||||
}
|
// return "", err
|
||||||
return string(productFormatNew), nil
|
//}
|
||||||
|
//return string(productFormatNew), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetTiktokImgList 获取抖音图片链接
|
// GetTiktokImgList 获取抖音图片链接
|
||||||
|
|||||||
Reference in New Issue
Block a user