ids为空时不需要执行

This commit is contained in:
guange 2016-12-18 18:29:24 +08:00
parent d34ed4b744
commit 34f8450885
1 changed files with 3 additions and 1 deletions

View File

@ -39,9 +39,11 @@ class HomeworkCommonController < ApplicationController
# homework.delay.set_jour_viewed
end
unless ids.empty?
User.current.at_messages.where(viewed: false,
at_message_type: 'JournalsForMessage',
at_message_id: ids).update_all(viewed: true)
end
@left_nav_type = 3
respond_to do |format|