饿鲜达分类修改等接口修改

This commit is contained in:
苏尹岚
2020-02-13 17:07:35 +08:00
parent 0477de8916
commit 721c0eda3d
2 changed files with 8 additions and 3 deletions

View File

@@ -254,7 +254,7 @@ func SetStoreCategorySyncStatus2(db *dao.DaoDB, storeIDs []int, catIDs []int, sy
return num, nil
}
func ReorderCategories(ctx *jxcontext.Context, parentID int, categoryIDs []int, userName string) (err error) {
func ReorderCategories(ctx *jxcontext.Context, parentID int, categoryIDs []int, userName string, isExd bool) (err error) {
var cats []*model.SkuCategory
db := dao.GetDB()
if err = dao.GetEntitiesByKV(db, &cats, utils.Params2Map(model.FieldParentID, parentID), false); err == nil {
@@ -279,7 +279,11 @@ func ReorderCategories(ctx *jxcontext.Context, parentID int, categoryIDs []int,
dao.Rollback(db)
return fmt.Errorf("分类:%d不在%d分类下", v, parentID)
}
catsMap[v].Seq = k
if isExd {
catsMap[v].ExdSeq = k
} else {
catsMap[v].Seq = k
}
catsMap[v].LastOperator = ctx.GetUserName()
if _, err = dao.UpdateEntity(db, catsMap[v]); err != nil {
dao.Rollback(db)