mirror of
https://github.com/linux-do/new-api.git
synced 2025-09-20 01:16:36 +08:00
修复可用model重复显示bug
This commit is contained in:
parent
ebd53029f4
commit
f18f585fc8
@ -15,7 +15,8 @@ type Ability struct {
|
||||
|
||||
func GetGroupModels(group string) []string {
|
||||
var abilities []Ability
|
||||
DB.Where("`group` = ?", group).Find(&abilities)
|
||||
//去重
|
||||
DB.Where("`group` = ?", group).Distinct("model").Find(&abilities)
|
||||
models := make([]string, 0, len(abilities))
|
||||
for _, ability := range abilities {
|
||||
models = append(models, ability.Model)
|
||||
|
Loading…
Reference in New Issue
Block a user