优化速度

This commit is contained in:
Rosy-zhudan
2019-08-30 13:38:42 +08:00
parent 088d83417f
commit a1086344ca
2 changed files with 5 additions and 1 deletions

View File

@@ -1054,12 +1054,14 @@ func SortCategorySku(ctx *jxcontext.Context, catID int, skuIDList []int) (err er
for index, id := range skuIDList {
skuIDMap[id] = index + 1
}
for _, value := range skuList {
if _, ok := skuIDMap[value.ID]; !ok {
err = errors.New("商品数据不匹配!")
break
}
}
dao.Begin(db)
defer func() {
if r := recover(); r != nil || err != nil {
@@ -1072,7 +1074,7 @@ func SortCategorySku(ctx *jxcontext.Context, catID int, skuIDList []int) (err er
for _, value := range skuList {
seq := skuIDMap[value.ID]
kvs := map[string]interface{} {
"seq": seq,
model.FieldSkuSeq: seq,
}
dao.UpdateEntityLogically(db, value, kvs, userName, nil)

View File

@@ -48,6 +48,8 @@ const (
FieldActID = "ActID"
FieldVendorActID = "VendorActID"
FieldSkuSeq = "seq"
)
type ModelIDCUL struct {