From 705363130d913e9c56ef7b411e9b4d3202931356 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Mon, 8 Jul 2019 17:26:24 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=BC=BA=E9=99=B7'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/game.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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) }