- 新增,修改门店时,自动创建门店用户

This commit is contained in:
gazebo
2019-07-23 17:13:30 +08:00
parent e13a2d2427
commit 8ab0443293
3 changed files with 24 additions and 1 deletions

View File

@@ -615,6 +615,9 @@ func UpdateStore(ctx *jxcontext.Context, storeID int, payload map[string]interfa
if err2 := updateCourierStores(ctx, storeID); err2 != nil && err == nil {
err = err2
}
if valid["tel1"] != nil {
BindMobile2Store(ctx, utils.Interface2String(valid["tel1"]), storeID)
}
}
} else {
dao.Commit(db)
@@ -695,6 +698,7 @@ func CreateStore(ctx *jxcontext.Context, storeExt *StoreExt, userName string) (i
store.ID = existingID
if err = dao.CreateEntity(nil, store); err == nil {
UpdateOrCreateCourierStores(ctx, store.ID, false, false, false)
BindMobile2Store(ctx, storeExt.Tel1, storeExt.ID)
return store.ID, err
}
return 0, err