Authored by Rock Zhang

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

Code Review By Rock Zhang
... ... @@ -25,10 +25,10 @@
性<br>别
</div>
<div class="icon boy">
<span class="check {{#if gender}}checked{{/if}}" data-gender="{{#if gender}}1{{/if}}"></span>
<span class="check {{#if isBoy}}checked{{/if}}" data-gender="1"></span>
</div>
<div class="icon girl">
<span class="check {{#unless gender}}checked{{/if}}" data-gender="{{#if gender}}2{{/if}}"></span>
<span class="check {{#unless isBoy}}checked{{/if}}" data-gender="2"></span>
</div>
<input type="hidden" name="gender" id="gender" value="{{gender}}">
</div>
... ...
... ... @@ -66,7 +66,7 @@ class YuanxiaoController extends HuodongAction
'name' => $nickName,
'type' => $result['data']['randomCode']
);
$this->setCookie('yuanxiaochouqian', json_encode($cookieData), time() + 15*60);
$this->setCookie('yuanxiaochouqian', json_encode($cookieData), time() + 15 * 60);
$this->go(Helpers::url('/cuxiao/yuanxiao/wait'));
} else { // 不成功就显示返回的错误信息
$this->_view->display('info', array(
... ... @@ -77,6 +77,7 @@ class YuanxiaoController extends HuodongAction
),
'birthday' => $birthday,
'gender' => $gender,
'isBoy' => $gender == 1, // 性别是否是女标志位
'message' => $result['message']
));
}
... ... @@ -91,6 +92,7 @@ class YuanxiaoController extends HuodongAction
),
'birthday' => $userData['birthday'],
'gender' => $userData['gender'],
'isBoy' => $userData['gender'] == 1 // 性别是否是女标志位
));
}
}
... ...