|
@@ -104,7 +104,7 @@ class bonusexControl extends mobileControl
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- $summarys = $this->matched_goods();
|
|
|
|
|
|
+ $summarys = $this->matched_goods($type_sn);
|
|
$data = array('type_info' => $type_info,
|
|
$data = array('type_info' => $type_info,
|
|
'mine_bonus' => $mine_bonus,
|
|
'mine_bonus' => $mine_bonus,
|
|
'binded_info' => $binded_info,
|
|
'binded_info' => $binded_info,
|
|
@@ -142,7 +142,7 @@ class bonusexControl extends mobileControl
|
|
else
|
|
else
|
|
{
|
|
{
|
|
if($type->isEnd() || $type->binded_over()) {
|
|
if($type->isEnd() || $type->binded_over()) {
|
|
- $summarys = $this->matched_goods();
|
|
|
|
|
|
+ $summarys = $this->matched_goods($type_sn);
|
|
return self::outsuccess(array('type_info' => $type_info,
|
|
return self::outsuccess(array('type_info' => $type_info,
|
|
'binded_info' => $binded_info,
|
|
'binded_info' => $binded_info,
|
|
'avatars' => $avatars,
|
|
'avatars' => $avatars,
|
|
@@ -178,7 +178,7 @@ class bonusexControl extends mobileControl
|
|
$mine_bonus = bonus_helper::filter_bonus($mine_bonus);
|
|
$mine_bonus = bonus_helper::filter_bonus($mine_bonus);
|
|
}
|
|
}
|
|
|
|
|
|
- $summarys = $this->matched_goods();
|
|
|
|
|
|
+ $summarys = $this->matched_goods($type_sn);
|
|
return self::outsuccess(array('type_info' => $type_info,
|
|
return self::outsuccess(array('type_info' => $type_info,
|
|
'mine_bonus' => $mine_bonus,
|
|
'mine_bonus' => $mine_bonus,
|
|
'binded_info' => $binded_info,
|
|
'binded_info' => $binded_info,
|
|
@@ -214,7 +214,7 @@ class bonusexControl extends mobileControl
|
|
$mine_bonus = bonus_helper::filter_bonus($mine_bonus);
|
|
$mine_bonus = bonus_helper::filter_bonus($mine_bonus);
|
|
|
|
|
|
if($bonus_obj->isBinded()) {
|
|
if($bonus_obj->isBinded()) {
|
|
- $summarys = $this->matched_goods();
|
|
|
|
|
|
+ $summarys = $this->matched_goods($type_sn);
|
|
return self::outsuccess(array('type_info' => $type_info,
|
|
return self::outsuccess(array('type_info' => $type_info,
|
|
'mine_bonus' => $mine_bonus,
|
|
'mine_bonus' => $mine_bonus,
|
|
'binded_info' => $binded_info,
|
|
'binded_info' => $binded_info,
|
|
@@ -236,7 +236,7 @@ class bonusexControl extends mobileControl
|
|
$ret = bonus_helper::bind_bonus($bonus_obj->bonus_sn(),$_SESSION['MPHPSESSID'],session_helper::cur_mobile(),$new_sn);
|
|
$ret = bonus_helper::bind_bonus($bonus_obj->bonus_sn(),$_SESSION['MPHPSESSID'],session_helper::cur_mobile(),$new_sn);
|
|
if($ret == true) {
|
|
if($ret == true) {
|
|
$mine_bonus = bonus_helper::get_mine_by_bonussn($new_sn);
|
|
$mine_bonus = bonus_helper::get_mine_by_bonussn($new_sn);
|
|
- $summarys = $this->matched_goods();
|
|
|
|
|
|
+ $summarys = $this->matched_goods($type_sn);
|
|
return self::outsuccess(array('type_info' => $type_info,
|
|
return self::outsuccess(array('type_info' => $type_info,
|
|
'mine_bonus' => $mine_bonus,
|
|
'mine_bonus' => $mine_bonus,
|
|
'binded_info' => $binded_info,
|
|
'binded_info' => $binded_info,
|
|
@@ -282,7 +282,7 @@ class bonusexControl extends mobileControl
|
|
return self::outerr(errcode::ErrBonus,"无此红包.");
|
|
return self::outerr(errcode::ErrBonus,"无此红包.");
|
|
}
|
|
}
|
|
$this->fileter_typeinfos($type_infos,$type_info,$binded_info,$avatars);
|
|
$this->fileter_typeinfos($type_infos,$type_info,$binded_info,$avatars);
|
|
- $summarys = $this->matched_goods();
|
|
|
|
|
|
+ $summarys = $this->matched_goods($type_sn);
|
|
$data = array('type_info' => $type_info,
|
|
$data = array('type_info' => $type_info,
|
|
'mine_bonus' => $mine_bonus,
|
|
'mine_bonus' => $mine_bonus,
|
|
'binded_info' => $binded_info,
|
|
'binded_info' => $binded_info,
|
|
@@ -315,7 +315,7 @@ class bonusexControl extends mobileControl
|
|
$type_infos = bonus_helper::get_typeinfo($type_sn);
|
|
$type_infos = bonus_helper::get_typeinfo($type_sn);
|
|
$this->fileter_typeinfos($type_infos,$type_info,$binded_info,$avatars);
|
|
$this->fileter_typeinfos($type_infos,$type_info,$binded_info,$avatars);
|
|
$mine_bonus = bonus_helper::filter_bonus($mine_bonus);
|
|
$mine_bonus = bonus_helper::filter_bonus($mine_bonus);
|
|
- $summarys = $this->matched_goods();
|
|
|
|
|
|
+ $summarys = $this->matched_goods($type_sn);
|
|
return self::outsuccess(array('type_info' => $type_info,
|
|
return self::outsuccess(array('type_info' => $type_info,
|
|
'mine_bonus' => $mine_bonus,
|
|
'mine_bonus' => $mine_bonus,
|
|
'binded_info' => $binded_info,
|
|
'binded_info' => $binded_info,
|
|
@@ -436,7 +436,7 @@ class bonusexControl extends mobileControl
|
|
$bonus = bonus_helper::get_mine_by_bonussn($bonus_obj->bonus_sn());
|
|
$bonus = bonus_helper::get_mine_by_bonussn($bonus_obj->bonus_sn());
|
|
$type_infos = bonus_helper::get_typeinfo($bonus_obj->type_sn());
|
|
$type_infos = bonus_helper::get_typeinfo($bonus_obj->type_sn());
|
|
$this->fileter_typeinfos($type_infos,$type_info,$binded_info,$avatars);
|
|
$this->fileter_typeinfos($type_infos,$type_info,$binded_info,$avatars);
|
|
- $summarys = $this->matched_goods();
|
|
|
|
|
|
+ $summarys = $this->matched_goods($type_sn);
|
|
return self::outsuccess(array('type_info' => $type_info,
|
|
return self::outsuccess(array('type_info' => $type_info,
|
|
'mine_bonus' => $bonus,
|
|
'mine_bonus' => $bonus,
|
|
'binded_info' => $binded_info,
|
|
'binded_info' => $binded_info,
|
|
@@ -472,16 +472,34 @@ class bonusexControl extends mobileControl
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- private function random_cids()
|
|
|
|
|
|
+ private function random_cids($type_sn)
|
|
{
|
|
{
|
|
- if(session_helper::is_man()) {
|
|
|
|
- return activity\goods_sampler::instance()->fetch_male(self::bonus_goods);
|
|
|
|
- } else {
|
|
|
|
- return activity\goods_sampler::instance()->fetch_female(self::bonus_goods);
|
|
|
|
|
|
+ $time = 0;
|
|
|
|
+ $cids = [];
|
|
|
|
+ if(array_key_exists($type_sn,$_SESSION['goods_sampler']))
|
|
|
|
+ {
|
|
|
|
+ $cids = $_SESSION['goods_sampler'][$type_sn]['cids'];
|
|
|
|
+ $time = $_SESSION['goods_sampler'][$type_sn]['time'];
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if($time < time() - 86400 || empty($cids))
|
|
|
|
+ {
|
|
|
|
+ if(session_helper::is_man()) {
|
|
|
|
+ $cids = activity\goods_sampler::instance()->fetch_male(self::bonus_goods);
|
|
|
|
+ } else {
|
|
|
|
+ $cids = activity\goods_sampler::instance()->fetch_female(self::bonus_goods);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if(!empty($cids)) {
|
|
|
|
+ $_SESSION['goods_sampler'][$type_sn]['cids'] = $cids;
|
|
|
|
+ $_SESSION['goods_sampler'][$type_sn]['time'] = time();
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ return $cids;
|
|
}
|
|
}
|
|
|
|
|
|
- private function matched_goods()
|
|
|
|
|
|
+ private function matched_goods($type_sn)
|
|
{
|
|
{
|
|
if(session_helper::isapp())
|
|
if(session_helper::isapp())
|
|
{
|
|
{
|
|
@@ -489,7 +507,7 @@ class bonusexControl extends mobileControl
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
- $cids = $this->random_cids();
|
|
|
|
|
|
+ $cids = $this->random_cids($type_sn);
|
|
if(empty($cids)) return false;
|
|
if(empty($cids)) return false;
|
|
|
|
|
|
$model_goods = Model('goods');
|
|
$model_goods = Model('goods');
|