mirror of
https://github.com/linux-do/new-api.git
synced 2025-09-20 01:16:36 +08:00
fix pgsql
This commit is contained in:
parent
1a7a10c3d4
commit
aa07ada0f4
@ -16,7 +16,11 @@ type Ability struct {
|
|||||||
func GetGroupModels(group string) []string {
|
func GetGroupModels(group string) []string {
|
||||||
var models []string
|
var models []string
|
||||||
// Find distinct models
|
// Find distinct models
|
||||||
DB.Table("abilities").Where("`group` = ? and enabled = ?", group, true).Distinct("model").Pluck("model", &models)
|
groupCol := "`group`"
|
||||||
|
if common.UsingPostgreSQL {
|
||||||
|
groupCol = `"group"`
|
||||||
|
}
|
||||||
|
DB.Table("abilities").Where(groupCol+" = ? and enabled = ?", group, true).Distinct("model").Pluck("model", &models)
|
||||||
return models
|
return models
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user