rake 任务查询修改

This commit is contained in:
huang 2018-06-12 15:43:58 +08:00
parent 91d7632ef1
commit 436d488d72
1 changed files with 1 additions and 1 deletions

View File

@ -28,7 +28,7 @@ namespace :gitlab do
task :useless_user => :environment do
# projects = Project.where(:id => [6286, 6292, 6293, 6294])
users = User.where("SELECT * FROM `users` where gid is not null group by gid having count(*)=2")
users = User.find_by_sql("SELECT * FROM `users` where gid is not null group by gid having count(*)=2")
# users = User.where(:gid => 8823)
users.each do |user|
puts "start"+ "#{user.id}"