Skip to content

Commit

Permalink
修正后台
Browse files Browse the repository at this point in the history
  • Loading branch information
heyunpeng committed Jul 18, 2015
1 parent ef204ce commit 87512d7
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 10 deletions.
4 changes: 2 additions & 2 deletions app/controllers/traceresult_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class TraceresultController < ApplicationController
def index
curtime = Time.new
tasklog = Tasklog.find_by_taskdate(curtime.strftime("%Y-%m-%d"))
if tasklog
if tasklog and session[:userid] != 0
@seconds = tasklog.nexttime - curtime - 8 * 3600
@minutes = (@seconds / 60).to_i
@seconds = (@seconds % 60).to_i
Expand All @@ -14,7 +14,7 @@ def index
@issue = tsktime.strftime("%Y%m%d")+(tasklog.currentbar).to_s

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

if session.has_key?(:userid) and session[:userid] != 0
Expand Down
2 changes: 1 addition & 1 deletion app/views/main/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<%= link_to '九宫格开奖直播', controller: 'flashview', action: 'index' %>
</li>
<li data-tag="mfc">
<a href="#">免费参考</a>
<%= link_to '游戏记录', controller: 'traceresult', action: 'index' %>
</li>
<% end %>

Expand Down
4 changes: 2 additions & 2 deletions app/views/mainhistory/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
<li data-tag="kjs">
<%= link_to '九宫格开奖直播', controller: 'flashview', action: 'index' %>
</li>
<li data-tag="mfc">
<a href="#">免费参考</a>
<li data-tag="mfc">
<%= link_to '游戏记录', controller: 'traceresult', action: 'index' %>
</li>
<% end %>

Expand Down
7 changes: 2 additions & 5 deletions app/views/tracelogs/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
<th>类型</th>
<th>位置</th>
<th>金币</th>
<th>状态</th>
<th>结果</th>
<th>时间</th>
</tr>
Expand Down Expand Up @@ -59,15 +58,14 @@
<% if log.gametype == 1 %>
<td>A</td>
<% elsif log.gametype < 10 %>
<td>log.gametype</td>
<td><%=log.gametype%></td>
<% elsif log.gametype == 11 %>
<td>J</td>
<% elsif log.gametype == 12 %>
<td>Q</td>
<% elsif log.gametype == 13 %>
<td>K</td>
<% end %>
<td><%= log.gametype %></td>
<% end %>
<% if log.maintype == 1 %>
<% if log.pos == 1 %>
Expand All @@ -84,9 +82,8 @@
<td>纵三</td>
<% end %>
<% else %>
<td>log.pos</td>
<td><%=log.pos%></td>
<% end %>
<td><%= log.coin %></td>
<% if log.status == 1 %>
<td><font color="red">+<%= log.coin * log.mulbability %></font></td>
<% else %>
Expand Down

0 comments on commit 87512d7

Please sign in to comment.