This commit is contained in:
suyl
2021-07-16 17:05:13 +08:00
parent 14ec99a8be
commit 10811a669b

View File

@@ -1223,6 +1223,15 @@ func CreateStore(ctx *jxcontext.Context, storeExt *StoreExt, userName string) (i
PricePercentagePack: "京西100-100",
VendorID: model.VendorIDJX,
})
//尝试把平台负责人加到他自己的权限里
if store.MarketManPhone != "" {
user, _ := dao.GetUserByID(db, "mobile", store.MarketManPhone)
if roles, _ := dao.GetRole(db, user.Name, ""); len(roles) > 0 {
role := roles[0]
role.StoreIDs = role.StoreIDs + "," + utils.Int2Str(store.ID)
dao.UpdateEntity(db, role, "StoreIDs")
}
}
return store.ID, err
}
return 0, err