feat: able to delete all disabled channels

This commit is contained in:
JustSong
2023-10-14 17:25:48 +08:00
parent fbe9985f57
commit 824444244b
4 changed files with 13 additions and 8 deletions

View File

@@ -181,3 +181,8 @@ func DeleteChannelByStatus(status int64) (int64, error) {
result := DB.Where("status = ?", status).Delete(&Channel{})
return result.RowsAffected, result.Error
}
func DeleteDisabledChannel() (int64, error) {
result := DB.Where("status = ? or status = ?", common.ChannelStatusAutoDisabled, common.ChannelStatusManuallyDisabled).Delete(&Channel{})
return result.RowsAffected, result.Error
}