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| %>