- 优化饿百同步时,对于创建store_sku_category_map的逻辑
This commit is contained in:
@@ -43,11 +43,11 @@ type tStoreSkuFullInfo struct {
|
||||
|
||||
CatName string `orm:"size(255)"`
|
||||
|
||||
CatID int `orm:"column(cat_id)"`
|
||||
CatEbaiID int64 `orm:"column(cat_ebai_id)"`
|
||||
CatEbaiSyncStatus int
|
||||
CatLevel int
|
||||
CatMapID int `orm:"column(cat_map_id)"`
|
||||
CatID int `orm:"column(cat_id)"`
|
||||
CatEbaiID int64 `orm:"column(cat_ebai_id)"`
|
||||
|
||||
ParentCatMapID int `orm:"column(parent_cat_map_id)"`
|
||||
ParentCatID int `orm:"column(parent_cat_id)"`
|
||||
ParentCatEbaiID int64 `orm:"column(parent_cat_ebai_id)"`
|
||||
|
||||
@@ -85,8 +85,10 @@ func (p *PurchaseHandler) getDirtyStoreSkus(db *dao.DaoDB, storeID int, skuIDs [
|
||||
t1.*, t2.spec_quality, t2.spec_unit, t2.weight, t2.status sku_status,
|
||||
t3.id name_id, t3.prefix, t3.name, t2.comment, t3.is_global, t3.unit, IF(t3.img_ebai <> '', t3.img_ebai, t3.img) img, t3.upc, t3.desc_img_ebai,
|
||||
t4.name cat_name, t4.ebai_price_percentage cat_price_percentage,
|
||||
t4.id cat_id, t4.level cat_level, t5.ebai_id cat_ebai_id,
|
||||
t4p.id parent_cat_id, t5p.ebai_id parent_cat_ebai_id, t5p.ebai_sync_status parent_cat_ebai_sync_status,
|
||||
t4.id cat_id,
|
||||
t5.id cat_map_id, t5.ebai_id cat_ebai_id,
|
||||
t4p.id parent_cat_id,
|
||||
t5p.id parent_cat_map_id, t5p.ebai_id parent_cat_ebai_id,
|
||||
cat1.vendor_category_id ebai_cat3_id, cat2.vendor_category_id ebai_cat2_id, cat2.parent_id ebai_cat1_id
|
||||
FROM store_sku_bind t1
|
||||
LEFT JOIN sku t2 ON t1.sku_id = t2.id AND t2.deleted_at = ? AND t2.status = ?
|
||||
@@ -123,10 +125,10 @@ func (p *PurchaseHandler) createCatByStoreSkus(ctx *jxcontext.Context, parentTas
|
||||
catList2Add := make(map[int]int)
|
||||
for _, storeSku := range storeSkuInfoList {
|
||||
if storeSku.CatID != 0 && storeSku.EbaiSyncStatus&(model.SyncFlagNewMask|model.SyncFlagStoreSkuModifiedMask) != 0 && storeSku.Status == model.SkuStatusNormal {
|
||||
if storeSku.ParentCatEbaiID == 0 && storeSku.ParentCatID != 0 {
|
||||
if storeSku.ParentCatMapID == 0 && storeSku.ParentCatID != 0 {
|
||||
catList2Add[storeSku.ParentCatID] = 1
|
||||
}
|
||||
if storeSku.CatEbaiID == 0 {
|
||||
if storeSku.CatMapID == 0 {
|
||||
catList2Add[storeSku.CatID] = 1
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user