fix: reroll action error

This commit is contained in:
CaIon
2024-03-14 00:43:32 +08:00
parent 44361d75e8
commit a77fbc0fa2
3 changed files with 12 additions and 4 deletions

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
}