Created
April 1, 2014 03:00
-
-
Save yangxing-star/9906919 to your computer and use it in GitHub Desktop.
计算每月管培生推荐人数。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data = [] | |
a = ["橙子","1circle","jensen鑫","柏图卡","琳子想要跑着玩","老猴走四方","神叨M","June","田田兔","di请你吃小火锅","小蜜蜂","陈麒元","李晨曦","闻香识你","lemon","大坤儿","星子来啦","Rachael","汤团","天臣","二毛","朵miao喵","Brey陌上花开","大草原MemoShen","白白vip001","木子"] | |
users = User.in(nickname: a) | |
users.each do |u| | |
hash = {} | |
count = 0 | |
u.referring.each do |r| | |
if r.created_at >= "2014-03-08 00:00:00" && r.created_at <= "2014-03-31 23:59:59" | |
if r.avatar? && r.verifies_count > 0 | |
if r.referrer_id.to_s != r.id.to_s | |
count += 1 | |
end | |
end | |
end | |
end | |
hash[:nickname] = u.nickname | |
hash[:count] = count | |
data << hash | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment