Skip to content

Commit

Permalink
修复显示错误
Browse files Browse the repository at this point in the history
  • Loading branch information
heyunpeng committed Aug 15, 2015
1 parent 8fa1a91 commit e5a9e57
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 35 deletions.
25 changes: 19 additions & 6 deletions app/controllers/tracelogs_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,13 @@ def double
@gameid = taskinfo.nextgameid

if seconds > 60 and user and user.coin > totalcoin
@totalcoin = totalcoin
curtime = Time.new
for i in 1..9
if params[:tracelogs]["flag#{i}_1"].to_i > 0 or params[:tracelogs]["flag#{i}_2"].to_i > 0 or
params[:tracelogs]["flag#{i}_3"].to_i > 0
if params[:tracelogs]["flag#{i}_1"].to_i < 1000 and params[:tracelogs]["flag#{i}_2"].to_i < 1000 and
params[:tracelogs]["flag#{i}_3"].to_i < 1000
@totalcoin = totalcoin
if params[:tracelogs]["flag#{i}_1"].to_i > 0
tracelog = Tracelog.new
tracelog.pos = i
Expand Down Expand Up @@ -71,6 +73,7 @@ def double
"maintype"=>tracelog.maintype,"coin"=>tracelog.coin}
end
end
end
end
user.update(coin: user.coin-totalcoin)
end
Expand Down Expand Up @@ -100,7 +103,6 @@ def single
@gameid = taskinfo.nextgameid

if seconds > 60 and user and user.coin > totalcoin
@totalcoin = totalcoin
curtime = Time.new

for i in 1..9
Expand All @@ -109,8 +111,14 @@ def single
params[:tracelogs]["flag#{i}_5"].to_i > 0 or params[:tracelogs]["flag#{i}_6"].to_i > 0 or
params[:tracelogs]["flag#{i}_7"].to_i > 0 or params[:tracelogs]["flag#{i}_8"].to_i > 0 or
params[:tracelogs]["flag#{i}_9"].to_i > 0 or params[:tracelogs]["flag#{i}_10"].to_i > 0 or
params[:tracelogs]["flag#{i}_11"].to_i > 0 or params[:tracelogs]["flag#{i}_12"].to_i > 0 or
params[:tracelogs]["flag#{i}_13"].to_i > 0
params[:tracelogs]["flag#{i}_11"].to_i > 0
if params[:tracelogs]["flag#{i}_1"].to_i < 1000 and params[:tracelogs]["flag#{i}_2"].to_i < 1000 and
params[:tracelogs]["flag#{i}_3"].to_i < 1000 and params[:tracelogs]["flag#{i}_4"].to_i < 1000 and
params[:tracelogs]["flag#{i}_5"].to_i < 1000 and params[:tracelogs]["flag#{i}_6"].to_i < 1000 and
params[:tracelogs]["flag#{i}_7"].to_i < 1000 and params[:tracelogs]["flag#{i}_8"].to_i < 1000 and
params[:tracelogs]["flag#{i}_9"].to_i < 1000 and params[:tracelogs]["flag#{i}_10"].to_i < 1000 and
params[:tracelogs]["flag#{i}_11"].to_i < 1000
@totalcoin = totalcoin
if params[:tracelogs]["flag#{i}_1"].to_i > 0
tracelog = Tracelog.new
tracelog.pos = i
Expand Down Expand Up @@ -303,6 +311,7 @@ def single
"maintype"=>tracelog.maintype,"coin"=>tracelog.coin}
end
end
end
end

user.update(coin: user.coin-totalcoin)
Expand Down Expand Up @@ -333,10 +342,13 @@ def combination
@gameid = taskinfo.nextgameid

