- ForceSyncSkuNames to SyncSkuNames
This commit is contained in:
@@ -568,24 +568,25 @@ func isSyncError(err error) bool {
|
||||
return ok
|
||||
}
|
||||
|
||||
func (v *VendorSync) ForceSyncSkuNames(ctx *jxcontext.Context, nameIDs []int, isAsync, isContinueWhenError bool) (hint string, err error) {
|
||||
sql := `
|
||||
func (v *VendorSync) SyncSkuNames(ctx *jxcontext.Context, nameIDs []int, isForce, isAsync, isContinueWhenError bool) (hint string, err error) {
|
||||
db := dao.GetDB()
|
||||
if isForce {
|
||||
sql := `
|
||||
UPDATE sku t1
|
||||
SET t1.jd_sync_status = t1.jd_sync_status | ?
|
||||
WHERE t1.deleted_at = ?
|
||||
`
|
||||
sqlParams := []interface{}{
|
||||
model.SyncFlagModifiedMask,
|
||||
utils.DefaultTimeValue,
|
||||
}
|
||||
if len(nameIDs) > 0 {
|
||||
sql += " AND t1.name_id IN(" + dao.GenQuestionMarks(len(nameIDs)) + ")"
|
||||
sqlParams = append(sqlParams, nameIDs)
|
||||
}
|
||||
|
||||
db := dao.GetDB()
|
||||
if _, err = dao.ExecuteSQL(db, sql, sqlParams...); err != nil {
|
||||
return "", err
|
||||
sqlParams := []interface{}{
|
||||
model.SyncFlagModifiedMask,
|
||||
utils.DefaultTimeValue,
|
||||
}
|
||||
if len(nameIDs) > 0 {
|
||||
sql += " AND t1.name_id IN(" + dao.GenQuestionMarks(len(nameIDs)) + ")"
|
||||
sqlParams = append(sqlParams, nameIDs)
|
||||
}
|
||||
if _, err = dao.ExecuteSQL(db, sql, sqlParams...); err != nil {
|
||||
return "", err
|
||||
}
|
||||
}
|
||||
return v.SyncSkus(ctx, db, nameIDs, nil, isAsync, isContinueWhenError, ctx.GetUserName())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user