dev_forum
cxt 5 years ago
parent 1df37b0ca6
commit 58259feb48

@ -170,7 +170,7 @@ class HomeworkCommon < ApplicationRecord
#删除时更新题库中的引用数
def update_homework_bank_quotes
old_bank = self.homework_bank
old_bank.update_attributes(quotes: (old_bank.quotes - 1) > 0 ? (old_bank.quotes - 1) : 0, homework_common_id: nil)
old_bank.update_attributes(quotes: (old_bank.quotes - 1) > 0 ? (old_bank.quotes - 1) : 0, homework_common_id: nil) if old_bank.present?
end
# 查重是否有新结果

Loading…
Cancel
Save