if seconds > 60 and user and user.coin > totalcoin
@totalcoin = totalcoin
curtime = Time.new
for i in 1..6
if params[:tracelogs]["flag#{i}_1"].to_i > 0 or params[:tracelogs]["flag#{i}_2"].to_i > 0 or params[:tracelogs]["flag#{i}_3"].to_i > 0 or params[:tracelogs]["flag#{i}_4"].to_i > 0
if params[:tracelogs]["flag#{i}_1"].to_i > 0 or params[:tracelogs]["flag#{i}_2"].to_i > 0 or
params[:tracelogs]["flag#{i}_3"].to_i > 0 or params[:tracelogs]["flag#{i}_4"].to_i > 0
if params[:tracelogs]["flag#{i}_1"].to_i < 1000 and params[:tracelogs]["flag#{i}_2"].to_i < 1000 and
params[:tracelogs]["flag#{i}_3"].to_i < 1000 and params[:tracelogs]["flag#{i}_4"].to_i < 1000
@totalcoin = totalcoin
if params[:tracelogs]["flag#{i}_1"].to_i > 0
tracelog = Tracelog.new
tracelog.pos = i
Expand Down Expand Up @@ -418,6 +430,7 @@ def combination
"maintype"=>tracelog.maintype,"coin"=>tracelog.coin}
end
end
end
end
user.update(coin: user.coin-totalcoin)
end
Expand Down
2 changes: 1 addition & 1 deletion app/views/combinationgame/_combination.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</tr>
<tr>
<td>牌面:<%if info["gametype"]==1%>三筒<%elsif info["gametype"]==2%>同花
<%elsif info["gametype"]==3%>J顺子<%else%>对子<%end%></td>
<%elsif info["gametype"]==3%>顺子<%else%>对子<%end%></td>
</tr>
<tr>
<td>下注额:</td>
Expand Down
6 changes: 3 additions & 3 deletions app/views/singlegame/_singlegame.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
<%if info["maintype"]==2%>
<td>牌面:<%if info["gametype"]==1%>A<%elsif info["gametype"]==2%>9<%elsif info["gametype"]==3%>10
<%elsif info["gametype"]==4%>J<%elsif info["gametype"]==5%>Q<%else%>K<%end%></td>
<%else%>
<td>牌面:<%if info["gametype"]==1%><%elsif info["gametype"]==2%><%elsif info["maintype"]==3%>
<%else%>梅花<%end%></td>
<%end%>
<%if info["maintype"]==4%>
<td>牌面:<%if info["gametype"]==1%><%elsif info["gametype"]==2%><%elsif info["gametype"]==3%><%else%>梅花<%end%></td>
<%end%>
</tr>
<tr>
Expand Down
36 changes: 18 additions & 18 deletions app/views/singlegame/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,8 @@ function xprint() {
<td class="nums">赔率:<font color="red"><%= @singleconfigs.mulbability %></td>
</tr>
<tr class="even">
<td class="nums"><font color="blue"><%= f.text_field :flag1_8, class:"reccheck", size:6 %></td>
<td class="nums"><font color="blue"><%= f.text_field :flag1_9, class:"reccheck", size:6 %></td>
<td class="nums"><font color="blue"><%= f.text_field :flag1_8, class:"reccheck", size:6 %></td>
<td class="nums"><font color="blue"><%= f.text_field :flag1_9, class:"reccheck", size:6 %></td>
<td class="nums"><font color="blue"><%= f.text_field :flag1_10, class:"reccheck", size:6 %></td>
<td class="nums"><font color="blue"><%= f.text_field :flag1_11, class:"reccheck", size:6 %></td>
<td></td>
Expand All @@ -176,8 +176,8 @@ function xprint() {
<td class="nums">赔率:<font color="red"><%= @singleconfigs.mulbability %>
</tr>
<tr class="odd">
<td class="nums"><font color="blue"><%= f.text_field :flag2_8, class:"reccheck", size:6 %>
<td class="nums"><font color="blue"><%= f.text_field :flag2_9, class:"reccheck", size:6 %>
<td class="nums"><font color="blue"><%= f.text_field :flag2_8, class:"reccheck", size:6 %>
<td class="nums"><font color="blue"><%= f.text_field :flag2_9, class:"reccheck", size:6 %>
<td class="nums"><font color="blue"><%= f.text_field :flag2_10, class:"reccheck", size:6 %>
<td class="nums"><font color="blue"><%= f.text_field :flag2_11, class:"reccheck", size:6 %>
<td></td>
Expand All @@ -196,8 +196,8 @@ function xprint() {
<td class="nums">赔率:<font color="red"><%= @singleconfigs.mulbability %>
</tr>
<tr class="even">
<td class="nums"><font color="blue"><%= f.text_field :flag3_8, class:"reccheck", size:6 %>
<td class="nums"><font color="blue"><%= f.text_field :flag3_9, class:"reccheck", size:6 %>
<td class="nums"><font color="blue"><%= f.text_field :flag3_8, class:"reccheck", size:6 %>
<td class="nums"><font color="blue"><%= f.text_field :flag3_9, class:"reccheck", size:6 %>
<td class="nums"><font color="blue"><%= f.text_field :flag3_10, class:"reccheck", size:6 %>
<td class="nums"><font color="blue"><%= f.text_field :flag3_11, class:"reccheck", size:6 %>
<td></td>
Expand All @@ -216,8 +216,8 @@ function xprint() {
<td class="nums">赔率:<font color="red"><%= @singleconfigs.mulbability %>
</tr>
<tr class="odd">
<td class="nums"><font color="blue"><%= f.text_field :flag4_8, class:"reccheck", size:6 %>
<td class="nums"><font color="blue"><%= f.text_field :flag4_9, class:"reccheck", size:6 %>
<td class="nums"><font color="blue"><%= f.text_field :flag4_8, class:"reccheck", size:6 %>
<td class="nums"><font color="blue"><%= f.text_field :flag4_9, class:"reccheck", size:6 %>
<td class="nums"><font color="blue"><%= f.text_field :flag4_10, class:"reccheck", size:6 %>
<td class="nums"><font color="blue"><%= f.text_field :flag4_11, class:"reccheck", size:6 %>
<td></td>
Expand All @@ -236,8 +236,8 @@ function xprint() {
<td class="nums">赔率:<font color="red"><%= @singleconfigs.mulbability %>
</tr>
<tr class="even">
<td class="nums"><font color="blue"><%= f.text_field :flag5_8, class:"reccheck", size:6 %>
<td class="nums"><font color="blue"><%= f.text_field :flag5_9, class:"reccheck", size:6 %>
<td class="nums"><font color="blue"><%= f.text_field :flag5_8, class:"reccheck", size:6 %>
<td class="nums"><font color="blue"><%= f.text_field :flag5_9, class:"reccheck", size:6 %>
<td class="nums"><font color="blue"><%= f.text_field :flag5_10, class:"reccheck", size:6 %>
<td class="nums"><font color="blue"><%= f.text_field :flag5_11, class:"reccheck", size:6 %>
<td></td>
Expand All @@ -256,8 +256,8 @@ function xprint() {
<td class="nums">赔率:<font color="red"><%= @singleconfigs.mulbability %>
</tr>
<tr class="odd">
<td class="nums"><font color="blue"><%= f.text_field :flag6_8, class:"reccheck", size:6 %>
<td class="nums"><font color="blue"><%= f.text_field :flag6_9, class:"reccheck", size:6 %>
<td class="nums"><font color="blue"><%= f.text_field :flag6_8, class:"reccheck", size:6 %>
<td class="nums"><font color="blue"><%= f.text_field :flag6_9, class:"reccheck", size:6 %>
<td class="nums"><font color="blue"><%= f.text_field :flag6_10, class:"reccheck", size:6 %>
<td class="nums"><font color="blue"><%= f.text_field :flag6_11, class:"reccheck", size:6 %>
<td></td>
Expand All @@ -276,8 +276,8 @@ function xprint() {
<td class="nums">赔率:<font color="red"><%= @singleconfigs.mulbability %>
</tr>
<tr class="even">
<td class="nums"><font color="blue"><%= f.text_field :flag7_8, class:"reccheck", size:6 %>
<td class="nums"><font color="blue"><%= f.text_field :flag7_9, class:"reccheck", size:6 %>
<td class="nums"><font color="blue"><%= f.text_field :flag7_8, class:"reccheck", size:6 %>
<td class="nums"><font color="blue"><%= f.text_field :flag7_9, class:"reccheck", size:6 %>
<td class="nums"><font color="blue"><%= f.text_field :flag7_10, class:"reccheck", size:6 %>
<td class="nums"><font color="blue"><%= f.text_field :flag7_11, class:"reccheck", size:6 %>
<td></td>
Expand All @@ -296,8 +296,8 @@ function xprint() {
<td class="nums">赔率:<font color="red"><%= @singleconfigs.mulbability %>
</tr>
<tr class="odd">
<td class="nums"><font color="blue"><%= f.text_field :flag8_8, class:"reccheck", size:6 %>
<td class="nums"><font color="blue"><%= f.text_field :flag8_9, class:"reccheck", size:6 %>
<td class="nums"><font color="blue"><%= f.text_field :flag8_8, class:"reccheck", size:6 %>
<td class="nums"><font color="blue"><%= f.text_field :flag8_9, class:"reccheck", size:6 %>
<td class="nums"><font color="blue"><%= f.text_field :flag8_10, class:"reccheck", size:6 %>
<td class="nums"><font color="blue"><%= f.text_field :flag8_11, class:"reccheck", size:6 %>
<td></td>
Expand All @@ -316,8 +316,8 @@ function xprint() {
<td class="nums">赔率:<font color="red"><%= @singleconfigs.mulbability %>
</tr>
<tr class="even">
<td class="nums"><font color="blue"><%= f.text_field :flag9_8, class:"reccheck", size:6 %>
<td class="nums"><font color="blue"><%= f.text_field :flag9_9, class:"reccheck", size:6 %>
<td class="nums"><font color="blue"><%= f.text_field :flag9_8, class:"reccheck", size:6 %>
<td class="nums"><font color="blue"><%= f.text_field :flag9_9, class:"reccheck", size:6 %>
<td class="nums"><font color="blue"><%= f.text_field :flag9_10, class:"reccheck", size:6 %>
<td class="nums"><font color="blue"><%= f.text_field :flag9_11, class:"reccheck", size:6 %>
<td></td>
Expand Down
8 changes: 2 additions & 6 deletions app/views/users/edit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,11 @@
<%= f.text_field :coin, class:"form-control", placeholder:"金币" %>
</p>
<p>
<%= f.label :lowerlimit, '上限:' %>
<%= f.label :lowerlimit, '每注下限:' %>
<%= f.text_field :lowerlimit, class:"form-control", placeholder:"下限" %>
</p>
<p>
<%= f.label :lowerlimit, '下限:' %>
<%= f.text_field :lowerlimit, class:"form-control", placeholder:"下限" %>
</p>
<p>
<%= f.label :upperlimit, '每次上限:' %>
<%= f.label :upperlimit, '每注上限:' %>
<%= f.text_field :upperlimit, class:"form-control", placeholder:"下限" %>
</p>
<p>
Expand Down
2 changes: 1 addition & 1 deletion app/views/users/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
<%= f.text_field :coin, class:"form-control", placeholder:"信用额度", value:"50000"%>
</p>
<p>
<%= f.label :lowerlimit, '每日上限:' %>
<%= f.label :lowerlimit, '每注下限:' %>
<%= f.text_field :lowerlimit, class:"form-control", placeholder:"下限", value:"1" %>
</p>
<p>
Expand Down

0 comments on commit e5a9e57

Please sign in to comment.