|
|
@@ -14,10 +14,14 @@ type Ability struct {
|
|
|
}
|
|
|
|
|
|
func GetGroupModels(group string) []string {
|
|
|
- var models []string
|
|
|
- // Find distinct models
|
|
|
- DB.Table("abilities").Where("`group` = ? and enabled = ?", group, true).Distinct("model").Pluck("model", &models)
|
|
|
- return models
|
|
|
+ var models []string
|
|
|
+ // Find distinct models
|
|
|
+ groupCol := "`group`"
|
|
|
+ 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) {
|