diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index f5689ef64..88a524d1e 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -123,6 +123,20 @@ class UsersController < ApplicationController end + #未读消息弹窗 + def user_messages_unviewed + @message_alls = [] + messages = MessageAll.where("user_id =?", User.current.id).includes(:message).order("created_at desc") + onclick_time = User.current.onclick_time.onclick_time + messages.each do |message_all| + # 未读的消息存放在数组 + if (message_all.message_type != "SystemMessage"&& !message_all.message.nil? && message_all.message.viewed == 0) || (message_all.message_type == "SystemMessage"&& !message_all.message.nil? && message_all.message.created_at > onclick_time) + @message_alls << message_all.message + break if @message_alls.length == 5 + end + end + end + # 用户消息 # 说明: homework 发布作业;message:讨论区; news:新闻; poll:问卷;works_reviewers:作品评阅;works_reply:作品回复,exercise:课程测验 # issue:问题;journal:缺陷状态更新; forum:公共贴吧: user_feedback: 用户留言; new_reply:新闻回复(comment) diff --git a/app/controllers/wechats_controller.rb b/app/controllers/wechats_controller.rb index ef59e0ed4..3ccdc3257 100644 --- a/app/controllers/wechats_controller.rb +++ b/app/controllers/wechats_controller.rb @@ -121,7 +121,7 @@ class WechatsController < ActionController::Base on :fallback, respond: 'fallback message' on :click, with: 'FEEDBACK' do |request, key| - request.reply.text "如有反馈问题,请直接切入至输入框,发微信给我们即可" + request.reply.text "如有反馈问题,请直接切换至输入框,发微信给我们即可" end on :click, with: 'MY_NEWS' do |request, key| diff --git a/app/views/layouts/_base_footer_public.html.erb b/app/views/layouts/_base_footer_public.html.erb index eb2e83ba2..7c5ab571e 100644 --- a/app/views/layouts/_base_footer_public.html.erb +++ b/app/views/layouts/_base_footer_public.html.erb @@ -4,7 +4,7 @@