diff --git a/app/models/game.rb b/app/models/game.rb index ba6664d5c..eed425ea6 100644 --- a/app/models/game.rb +++ b/app/models/game.rb @@ -20,9 +20,9 @@ class Game < ApplicationRecord #全部关卡数 scope :ch_games, lambda { |challenge_id| where(challenge_id:challenge_id) } # 已通关的数量 - scope :finished_num, -> (challenge_id) { where(:challenge_id => challenge_id, :status => 1)} + scope :finished_num, -> (challenge_id) { where(:challenge_id => challenge_id, :status => 2)} # 正在通关的数量 - scope :doing_num, -> (challenge_id) { where(:challenge_id => challenge_id, :status => 0)} + scope :doing_num, -> (challenge_id) { where(:challenge_id => challenge_id, :status => [0,1])} #用户的全部关卡 scope :user_games, lambda { |user_id,challenge_id| where("user_id = ? AND challenge_id = ?",user_id,challenge_id) }