fix: reroll action error

This commit is contained in:
CaIon committed 2024-03-14 00:43:32 +08:00
1 parent da55c56c54
commit bc2b1112db
3 files changed
+12 -4

No files matched your search

+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
}