From 543e469eeb9ff0401cd39b5a8484943b0fd311f3 Mon Sep 17 00:00:00 2001 From: gazebo Date: Tue, 25 Sep 2018 11:35:50 +0800 Subject: [PATCH] - keep store.id when CreateStore. --- business/jxstore/cms/store.go | 2 ++ business/model/sku.go | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/business/jxstore/cms/store.go b/business/jxstore/cms/store.go index a945b3de7..8b2b971c0 100644 --- a/business/jxstore/cms/store.go +++ b/business/jxstore/cms/store.go @@ -211,7 +211,9 @@ func UpdateStore(storeID int, payload map[string]interface{}, userName string) ( } func CreateStore(store *model.Store, userName string) (id int, err error) { + existingID := store.ID dao.WrapAddIDCULDEntity(store, userName) + store.ID = existingID if err = dao.CreateEntity(nil, store); err == nil { return store.ID, err } diff --git a/business/model/sku.go b/business/model/sku.go index 31be9ef04..2650e604a 100644 --- a/business/model/sku.go +++ b/business/model/sku.go @@ -154,7 +154,7 @@ type SkuName struct { Name string `orm:"size(255);index" json:"name"` Comment string `orm:"size(255)" json:"comment"` - BrandID int `orm:"column(brand_id);default(0)" json:"brandID"` // 此属性暂时没有使用 + BrandID int `orm:"column(brand_id);default(0)" json:"brandID"` // todo,此属性暂时没有使用,且有问题,应该是不同平台都有一个brandid CategoryID int `orm:"column(category_id);index" json:"categoryID"` // 标准类别 IsGlobal int8 `orm:"default(1)" json:"isGlobal"` // 是否是全部(全国)可见,如果否的话,可见性由SkuPlace决定