- AddStoreBossByMoble添加调试
This commit is contained in:
@@ -1744,18 +1744,21 @@ func SyncStoresQualify(ctx *jxcontext.Context, storeIDs []int, isAsync, isContin
|
|||||||
}
|
}
|
||||||
|
|
||||||
func AddStoreBossByMoble(ctx *jxcontext.Context, mobile string, storeID int) (num int64, err error) {
|
func AddStoreBossByMoble(ctx *jxcontext.Context, mobile string, storeID int) (num int64, err error) {
|
||||||
if globals.EnableWXAuth2 {
|
if mobile != "" {
|
||||||
db := dao.GetDB()
|
if globals.EnableWXAuth2 {
|
||||||
userList, _, err2 := dao.GetUsers(db, 0, "", nil, "", mobile, 0, 0)
|
db := dao.GetDB()
|
||||||
if err = err2; err == nil && len(userList) > 0 {
|
userList, _, err2 := dao.GetUsers(db, 0, "", nil, "", mobile, 0, 0)
|
||||||
if err = AddRoles4User(ctx, userList[0].GetID(), []*authz.RoleInfo{
|
globals.SugarLogger.Debugf("AddStoreBossByMoble mobile:%s, userList:%s", mobile, utils.Format4Output(userList, true))
|
||||||
autils.NewRole(authz.StoreRoleBoss, storeID),
|
if err = err2; err == nil && len(userList) > 0 {
|
||||||
}); err == nil {
|
if err = AddRoles4User(ctx, userList[0].GetID(), []*authz.RoleInfo{
|
||||||
num = 1
|
autils.NewRole(authz.StoreRoleBoss, storeID),
|
||||||
|
}); err == nil {
|
||||||
|
num = 1
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
num, err = BindMobile2Store(ctx, mobile, storeID)
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
num, err = BindMobile2Store(ctx, mobile, storeID)
|
|
||||||
}
|
}
|
||||||
return num, err
|
return num, err
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user