- 注释掉老user与auth相关的代码

This commit is contained in:
gazebo
2019-09-24 16:39:50 +08:00
parent 72c9889d10
commit 412b11396a
18 changed files with 1172 additions and 1442 deletions

View File

@@ -89,33 +89,33 @@ var (
func GetWeixinOpenIDsFromStoreID(storeID int) (retVal []string) {
db := dao.GetDB()
openIDMap := make(map[string]int)
if !globals.DisableWXAuth1 {
var openIDList []string
sql := `
SELECT openid
FROM weixins t1
JOIN
(SELECT id
FROM weixins
WHERE jxstoreid = ? AND parentid = -1) t2 ON t2.id = t1.parentid
WHERE openid IS NOT NULL
UNION
SELECT openid
FROM weixins
WHERE jxstoreid = ? AND parentid = -1 AND openid IS NOT NULL`
sqlParams := []interface{}{
storeID,
storeID,
}
err := dao.GetRows(db, &openIDList, sql, sqlParams...)
if err != nil || len(openIDList) == 0 {
globals.SugarLogger.Infof("GetWeixinOpenIDsFromStoreID can not find openid for store:%d, num:%d, error:%v", storeID, len(openIDList), err)
return retVal
}
for _, v := range openIDList {
openIDMap[v] = 1
}
}
// if !globals.DisableWXAuth1 {
// var openIDList []string
// sql := `
// SELECT openid
// FROM weixins t1
// JOIN
// (SELECT id
// FROM weixins
// WHERE jxstoreid = ? AND parentid = -1) t2 ON t2.id = t1.parentid
// WHERE openid IS NOT NULL
// UNION
// SELECT openid
// FROM weixins
// WHERE jxstoreid = ? AND parentid = -1 AND openid IS NOT NULL`
// sqlParams := []interface{}{
// storeID,
// storeID,
// }
// err := dao.GetRows(db, &openIDList, sql, sqlParams...)
// if err != nil || len(openIDList) == 0 {
// globals.SugarLogger.Infof("GetWeixinOpenIDsFromStoreID can not find openid for store:%d, num:%d, error:%v", storeID, len(openIDList), err)
// return retVal
// }
// for _, v := range openIDList {
// openIDMap[v] = 1
// }
// }
if globals.EnableWXAuth2 {
if userIDList, err2 := api2.RoleMan.GetRoleUserList(autils.NewStoreBossRole(storeID)); err2 == nil {
for _, v := range userIDList {