fix: reroll action error

This commit is contained in:
CaIon
2024-03-14 00:43:32 +08:00
parent da55c56c54
commit bc2b1112db
3 changed files with 12 additions and 4 deletions
+6 -1
View File
@@ -147,7 +147,12 @@ func FixAbility() (int, error) {
return 0, err
}
var channels []Channel
err = DB.Where("id NOT IN (?)", abilityChannelIds).Find(&channels).Error
if len(abilityChannelIds) == 0 {
err = DB.Find(&channels).Error
} else {
err = DB.Where("id NOT IN (?)", abilityChannelIds).Find(&channels).Error
}
if err != nil {
return 0, err
}