统计数左侧刷新

This commit is contained in:
huang 2016-04-14 10:26:25 +08:00
parent 12efc10759
commit acf4e15f09
7 changed files with 16 additions and 8 deletions

View File

@ -851,8 +851,6 @@ class CoursesController < ApplicationController
# render_403 # render_403
# return # return
# end # end
# 统计访问量
@course.update_column(:visits, @course.visits.to_i + 1)
#更新创建课程消息状态 #更新创建课程消息状态
create_course_messages = @course.course_messages.where("user_id =? and course_message_type =? and course_id =? and viewed =?", User.current.id, 'Course', @course.id, 0) create_course_messages = @course.course_messages.where("user_id =? and course_message_type =? and course_id =? and viewed =?", User.current.id, 'Course', @course.id, 0)
create_course_messages.update_all(:viewed => true) create_course_messages.update_all(:viewed => true)

View File

@ -299,8 +299,6 @@ class ProjectsController < ApplicationController
if params[:jump] && redirect_to_project_menu_item(@project, params[:jump]) if params[:jump] && redirect_to_project_menu_item(@project, params[:jump])
return return
end end
# 统计访问量
@project.update_column(:visits, @project.visits + 1)
# over # over
@author = params[:user_id].blank? ? nil : User.active.find(params[:user_id]) @author = params[:user_id].blank? ? nil : User.active.find(params[:user_id])
@page = params[:page] ? params[:page].to_i + 1 : 0 @page = params[:page] ? params[:page].to_i + 1 : 0

View File

@ -1206,8 +1206,6 @@ class UsersController < ApplicationController
end end
def show def show
# 统计访问量
@user.update_column(:visits, @user.visits.to_i + 1) unless User.current == @user
#更新用户申请成为课程老师或教辅消息的状态 #更新用户申请成为课程老师或教辅消息的状态
if params[:course_id] != nil if params[:course_id] != nil
join_course_messages = CourseMessage.where("course_id =? and course_message_type =? and user_id =? and course_message_id =? and viewed =?", join_course_messages = CourseMessage.where("course_id =? and course_message_type =? and user_id =? and course_message_id =? and viewed =?",

View File

@ -33,6 +33,10 @@ module ApplicationHelper
extend Forwardable extend Forwardable
def_delegators :wiki_helper, :wikitoolbar_for, :heads_for_wiki_formatter def_delegators :wiki_helper, :wikitoolbar_for, :heads_for_wiki_formatter
def update_visiti_count container
container.update_column(:visits, container.visits + 1)
end
# Time 2015-03-24 15:27:29 # Time 2015-03-24 15:27:29
# Author lizanle # Author lizanle
# Description 从硬盘上删除对应的资源文件 # Description 从硬盘上删除对应的资源文件

View File

@ -68,6 +68,10 @@
</ul> </ul>
</div> </div>
<%# 更新访问数,刷新的时候更新访问次数 %>
<% update_visiti_count @course %>
<%# over %>
<div class="subNavBox"> <div class="subNavBox">
<% unless show_nav?(@course.course_activities.count) %> <% unless show_nav?(@course.course_activities.count) %>
<div class="subNav"> <div class="subNav">

View File

@ -72,8 +72,9 @@
<% end %> <% end %>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
<%# 更新访问数 %> <%# 更新访问数,刷新的时候更新访问次数 %>
<% flag = true %> <% update_visiti_count @project %>
<%# over %>
<div> <div>
<% if @project.project_type == 0 %> <% if @project.project_type == 0 %>
<% unless static_project_score(@project.project_score) == 0 %> <% unless static_project_score(@project.project_score) == 0 %>

View File

@ -132,6 +132,11 @@
</div> </div>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
<%# 更新访问数,刷新的时候更新访问次数 %>
<% update_visiti_count @user %>
<%# over %>
<div> <div>
<div class="homepageSignature break_word"> <div class="homepageSignature break_word">
<p id="user_brief_introduction_show"> <p id="user_brief_introduction_show">