Commit dbdfebcc by CaIon

fix pgsql

parent fb48d77f
...@@ -14,10 +14,14 @@ type Ability struct { ...@@ -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) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment