- fix GenFakeID

This commit is contained in:
gazebo
2018-10-25 15:58:23 +08:00
parent 3af1e0a2ac
commit 135938cfa9
2 changed files with 3 additions and 2 deletions

View File

@@ -88,6 +88,7 @@ func (p *MultiStoreHandlerWrapper) UpdateCategory(db *dao.DaoDB, cat *model.SkuC
} }
func (p *MultiStoreHandlerWrapper) DeleteSku(db *dao.DaoDB, sku *model.Sku, userName string) (err error) { func (p *MultiStoreHandlerWrapper) DeleteSku(db *dao.DaoDB, sku *model.Sku, userName string) (err error) {
globals.SugarLogger.Debugf("wrapper DeleteSku, sku:%s", utils.Format4Output(sku, false))
if jxutils.IsFakeID(sku.JdID) { if jxutils.IsFakeID(sku.JdID) {
return nil return nil
} }

View File

@@ -146,7 +146,7 @@ func genFakeID1() int64 {
} }
func GenFakeID() int64 { func GenFakeID() int64 {
return genFakeID1() * 2 return genFakeID1() * 3
} }
func IsFakeID(id int64) bool { func IsFakeID(id int64) bool {
@@ -154,7 +154,7 @@ func IsFakeID(id int64) bool {
return true return true
} }
multiple := id / genFakeID1() multiple := id / genFakeID1()
return multiple == 2 || multiple == 3 return multiple == 2 || multiple == 3 || multiple == 4
} }
func FormalizePageSize(pageSize int) int { func FormalizePageSize(pageSize int) int {