|
@@ -48,10 +48,20 @@ class manager
|
|
$type_info['binded_period'] = $period == 0 ? 1 : $period;
|
|
$type_info['binded_period'] = $period == 0 ? 1 : $period;
|
|
}
|
|
}
|
|
$type_info['binded_over'] = 1;
|
|
$type_info['binded_over'] = 1;
|
|
- } else {
|
|
|
|
|
|
+ $type_info['grab_lastime'] = 0;
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
$type_info['binded_period'] = 0;
|
|
$type_info['binded_period'] = 0;
|
|
$type_info['binded_over'] = 0;
|
|
$type_info['binded_over'] = 0;
|
|
|
|
+ if($type->grabed_over()) {
|
|
|
|
+ $lasted_time = Model('user_bonus')->lasted_grabed(array('type_id' => $type->getType_id(),'status' => 1));
|
|
|
|
+ $type_info['grab_lastime'] = $lasted_time;
|
|
|
|
+ } else {
|
|
|
|
+ $type_info['grab_lastime'] = 0;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
+
|
|
$type_sn = $type->getType_sn();
|
|
$type_sn = $type->getType_sn();
|
|
$url = BASE_SITE_URL . "/mobile/index.php?act=bonusex&op=open&client_type=wap&type_sn={$type_sn}";
|
|
$url = BASE_SITE_URL . "/mobile/index.php?act=bonusex&op=open&client_type=wap&type_sn={$type_sn}";
|
|
$ret['url'] = $url;
|
|
$ret['url'] = $url;
|
|
@@ -67,21 +77,16 @@ class manager
|
|
|
|
|
|
public function get_mine_by_typesn($type_sn)
|
|
public function get_mine_by_typesn($type_sn)
|
|
{
|
|
{
|
|
- $bonus = '';//$this->read_session($type_sn);
|
|
|
|
|
|
+ $bonus = $this->read_session($type_sn);
|
|
if(empty($bonus))
|
|
if(empty($bonus))
|
|
{
|
|
{
|
|
$mod_bonus = Model('user_bonus');
|
|
$mod_bonus = Model('user_bonus');
|
|
|
|
|
|
$session_id = $_SESSION['PHPSESSID'];
|
|
$session_id = $_SESSION['PHPSESSID'];
|
|
if(user_helper::isVerfiyMobile()) {
|
|
if(user_helper::isVerfiyMobile()) {
|
|
-// $condition = array('type_sn' => $type_sn,
|
|
|
|
-// 'session_id' => $session_id,
|
|
|
|
-// 'user_mobile' => $_SESSION['member_mobile'],
|
|
|
|
-// '_op' => 'or');
|
|
|
|
$mobile = user_helper::cur_mobile();
|
|
$mobile = user_helper::cur_mobile();
|
|
$sql = "select * from lrlz_user_bonus where type_sn = '{$type_sn}' and (session_id = '{$session_id}' or user_mobile = '{$mobile}')";
|
|
$sql = "select * from lrlz_user_bonus where type_sn = '{$type_sn}' and (session_id = '{$session_id}' or user_mobile = '{$mobile}')";
|
|
} else {
|
|
} else {
|
|
- //$condition = array('session_id' => $session_id,'type_sn' => $type_sn);
|
|
|
|
$sql = "select * from lrlz_user_bonus where type_sn = '{$type_sn}' and session_id = '{$session_id}'";
|
|
$sql = "select * from lrlz_user_bonus where type_sn = '{$type_sn}' and session_id = '{$session_id}'";
|
|
}
|
|
}
|
|
|
|
|
|
@@ -119,9 +124,7 @@ class manager
|
|
if(user_helper::isVerfiyMobile()) {
|
|
if(user_helper::isVerfiyMobile()) {
|
|
$mobile = user_helper::cur_mobile();
|
|
$mobile = user_helper::cur_mobile();
|
|
$sql = "select * from lrlz_user_bonus where bonus_sn = '{$bonus_sn}' and (session_id = '{$session_id}' or user_mobile = '{$mobile}')";
|
|
$sql = "select * from lrlz_user_bonus where bonus_sn = '{$bonus_sn}' and (session_id = '{$session_id}' or user_mobile = '{$mobile}')";
|
|
-
|
|
|
|
} else {
|
|
} else {
|
|
- //$condition = array('session_id' => $session_id,'type_sn' => $bonus_sn);
|
|
|
|
$sql = "select * from lrlz_user_bonus where bonus_sn = '{$bonus_sn}' and session_id = '{$session_id}'";
|
|
$sql = "select * from lrlz_user_bonus where bonus_sn = '{$bonus_sn}' and session_id = '{$session_id}'";
|
|
}
|
|
}
|
|
$bonusex = $mod_bonus->get_by_sql($sql);
|
|
$bonusex = $mod_bonus->get_by_sql($sql);
|
|
@@ -158,17 +161,14 @@ class manager
|
|
'time_out' => self::grab_period_timeout,
|
|
'time_out' => self::grab_period_timeout,
|
|
'member_mobile' => $_SESSION['member_mobile']);
|
|
'member_mobile' => $_SESSION['member_mobile']);
|
|
|
|
|
|
- $isNew = false; // 是否是一个新的红包
|
|
|
|
- $bonus_obj = factory::grab_bonus($param,$isNew);
|
|
|
|
|
|
+ $bonus_obj = factory::grab_bonus($param);
|
|
if($bonus_obj == false) {
|
|
if($bonus_obj == false) {
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
$this->write_session($bonus_obj->get_param());
|
|
$this->write_session($bonus_obj->get_param());
|
|
- if($isNew && $bonus_obj->isBinded()) {
|
|
|
|
- dcache($bonus_obj->type_sn(),self::type_prefix);
|
|
|
|
- }
|
|
|
|
|
|
+ dcache($bonus_obj->type_sn(),self::type_prefix);
|
|
}
|
|
}
|
|
$bonus = $bonus_obj->get_param();
|
|
$bonus = $bonus_obj->get_param();
|
|
}
|
|
}
|