From 3e870f115b410ac8974f5bef893f5de152f98fef Mon Sep 17 00:00:00 2001 From: huang Date: Thu, 16 Mar 2017 14:40:55 +0800 Subject: [PATCH] =?UTF-8?q?css=E5=8A=A0=E8=BD=BD=E9=A1=BA=E5=BA=8F=20=20?= =?UTF-8?q?=E8=B7=AF=E7=94=B1=E9=93=BE=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/myshixun.rb | 5 +++-- app/views/layouts/base_myshixun.html.erb | 11 ++++------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/app/models/myshixun.rb b/app/models/myshixun.rb index c7f6c64a7..bf1273cc7 100644 --- a/app/models/myshixun.rb +++ b/app/models/myshixun.rb @@ -10,9 +10,10 @@ class Myshixun < ActiveRecord::Base def current_task games = self.games current_game = games.select{|game| game.status != 2} - if undo_agame.blank? - current_game = Game.find_by_sql("SELECT * FROM `games` where myshixun_id=#{self.id} and status = 2 order by stage desc;") + if current_game.blank? + current_game = Game.where(:status => 2, :myshixun_id => self.id).order("stage desc").first end + return current_game end def parent diff --git a/app/views/layouts/base_myshixun.html.erb b/app/views/layouts/base_myshixun.html.erb index 20aa389b8..c50006ab3 100644 --- a/app/views/layouts/base_myshixun.html.erb +++ b/app/views/layouts/base_myshixun.html.erb @@ -9,7 +9,7 @@ <%= favicon %> <%= javascript_heads %> <%= heads_for_theme %> - <%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2','css/common','css/structure','scm','css/public', 'css/project','css/popup','repository','css/gantt', 'css/calendar', 'css/moduel', 'css/font-awesome','css/taskstyle' %> + <%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2','css/common', 'css/font-awesome','css/taskstyle','css/structure','scm','css/public', 'css/project','css/popup','repository','css/gantt', 'css/calendar', 'css/moduel' %> <%= call_hook :view_layouts_base_html_head %> <%= yield :header_tags -%> @@ -31,14 +31,11 @@