- 修改genFakeID1,不会生成重复的ID
This commit is contained in:
@@ -360,3 +360,24 @@ func GetDescImgFieldName(vendorID int) (fieldName string) {
|
||||
}
|
||||
return fieldName
|
||||
}
|
||||
|
||||
func GetStoresSkusInfo(db *DaoDB, storeIDs, skuIDs []int) (storeSkuList []*model.StoreSkuBind, err error) {
|
||||
sql := `
|
||||
SELECT *
|
||||
FROM store_sku_bind t1
|
||||
WHERE t1.deleted_at = ?
|
||||
`
|
||||
sqlParams := []interface{}{
|
||||
utils.DefaultTimeValue,
|
||||
}
|
||||
if len(storeIDs) > 0 {
|
||||
sql += " AND t1.store_id IN (" + GenQuestionMarks(len(storeIDs)) + ")"
|
||||
sqlParams = append(sqlParams, storeIDs)
|
||||
}
|
||||
if len(skuIDs) > 0 {
|
||||
sql += " AND t1.sku_id IN (" + GenQuestionMarks(len(skuIDs)) + ")"
|
||||
sqlParams = append(sqlParams, skuIDs)
|
||||
}
|
||||
err = GetRows(db, &storeSkuList, sql, sqlParams...)
|
||||
return storeSkuList, err
|
||||
}
|
||||
|
||||
@@ -45,6 +45,8 @@ const (
|
||||
|
||||
FieldVendorOrderID = "VendorOrderID"
|
||||
FieldVendorOrderID2 = "VendorOrderID2"
|
||||
|
||||
FieldVendorActID = "VendorActID"
|
||||
)
|
||||
|
||||
type ModelIDCUL struct {
|
||||
@@ -80,6 +82,30 @@ const (
|
||||
SyncFlagStoreAddress = 16
|
||||
)
|
||||
|
||||
func IsSyncStatusNew(syncStatus int) bool {
|
||||
return (syncStatus & SyncFlagNewMask) != 0
|
||||
}
|
||||
|
||||
func IsSyncStatusDelete(syncStatus int) bool {
|
||||
return (syncStatus & SyncFlagDeletedMask) != 0
|
||||
}
|
||||
|
||||
func IsSyncStatusUpdate(syncStatus int) bool {
|
||||
return (syncStatus & SyncFlagModifiedMask) != 0
|
||||
}
|
||||
|
||||
func IsSyncStatusNeedCreate(syncStatus int) bool {
|
||||
return IsSyncStatusNew(syncStatus) && !IsSyncStatusDelete(syncStatus)
|
||||
}
|
||||
|
||||
func IsSyncStatusNeedDelete(syncStatus int) bool {
|
||||
return !IsSyncStatusNew(syncStatus) && IsSyncStatusDelete(syncStatus)
|
||||
}
|
||||
|
||||
func IsSyncStatusNeedUpdate(syncStatus int) bool {
|
||||
return !IsSyncStatusNew(syncStatus) && !IsSyncStatusDelete(syncStatus) && IsSyncStatusUpdate(syncStatus)
|
||||
}
|
||||
|
||||
// const (
|
||||
// KeyJdFlag = "jdFlag"
|
||||
// KeyJdSyncedAt = "jdSyncedAt"
|
||||
|
||||
Reference in New Issue
Block a user