添加点击对应方法
This commit is contained in:
parent
b2e25e8afc
commit
ed5f14c9eb
|
@ -105,6 +105,16 @@ class UsersController < ApplicationController
|
|||
redirect_to signin_url
|
||||
return
|
||||
end
|
||||
# 记录当前点击按钮的时间
|
||||
if OnclickTime.where("user_id =?", User.current).first.nil?
|
||||
message_new_time = OnclickTime.new
|
||||
message_new_time.user_id = User.current.id
|
||||
message_new_time.onclick_time = Time.now
|
||||
message_new_time.save
|
||||
else
|
||||
message_new_time = OnclickTime.where("user_id =?", User.current)
|
||||
message_new_time.update_attributes(:onclick_time => Time.now)
|
||||
end
|
||||
# 当前用户查看消息,则设置消息为已读
|
||||
if params[:viewed] == "all"
|
||||
course_querys = @user.course_messages
|
||||
|
|
Loading…
Reference in New Issue