mirror of
https://github.com/linux-do/new-api.git
synced 2025-11-05 13:53:42 +08:00
fix pgsql
This commit is contained in:
@@ -14,10 +14,14 @@ 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`"
|
||||||
return models
|
if common.UsingPostgreSQL {
|
||||||
|
groupCol = `"group"`
|
||||||
|
}
|
||||||
|
DB.Table("abilities").Where(groupCol+" = ? and enabled = ?", group, true).Distinct("model").Pluck("model", &models)
|
||||||
|
return models
|
||||||
}
|
}
|
||||||
|
|
||||||
func GetRandomSatisfiedChannel(group string, model string) (*Channel, error) {
|
func GetRandomSatisfiedChannel(group string, model string) (*Channel, error) {
|
||||||
|
|||||||
Reference in New Issue
Block a user