|
@@ -60,11 +60,18 @@ class bonusexControl extends mobileControl
|
|
|
$bonus = \bonus\user_bonus::create_by_param($mine_bonus);
|
|
|
$mine_bonus = bonus_helper::filter_bonus($mine_bonus);
|
|
|
|
|
|
+ if($bonus->isBinded() == false && user_helper::isVerfiyMobile())
|
|
|
+ {
|
|
|
+ $ret = bonus_helper::bind_bonus($bonus->bonus_sn(),$_SESSION['MPHPSESSID'],user_helper::cur_mobile(),$new_sn);
|
|
|
+ if($ret == true) {
|
|
|
+ $mine_bonus = bonus_helper::get_mine_by_bonussn($new_sn);
|
|
|
+ }
|
|
|
+ }
|
|
|
$data = array('type_info' => $type_info, 'mine_bonus' => $mine_bonus,'binded_info' => $binded_info);
|
|
|
- if(!$bonus->isBinded()) {
|
|
|
- return self::outsuccess($data,"bonus/bind");
|
|
|
- } else {
|
|
|
+ if($bonus->isBinded()) {
|
|
|
return self::outsuccess($data,"bonus/content");
|
|
|
+ } else {
|
|
|
+ return self::outsuccess($data,"bonus/bind");
|
|
|
}
|
|
|
}
|
|
|
else
|
|
@@ -124,9 +131,9 @@ class bonusexControl extends mobileControl
|
|
|
{
|
|
|
if(user_helper::isVerfiyMobile())
|
|
|
{
|
|
|
- $ret = bonus_helper::bind_bonus($bonus_obj->bonus_sn(),$_SESSION['PHPSESSID'],user_helper::cur_mobile());
|
|
|
+ $ret = bonus_helper::bind_bonus($bonus_obj->bonus_sn(),$_SESSION['MPHPSESSID'],user_helper::cur_mobile(),$new_sn);
|
|
|
if($ret == true) {
|
|
|
- $mine_bonus = bonus_helper::get_mine_by_bonussn($bonus_obj->bonus_sn());
|
|
|
+ $mine_bonus = bonus_helper::get_mine_by_bonussn($new_sn);
|
|
|
return self::outsuccess(array('type_info' => $type_info, 'mine_bonus' => $mine_bonus,'binded_info' => $binded_info),"bonus/content");
|
|
|
} else { //todo 此处是绑定错误...
|
|
|
return self::outsuccess(array('type_info' => $type_info, 'mine_bonus' => $mine_bonus,'binded_info' => $binded_info),"bonus/bind");
|
|
@@ -152,7 +159,8 @@ class bonusexControl extends mobileControl
|
|
|
{
|
|
|
$bonus_obj = \bonus\user_bonus::create_by_param($bonus);
|
|
|
$mine_bonus = bonus_helper::filter_bonus($bonus);
|
|
|
- if($bonus_obj->isBinded()) {
|
|
|
+ if($bonus_obj->isBinded())
|
|
|
+ {
|
|
|
$type_infos = bonus_helper::get_typeinfo($bonus_obj->type_sn());
|
|
|
if(empty($type_infos)) {
|
|
|
return self::outerr(errcode::ErrBonus,"无此红包.");
|
|
@@ -215,7 +223,7 @@ class bonusexControl extends mobileControl
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- $ret = bonus_helper::bind_bonus($bonus_sn,$_SESSION['PHPSESSID'],$mobile,$new_bonus_sn);
|
|
|
+ $ret = bonus_helper::bind_bonus($bonus_sn,$_SESSION['MPHPSESSID'],$mobile,$new_bonus_sn);
|
|
|
if($ret == true) {
|
|
|
$mine_bonus = bonus_helper::get_mine_by_bonussn($new_bonus_sn);
|
|
|
$bonus_obj = \bonus\user_bonus::create_by_param($mine_bonus);
|