1
This commit is contained in:
parent
62868610e2
commit
c570136d07
@ -230,7 +230,8 @@ class ActivityController{
|
||||
$p_video = $this->getParameter(VIDEOLOTTERY_TIME);
|
||||
$free_times = $p_free['value'];
|
||||
$video_times = $p_video['value'];
|
||||
$row = $conn->execQueryOne('SELECT free_times, video_times FROM activity WHERE accountid=:accountid;',
|
||||
$flush_flag = 0;
|
||||
$row = $conn->execQueryOne('SELECT free_times, video_times, modify_time FROM activity WHERE accountid=:accountid;',
|
||||
array(
|
||||
':accountid' => $account_id
|
||||
));
|
||||
@ -252,6 +253,22 @@ class ActivityController{
|
||||
} else {
|
||||
$free_times = $p_free['value'] - $row['free_times'];
|
||||
$video_times = $p_video['value'] - $row['video_times'];
|
||||
//刷新抽奖活动奖励
|
||||
if (phpcommon\getdayseconds(time()) - phpcommon\getdayseconds($row['modify_time']) > 0) {
|
||||
$flush_flag = 1;
|
||||
$lottery_ret = $conn->execScript('UPDATE activity SET free_times=0, video_times=0, modify_time=:modify_time ' .
|
||||
' WHERE accountid=:accountid;',
|
||||
array(
|
||||
':accountid' => $account_id,
|
||||
':modify_time' => time(),
|
||||
));
|
||||
if (!$lottery_ret) {
|
||||
die();
|
||||
return;
|
||||
}
|
||||
$free_times = $p_free['value'];
|
||||
$video_times = $p_video['value'];
|
||||
}
|
||||
}
|
||||
//道具物品
|
||||
$user_db_str = $r->get($draw_uuid);
|
||||
@ -265,12 +282,7 @@ class ActivityController{
|
||||
$r -> pexpire($draw_uuid, 1000 * 3600 * 24);
|
||||
} else {
|
||||
$draw_db = json_decode($user_db_str, true);
|
||||
$rowTime = $conn->execQueryOne('SELECT modify_time FROM activity WHERE accountid=:accountid;',
|
||||
array(
|
||||
':accountid' => $account_id
|
||||
));
|
||||
|
||||
if (phpcommon\getdayseconds(time()) - phpcommon\getdayseconds($rowTime['modify_time']) > 0) {
|
||||
if ($flush_flag = 1) {
|
||||
$user_db_str = $r->get($draw_uuid);
|
||||
$draw_list = $this->randomReward(1,$account_id);
|
||||
$draw_db = json_decode($user_db_str, true);
|
||||
|
@ -506,15 +506,7 @@ class SignController{
|
||||
if (!$battle_ret) {
|
||||
die();
|
||||
}
|
||||
//刷新抽奖活动奖励
|
||||
$lottery_ret = $conn->execScript('UPDATE activity SET free_times=0, video_times=0 ' .
|
||||
' WHERE accountid=:accountid;',
|
||||
array(
|
||||
':accountid' => $account_id,
|
||||
));
|
||||
if (!$lottery_ret) {
|
||||
die();
|
||||
}
|
||||
|
||||
//刷新邀请好友奖励
|
||||
$rowShare = $conn->execQueryOne('SELECT status FROM share_achievement WHERE accountid=:accountid AND ach_id=3;',
|
||||
array(
|
||||
|
Loading…
x
Reference in New Issue
Block a user