mirror of
https://github.com/casdoor/casdoor.git
synced 2025-05-24 08:20:31 +08:00
fix: add missing tableNamePrefix in some places
This commit is contained in:
parent
2fb79e4092
commit
3373174c65
@ -18,6 +18,7 @@ import (
|
|||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
|
"github.com/casdoor/casdoor/conf"
|
||||||
"github.com/casdoor/casdoor/util"
|
"github.com/casdoor/casdoor/util"
|
||||||
"github.com/xorm-io/builder"
|
"github.com/xorm-io/builder"
|
||||||
"github.com/xorm-io/core"
|
"github.com/xorm-io/core"
|
||||||
@ -224,7 +225,8 @@ func GetGroupUserCount(groupId string, field, value string) (int64, error) {
|
|||||||
if field == "" && value == "" {
|
if field == "" && value == "" {
|
||||||
return int64(len(names)), nil
|
return int64(len(names)), nil
|
||||||
} else {
|
} else {
|
||||||
return ormer.Engine.Table("user").
|
tableNamePrefix := conf.GetConfigString("tableNamePrefix")
|
||||||
|
return ormer.Engine.Table(tableNamePrefix+"user").
|
||||||
Where("owner = ?", owner).In("name", names).
|
Where("owner = ?", owner).In("name", names).
|
||||||
And(fmt.Sprintf("user.%s like ?", util.CamelToSnakeCase(field)), "%"+value+"%").
|
And(fmt.Sprintf("user.%s like ?", util.CamelToSnakeCase(field)), "%"+value+"%").
|
||||||
Count()
|
Count()
|
||||||
@ -239,7 +241,8 @@ func GetPaginationGroupUsers(groupId string, offset, limit int, field, value, so
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
session := ormer.Engine.Table("user").
|
tableNamePrefix := conf.GetConfigString("tableNamePrefix")
|
||||||
|
session := ormer.Engine.Table(tableNamePrefix+"user").
|
||||||
Where("owner = ?", owner).In("name", names)
|
Where("owner = ?", owner).In("name", names)
|
||||||
|
|
||||||
if offset != -1 && limit != -1 {
|
if offset != -1 && limit != -1 {
|
||||||
|
@ -19,6 +19,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
"github.com/casdoor/casdoor/conf"
|
||||||
"github.com/casdoor/casdoor/util"
|
"github.com/casdoor/casdoor/util"
|
||||||
goldap "github.com/go-ldap/ldap/v3"
|
goldap "github.com/go-ldap/ldap/v3"
|
||||||
"github.com/thanhpk/randstr"
|
"github.com/thanhpk/randstr"
|
||||||
@ -356,7 +357,8 @@ func SyncLdapUsers(owner string, syncUsers []LdapUser, ldapId string) (existUser
|
|||||||
func GetExistUuids(owner string, uuids []string) ([]string, error) {
|
func GetExistUuids(owner string, uuids []string) ([]string, error) {
|
||||||
var existUuids []string
|
var existUuids []string
|
||||||
|
|
||||||
err := ormer.Engine.Table("user").Where("owner = ?", owner).Cols("ldap").
|
tableNamePrefix := conf.GetConfigString("tableNamePrefix")
|
||||||
|
err := ormer.Engine.Table(tableNamePrefix+"user").Where("owner = ?", owner).Cols("ldap").
|
||||||
In("ldap", uuids).Select("DISTINCT ldap").Find(&existUuids)
|
In("ldap", uuids).Select("DISTINCT ldap").Find(&existUuids)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return existUuids, err
|
return existUuids, err
|
||||||
|
Loading…
x
Reference in New Issue
Block a user