jingquan huang 6 years ago
parent 1b2494ea5e
commit 037e7c08ec

@ -25,11 +25,11 @@ class Challenge < ActiveRecord::Base
scope :practice_type, lambda{where(st: 0)} scope :practice_type, lambda{where(st: 0)}
def shixun_done_new def shixun_done_new
self.games.map{|game| game.status == 2 }.size self.games.select{|game| game.status == 2 }.size
end end
def shixun_running_new def shixun_running_new
self.games.map{|game| game.status != 2 }.size self.games.select{|game| game.status != 2 }.size
end end
def game_difficulty def game_difficulty

Loading…
Cancel
Save