- auth1与auth2以为是兼容
This commit is contained in:
@@ -87,7 +87,8 @@ var (
|
||||
|
||||
func GetWeixinOpenIDsFromStoreID(storeID int) (retVal []string) {
|
||||
db := dao.GetDB()
|
||||
if !globals.EnableWXAuth2 {
|
||||
openIDMap := make(map[string]int)
|
||||
if !globals.DisableWXAuth1 {
|
||||
var openIDList []string
|
||||
sql := `
|
||||
SELECT openid
|
||||
@@ -111,17 +112,20 @@ func GetWeixinOpenIDsFromStoreID(storeID int) (retVal []string) {
|
||||
return retVal
|
||||
}
|
||||
for _, v := range openIDList {
|
||||
retVal = append(retVal, v)
|
||||
openIDMap[v] = 1
|
||||
}
|
||||
} else {
|
||||
}
|
||||
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, weixin.AuthTypeMP, ""); err2 == nil {
|
||||
retVal = append(retVal, authInfo.AuthID)
|
||||
openIDMap[authInfo.AuthID] = 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
retVal = jxutils.StringMap2List(openIDMap)
|
||||
if !globals.ReallyCallPlatformAPI {
|
||||
// todo,调试,只发给我
|
||||
globals.SugarLogger.Debugf("GetWeixinOpenIDsFromStoreID store:%d, openids:%v", storeID, retVal)
|
||||
|
||||
Reference in New Issue
Block a user