1
This commit is contained in:
parent
6e159539cc
commit
ba4e548f83
@ -205,46 +205,6 @@ class ActivityController{
|
|||||||
phpcommon\sendError(ERR_USER_BASE + 2, '没有这个玩家');
|
phpcommon\sendError(ERR_USER_BASE + 2, '没有这个玩家');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if ($_REQUEST['type'] == 0) {
|
|
||||||
$p_flush = $this->getParameter(FREELOTTERY_TIME);
|
|
||||||
if ($p_flush['value'] <= $row['free_times']) {
|
|
||||||
phpcommon\sendError(ERR_USER_BASE + 3, '今日刷新次数已满');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
$ret = $conn->execScript('UPDATE activity SET free_times=:free_times, item_id=:item_id, item_num=:item_num, modify_time=:modify_time ' .
|
|
||||||
' WHERE accountid=:accountid;',
|
|
||||||
array(
|
|
||||||
':accountid' => $account_id,
|
|
||||||
':free_times' => $row['free_times'] + 1,
|
|
||||||
':item_id' => $item_id,
|
|
||||||
':item_num' => $item_num,
|
|
||||||
':modify_time' => time()
|
|
||||||
));
|
|
||||||
if (!$ret) {
|
|
||||||
die();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if ($_REQUEST['type'] == 1) {
|
|
||||||
$p_flush = $this->getParameter(VIDEOLOTTERY_TIME);
|
|
||||||
if ($p_flush['value'] <= $row['video_times']) {
|
|
||||||
phpcommon\sendError(ERR_USER_BASE + 3, '今日刷新次数已满');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
$ret = $conn->execScript('UPDATE activity SET video_times=:video_times,item_id=:item_id, item_num=:item_num, modify_time=:modify_time ' .
|
|
||||||
' WHERE accountid=:accountid;',
|
|
||||||
array(
|
|
||||||
':accountid' => $account_id,
|
|
||||||
':video_times' => $row['video_times'] + 1,
|
|
||||||
':item_id' => $item_id,
|
|
||||||
':item_num' => $item_num,
|
|
||||||
':modify_time' => time()
|
|
||||||
));
|
|
||||||
if (!$ret) {
|
|
||||||
die();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//随机确认奖励
|
//随机确认奖励
|
||||||
$weight_sum = 0;
|
$weight_sum = 0;
|
||||||
$g_conf_lot_cluster = require('../res/lottery@lottery.php');
|
$g_conf_lot_cluster = require('../res/lottery@lottery.php');
|
||||||
@ -290,6 +250,46 @@ class ActivityController{
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($_REQUEST['type'] == 0) {
|
||||||
|
$p_flush = $this->getParameter(FREELOTTERY_TIME);
|
||||||
|
if ($p_flush['value'] <= $row['free_times']) {
|
||||||
|
phpcommon\sendError(ERR_USER_BASE + 3, '今日刷新次数已满');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
$ret = $conn->execScript('UPDATE activity SET free_times=:free_times, item_id=:item_id, item_num=:item_num, modify_time=:modify_time ' .
|
||||||
|
' WHERE accountid=:accountid;',
|
||||||
|
array(
|
||||||
|
':accountid' => $account_id,
|
||||||
|
':free_times' => $row['free_times'] + 1,
|
||||||
|
':item_id' => $item_id,
|
||||||
|
':item_num' => $item_num,
|
||||||
|
':modify_time' => time()
|
||||||
|
));
|
||||||
|
if (!$ret) {
|
||||||
|
die();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ($_REQUEST['type'] == 1) {
|
||||||
|
$p_flush = $this->getParameter(VIDEOLOTTERY_TIME);
|
||||||
|
if ($p_flush['value'] <= $row['video_times']) {
|
||||||
|
phpcommon\sendError(ERR_USER_BASE + 3, '今日刷新次数已满');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
$ret = $conn->execScript('UPDATE activity SET video_times=:video_times,item_id=:item_id, item_num=:item_num, modify_time=:modify_time ' .
|
||||||
|
' WHERE accountid=:accountid;',
|
||||||
|
array(
|
||||||
|
':accountid' => $account_id,
|
||||||
|
':video_times' => $row['video_times'] + 1,
|
||||||
|
':item_id' => $item_id,
|
||||||
|
':item_num' => $item_num,
|
||||||
|
':modify_time' => time()
|
||||||
|
));
|
||||||
|
if (!$ret) {
|
||||||
|
die();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
//增加奖励
|
//增加奖励
|
||||||
$addreward = new classes\AddReward();
|
$addreward = new classes\AddReward();
|
||||||
$addreward->addReward($item_id, $item_num, $account_id);
|
$addreward->addReward($item_id, $item_num, $account_id);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user