diff --git a/business/jxstore/cms/sync_store_sku.go b/business/jxstore/cms/sync_store_sku.go index 550e64cd0..ee3711d46 100644 --- a/business/jxstore/cms/sync_store_sku.go +++ b/business/jxstore/cms/sync_store_sku.go @@ -97,6 +97,10 @@ func SyncStorCategories(ctx *jxcontext.Context, parentTask tasksch.ITask, vendor } if err == nil { updateFields = append(updateFields, idFieldName) + if vendorID == model.VendorIDMTWM { + storeCatMap.LastOperator = utils.Time2Str(time.Now()) + updateFields = append(updateFields, model.FieldLastOperator) + } } } else if model.IsSyncStatusUpdate(catInfo.StoreCatSyncStatus) { // 修改 if err = handler.UpdateStoreCategory(ctx, storeID, vendorStoreID, catInfo); err == nil { diff --git a/business/model/dao/store_sku.go b/business/model/dao/store_sku.go index bfcd21adc..c83416d25 100644 --- a/business/model/dao/store_sku.go +++ b/business/model/dao/store_sku.go @@ -164,7 +164,7 @@ func GetSkusCategories(db *DaoDB, vendorID, storeID int, skuIDs []int, level int // 单门店模式厂商适用 // 单纯的从已经创建的store_sku_category_map中,得到相关的同步信息 -func GetStoreCategories(db *DaoDB, vendorID, storeID int, level int, isDirty bool) (cats []*SkuStoreCatInfo, err error) { +func GetStoreCategories(db *DaoDB, vendorID, storeID int, level int, mustDirty bool) (cats []*SkuStoreCatInfo, err error) { fieldPrefix := ConvertDBFieldPrefix(model.VendorNames[vendorID]) sql := ` SELECT t4.*, @@ -183,7 +183,7 @@ func GetStoreCategories(db *DaoDB, vendorID, storeID int, level int, isDirty boo storeID, utils.DefaultTimeValue, } - if isDirty { + if mustDirty { sql += " AND t5.%s_sync_status <> 0" fieldPrefixParams = append(fieldPrefixParams, fieldPrefix) } @@ -204,7 +204,7 @@ func GetDirtyStoreCategories(db *DaoDB, vendorID, storeID int, level int) (cats // 以store_sku_bind为基础来做同步,正常情况下使用 // !!! 此函数不要将store_sku_bind中的vendor_price取出来放到StoreSkuSyncInfo.VendorPrice中,因为之后会依赖这个VendorPrice进行重算 // 单多门店模式厂商通用 -func GetStoreSkus2(db *DaoDB, vendorID, storeID int, skuIDs []int, isDirty bool) (skus []*StoreSkuSyncInfo, err error) { +func GetStoreSkus2(db *DaoDB, vendorID, storeID int, skuIDs []int, mustDirty bool) (skus []*StoreSkuSyncInfo, err error) { if vendorID < 0 { panic("vendorID<0") } @@ -275,7 +275,7 @@ func GetStoreSkus2(db *DaoDB, vendorID, storeID int, skuIDs []int, isDirty bool) sql += " AND t1.store_id = ?" sqlParams = append(sqlParams, storeID) } - if isDirty { + if mustDirty { sql += " AND (t1.%s_sync_status <> 0 OR (%s.%s_id <> 0 AND t3.id IS NULL))" fmtParams = append(fmtParams, fieldPrefix, tableName, fieldPrefix) } else {