优化速度
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
@@ -48,6 +48,8 @@ const (
|
||||
|
||||
FieldActID = "ActID"
|
||||
FieldVendorActID = "VendorActID"
|
||||
|
||||
FieldSkuSeq = "seq"
|
||||
)
|
||||
|
||||
type ModelIDCUL struct {
|
||||
|
||||
Reference in New Issue
Block a user