Authored by Rock Zhang

修复元宵抽奖页面中获取用户性别错误的bug

Code Review By Rock Zhang
@@ -25,10 +25,10 @@ @@ -25,10 +25,10 @@
25 性<br>别 25 性<br>别
26 </div> 26 </div>
27 <div class="icon boy"> 27 <div class="icon boy">
28 - <span class="check {{#if gender}}checked{{/if}}" data-gender="{{#if gender}}1{{/if}}"></span> 28 + <span class="check {{#if isBoy}}checked{{/if}}" data-gender="1"></span>
29 </div> 29 </div>
30 <div class="icon girl"> 30 <div class="icon girl">
31 - <span class="check {{#unless gender}}checked{{/if}}" data-gender="{{#if gender}}2{{/if}}"></span> 31 + <span class="check {{#unless isBoy}}checked{{/if}}" data-gender="2"></span>
32 </div> 32 </div>
33 <input type="hidden" name="gender" id="gender" value="{{gender}}"> 33 <input type="hidden" name="gender" id="gender" value="{{gender}}">
34 </div> 34 </div>
@@ -66,7 +66,7 @@ class YuanxiaoController extends HuodongAction @@ -66,7 +66,7 @@ class YuanxiaoController extends HuodongAction
66 'name' => $nickName, 66 'name' => $nickName,
67 'type' => $result['data']['randomCode'] 67 'type' => $result['data']['randomCode']
68 ); 68 );
69 - $this->setCookie('yuanxiaochouqian', json_encode($cookieData), time() + 15*60); 69 + $this->setCookie('yuanxiaochouqian', json_encode($cookieData), time() + 15 * 60);
70 $this->go(Helpers::url('/cuxiao/yuanxiao/wait')); 70 $this->go(Helpers::url('/cuxiao/yuanxiao/wait'));
71 } else { // 不成功就显示返回的错误信息 71 } else { // 不成功就显示返回的错误信息
72 $this->_view->display('info', array( 72 $this->_view->display('info', array(
@@ -77,6 +77,7 @@ class YuanxiaoController extends HuodongAction @@ -77,6 +77,7 @@ class YuanxiaoController extends HuodongAction
77 ), 77 ),
78 'birthday' => $birthday, 78 'birthday' => $birthday,
79 'gender' => $gender, 79 'gender' => $gender,
  80 + 'isBoy' => $gender == 1, // 性别是否是女标志位
80 'message' => $result['message'] 81 'message' => $result['message']
81 )); 82 ));
82 } 83 }
@@ -91,6 +92,7 @@ class YuanxiaoController extends HuodongAction @@ -91,6 +92,7 @@ class YuanxiaoController extends HuodongAction
91 ), 92 ),
92 'birthday' => $userData['birthday'], 93 'birthday' => $userData['birthday'],
93 'gender' => $userData['gender'], 94 'gender' => $userData['gender'],
  95 + 'isBoy' => $userData['gender'] == 1 // 性别是否是女标志位
94 )); 96 ));
95 } 97 }
96 } 98 }