- 重构了dao.GetAuthBind和dao.GetUserBindAuthInfo

- AuthBind的唯一索引调整为"AuthID", "Type", "BindType", "DeletedAt"
This commit is contained in:
gazebo
2019-09-06 16:26:47 +08:00
parent a12f15af52
commit 47a0a892b6
9 changed files with 44 additions and 48 deletions

View File

@@ -118,9 +118,11 @@ func GetWeixinOpenIDsFromStoreID(storeID int) (retVal []string) {
if globals.EnableWXAuth2 {
if userIDList, err2 := api2.RoleMan.GetRoleUserList(autils.NewRole(authz.StoreRoleBoss, storeID)); err2 == nil {
for _, v := range userIDList {
if authInfo, err2 := dao.GetAuthBind(db, v, model.AuthBindTypeAuth, weixin.AuthTypeMP, ""); err2 == nil {
retVal = append(retVal, authInfo.AuthID)
openIDMap[authInfo.AuthID] = 1
if authList, err2 := dao.GetUserBindAuthInfo(db, v, model.AuthBindTypeAuth, []string{weixin.AuthTypeMP}, "", ""); err2 == nil {
for _, v := range authList {
retVal = append(retVal, v.AuthID)
openIDMap[v.AuthID] = 1
}
}
}
}