diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 73436395f..e0fa253b3 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -3518,7 +3518,7 @@ class UsersController < ApplicationController # 用户的所有项目 # @my_projects = @user.projects.visible.where("projects.user_id = #{@user.id}").select("projects.*,(SELECT MAX(updated_at) FROM `forge_activities` WHERE forge_activities.project_id = projects.id) AS updatetime").order("updatetime DESC") - @my_projects = @user.projects.select("projects.*,(SELECT MAX(updated_at) FROM `forge_activities` WHERE forge_activities.project_id = projects.id) AS updatetime").order("updatetime DESC") + @my_projects = @user.projects.where("projects.user_id = #{@user.id}").select("projects.*,(SELECT MAX(updated_at) FROM `forge_activities` WHERE forge_activities.project_id = projects.id) AS updatetime").order("updatetime DESC") @my_projects_count = @my_projects.count #@my_joined_projects = @user.projects.visible.where("projects.user_id != #{@user.id}").select("projects.*,(SELECT MAX(updated_at) FROM `forge_activities` WHERE forge_activities.project_id = projects.id) AS updatetime").order("updatetime DESC") diff --git a/app/views/users/_project_list.html.erb b/app/views/users/_project_list.html.erb index 4fa78f45d..9aeb39ab5 100644 --- a/app/views/users/_project_list.html.erb +++ b/app/views/users/_project_list.html.erb @@ -37,13 +37,13 @@ <% else %> <% projects.each_with_index do |project, i| %>
- <% allow_visit = User.current.member_of?(project) || User.current.admin? || project.is_public %> + <% allow_visit = User.current.member_of?(project) || User.current.admin? || project.is_public == 1 %>
<%=render :partial => 'collect_project', :locals => {:project => project} %>

<%= link_to project.name, allow_visit ? project_path(project.id,:host=>Setting.host_name) : 'javascript:void(0)', :target => '_blank', - :class => "new_project_title fl",:id => "show_project_#{project.id}", :title => (allow_visit ? "#{project.name}" : "私有班级不可访问") %>

+ :class => "new_project_title fl",:id => "show_project_#{project.id}", :title => (allow_visit ? "#{project.name}" : "私有项目不可访问") %> <% unless project.is_public? %> 私有 <% end %>