Skip to content

Commit

Permalink
修改显示错误的bug
Browse files Browse the repository at this point in the history
  • Loading branch information
heyunpeng committed Jul 21, 2015
1 parent 66b7471 commit 0162cc9
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 29 deletions.
6 changes: 3 additions & 3 deletions app/controllers/combinationgame_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ def index
@minutes = (@seconds / 60).to_i
@seconds = (@seconds % 60).to_i

@currentbar = tasklog.currentbar
tsktime = Time.parse(tasklog.runtime.to_s)
@issue = tsktime.strftime("%Y%m%d")+(tasklog.currentbar).to_s
@totalbar = 90
@currentbar = @totalbar - (tasklog.totalbar - tasklog.currentbar)
@issue = (tasklog.nextgameid.to_i-1).to_s

@grid = Grid.find_by_gameid(@issue)
end
Expand Down
8 changes: 4 additions & 4 deletions app/controllers/doublegame_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ def index
@minutes = (@seconds / 60).to_i
@seconds = (@seconds % 60).to_i

@currentbar = tasklog.currentbar
tsktime = Time.parse(tasklog.runtime.to_s)
@issue = tsktime.strftime("%Y%m%d")+(tasklog.currentbar).to_s

@totalbar = 90
@currentbar = @totalbar - (tasklog.totalbar - tasklog.currentbar)
@issue = (tasklog.nextgameid.to_i-1).to_s
@grid = Grid.find_by_gameid(@issue)
end

Expand Down
8 changes: 4 additions & 4 deletions app/controllers/flashview_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ def index
@minutes = (@seconds / 60).to_i
@seconds = (@seconds % 60).to_i

@currentbar = tasklog.currentbar
tsktime = Time.parse(tasklog.runtime.to_s)
@issue = tsktime.strftime("%Y%m%d")+(tasklog.currentbar).to_s
@totalbar = 90
@currentbar = @totalbar - (tasklog.totalbar - tasklog.currentbar)
@issue = (tasklog.nextgameid.to_i-1).to_s

@grid = Grid.find_by_gameid(@issue)
end

if @minutes < 0
if @minutes and @minutes < 0
@minutes = 9
end

Expand Down
6 changes: 3 additions & 3 deletions app/controllers/main_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ def index
@minutes = (@seconds / 60).to_i
@seconds = (@seconds % 60).to_i

@currentbar = tasklog.currentbar
tsktime = Time.parse(tasklog.runtime.to_s)
@issue = tsktime.strftime("%Y%m%d")+(tasklog.currentbar).to_s
@totalbar = 90
@currentbar = @totalbar - (tasklog.totalbar - tasklog.currentbar)
@issue = (tasklog.nextgameid.to_i-1).to_s

@grid = Grid.find_by_gameid(@issue)
end
Expand Down
8 changes: 4 additions & 4 deletions app/controllers/mainhistory_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ def index
@minutes = (@seconds / 60).to_i
@seconds = (@seconds % 60).to_i

@currentbar = tasklog.currentbar
tsktime = Time.parse(tasklog.runtime.to_s)
@issue = tsktime.strftime("%Y%m%d")+(tasklog.currentbar).to_s
@totalbar = 90
@currentbar = @totalbar - (tasklog.totalbar - tasklog.currentbar)
@issue = (tasklog.nextgameid.to_i-1).to_s

@grid = Grid.find_by_gameid(@issue)
end

if @minutes < 0
if @minutes and @minutes < 0
@minutes = 9
end

Expand Down
6 changes: 3 additions & 3 deletions app/controllers/singlegame_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ def index
@minutes = (@seconds / 60).to_i
@seconds = (@seconds % 60).to_i

@currentbar = tasklog.currentbar
tsktime = Time.parse(tasklog.runtime.to_s)
@issue = tsktime.strftime("%Y%m%d")+(tasklog.currentbar).to_s
@totalbar = 90
@currentbar = @totalbar - (tasklog.totalbar - tasklog.currentbar)
@issue = (tasklog.nextgameid.to_i-1).to_s

@grid = Grid.find_by_gameid(@issue)
end
Expand Down
10 changes: 5 additions & 5 deletions app/controllers/traceresult_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@ class TraceresultController < ApplicationController
def index
curtime = Time.new
tasklog = Tasklog.find_by_taskdate(curtime.strftime("%Y-%m-%d"))
if tasklog and session[:userid] != 0
if tasklog
@seconds = tasklog.nexttime - curtime - 8 * 3600
@minutes = (@seconds / 60).to_i
@seconds = (@seconds % 60).to_i

@currentbar = tasklog.currentbar
tsktime = Time.parse(tasklog.runtime.to_s)
@issue = tsktime.strftime("%Y%m%d")+(tasklog.currentbar).to_s
@totalbar = 90
@currentbar = @totalbar - (tasklog.totalbar - tasklog.currentbar)
@issue = (tasklog.nextgameid.to_i-1).to_s

@grid = Grid.find_by_gameid(@issue)
@gridlogs = Tracelog.where("time > ? and userid = ?", (curtime - 60*60).strftime("%Y-%m-%d %H:%M"), session[:userid])
end

if @minutes < 0
if @minutes and @minutes < 0
@minutes = 9
end

Expand Down
2 changes: 1 addition & 1 deletion app/views/layouts/main.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@
</div>
<div class="period" style="color: green;"><%= @issue %>
</div>
<div class="period-info" >每日销售<span>90</span>期,今日剩余<span class="period-leave"><%= 90-@currentbar.to_i %></span></div>
<div class="period-info" >每日销售<span><%= @totalbar %></span>期,今日剩余<span class="period-leave"><%= 90-@currentbar.to_i %></span></div>
<div class="lot-nums">
<% if @grid %>
<span class=<%= "no#{(@grid.x1+1).to_s.rjust(2, '0')}" %>></span>
Expand Down
4 changes: 2 additions & 2 deletions config/initializers/task.rb
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ def checkGrid (object)
tasklog = Tasklog.find_by_taskdate(curtime.strftime("%Y-%m-%d"))
if tasklog == nil
tasklog = Tasklog.new
tasklog.totalbar = 228
tasklog.totalbar = left_count
tasklog.currentbar = objindex+1
tasklog.errorbar = 0
tasklog.totalcoin = totalcoin
Expand All @@ -310,7 +310,7 @@ def checkGrid (object)
tasklog.nextgameid = curtime.strftime("%Y%m%d")+(begin_count+objindex+2).to_s
tasklog.save
else
tasklog.update(currentbar: objindex+1, totalcoin: totalcoin,
tasklog.update(totalbar: left_count, currentbar: objindex+1, totalcoin: totalcoin,
prizecoin: prizecoin, runtime: curtime.strftime("%Y-%m-%d %H:%M"),
nextgameid: curtime.strftime("%Y%m%d")+(begin_count+objindex+2).to_s,
nexttime: nexttime.strftime("%Y-%m-%d %H:%M"))
Expand Down

0 comments on commit 0162cc9

Please sign in to comment.