adjust
This commit is contained in:
parent
01405b09cb
commit
15f55d4755
@ -202,6 +202,7 @@ CREATE TABLE `activity` (
|
|||||||
`accountid` varchar(60) NOT NULL DEFAULT '' COMMENT '账号id',
|
`accountid` varchar(60) NOT NULL DEFAULT '' COMMENT '账号id',
|
||||||
`free_times` int(11) NOT NULL DEFAULT '0' COMMENT '免费抽奖次数',
|
`free_times` int(11) NOT NULL DEFAULT '0' COMMENT '免费抽奖次数',
|
||||||
`video_times` int(11) NOT NULL DEFAULT '0' COMMENT '视频抽奖次数',
|
`video_times` int(11) NOT NULL DEFAULT '0' COMMENT '视频抽奖次数',
|
||||||
|
`diamond_times` int(11) NOT NULL DEFAULT '0' COMMENT '钻石抽奖次数',
|
||||||
`item_id` int(11) NOT NULL DEFAULT '0' COMMENT '物品id',
|
`item_id` int(11) NOT NULL DEFAULT '0' COMMENT '物品id',
|
||||||
`item_num` int(11) NOT NULL DEFAULT '0' COMMENT '物品数量',
|
`item_num` int(11) NOT NULL DEFAULT '0' COMMENT '物品数量',
|
||||||
`create_time` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
|
`create_time` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
|
||||||
|
@ -101,6 +101,7 @@ define('CLAN_DIAMOND', 164); //创建战队需要的钻石数量
|
|||||||
define('OPENING_SPEAR', 154); //新玩家奖励第一把武器
|
define('OPENING_SPEAR', 154); //新玩家奖励第一把武器
|
||||||
define('OPENING_SPEAR2', 178); //新玩家奖励第二把武器
|
define('OPENING_SPEAR2', 178); //新玩家奖励第二把武器
|
||||||
define('LOTTERY_COST', 187); //每日抽奖钻石消耗
|
define('LOTTERY_COST', 187); //每日抽奖钻石消耗
|
||||||
|
define('DIAMONDLOTTERY_TIME', 188); //每日消耗钻石抽奖次数
|
||||||
|
|
||||||
require 'config_loader.php';
|
require 'config_loader.php';
|
||||||
|
|
||||||
|
@ -5,7 +5,8 @@ require 'classes/AddReward.php';
|
|||||||
require_once 'metatable/draw.php';
|
require_once 'metatable/draw.php';
|
||||||
require_once 'metatable/parameter.php';
|
require_once 'metatable/parameter.php';
|
||||||
require_once 'metatable/drop.php';
|
require_once 'metatable/drop.php';
|
||||||
class ActivityController{
|
class ActivityController
|
||||||
|
{
|
||||||
|
|
||||||
private $actTableCache = null;
|
private $actTableCache = null;
|
||||||
protected function getMysql($account_id)
|
protected function getMysql($account_id)
|
||||||
@ -189,25 +190,31 @@ class ActivityController{
|
|||||||
//刷新次数
|
//刷新次数
|
||||||
$p_free = $this->getParameter(FREELOTTERY_TIME);
|
$p_free = $this->getParameter(FREELOTTERY_TIME);
|
||||||
$p_video = $this->getParameter(VIDEOLOTTERY_TIME);
|
$p_video = $this->getParameter(VIDEOLOTTERY_TIME);
|
||||||
|
$p_diamond = $this->getParameter(DIAMONDLOTTERY_TIME);
|
||||||
$costlist = $this->getParameter(LOTTERY_COST);
|
$costlist = $this->getParameter(LOTTERY_COST);
|
||||||
$free_times = $p_free['value'];
|
$free_times = $p_free['value'];
|
||||||
$video_times = $p_video['value'];
|
$video_times = $p_video['value'];
|
||||||
|
$diamond_times = $p_diamond['value'];
|
||||||
$flush_flag = 0;
|
$flush_flag = 0;
|
||||||
$now_days = 1;
|
$now_days = 1;
|
||||||
$cur_cost = -1;
|
$cur_cost = -1;
|
||||||
$row = $conn->execQueryOne('SELECT free_times, video_times, now_days, modify_time FROM activity WHERE accountid=:accountid;',
|
$row = $conn->execQueryOne(
|
||||||
|
'SELECT free_times, video_times, diamond_times, now_days, modify_time FROM activity WHERE accountid=:accountid;',
|
||||||
array(
|
array(
|
||||||
':accountid' => $account_id
|
':accountid' => $account_id
|
||||||
));
|
)
|
||||||
|
);
|
||||||
if (!$row) {
|
if (!$row) {
|
||||||
$ret = $conn->execScript('INSERT INTO activity(accountid, free_times, video_times, item_id, item_num, create_time, modify_time, now_days) ' .
|
$ret = $conn->execScript(
|
||||||
|
'INSERT INTO activity(accountid, free_times, video_times, diamond_times, item_id, item_num, create_time, modify_time, now_days) ' .
|
||||||
' VALUES(:accountid, 0, 0, 0, 0, :create_time, :modify_time, 1) ' .
|
' VALUES(:accountid, 0, 0, 0, 0, :create_time, :modify_time, 1) ' .
|
||||||
' ON DUPLICATE KEY UPDATE accountid=:accountid, free_times=0, video_times=0, item_id=0, item_num=0, modify_time=:modify_time, now_days=1;',
|
' ON DUPLICATE KEY UPDATE accountid=:accountid, free_times=0, video_times=0, diamond_times=0, item_id=0, item_num=0, modify_time=:modify_time, now_days=1;',
|
||||||
array(
|
array(
|
||||||
':accountid' => $account_id,
|
':accountid' => $account_id,
|
||||||
':create_time' => time(),
|
':create_time' => time(),
|
||||||
':modify_time' => time()
|
':modify_time' => time()
|
||||||
));
|
)
|
||||||
|
);
|
||||||
if (!$ret) {
|
if (!$ret) {
|
||||||
die();
|
die();
|
||||||
return;
|
return;
|
||||||
@ -215,34 +222,39 @@ class ActivityController{
|
|||||||
$now_days = 1;
|
$now_days = 1;
|
||||||
$free_times = $p_free['value'];
|
$free_times = $p_free['value'];
|
||||||
$video_times = $p_video['value'];
|
$video_times = $p_video['value'];
|
||||||
|
$diamond_times = $p_diamond['value'];
|
||||||
} else {
|
} else {
|
||||||
$free_times = $p_free['value'] - $row['free_times'];
|
$free_times = $p_free['value'] - $row['free_times'];
|
||||||
$video_times = $p_video['value'] - $row['video_times'];
|
$video_times = $p_video['value'] - $row['video_times'];
|
||||||
|
$diamond_times = $p_diamond['value'] - $row['diamond_times'];
|
||||||
$now_days = $row['now_days'];
|
$now_days = $row['now_days'];
|
||||||
//刷新抽奖活动奖励
|
//刷新抽奖活动奖励
|
||||||
if (phpcommon\getdayseconds(time()) - phpcommon\getdayseconds($row['modify_time']) > 0) {
|
if (phpcommon\getdayseconds(time()) - phpcommon\getdayseconds($row['modify_time']) > 0) {
|
||||||
$flush_flag = 1;
|
$flush_flag = 1;
|
||||||
$lottery_ret = $conn->execScript('UPDATE activity SET free_times=0, video_times=0, modify_time=:modify_time ' .
|
$lottery_ret = $conn->execScript(
|
||||||
|
'UPDATE activity SET free_times=0, video_times=0, diamond_times=0, modify_time=:modify_time ' .
|
||||||
' WHERE accountid=:accountid;',
|
' WHERE accountid=:accountid;',
|
||||||
array(
|
array(
|
||||||
':accountid' => $account_id,
|
':accountid' => $account_id,
|
||||||
':modify_time' => time(),
|
':modify_time' => time(),
|
||||||
));
|
)
|
||||||
|
);
|
||||||
if (!$lottery_ret) {
|
if (!$lottery_ret) {
|
||||||
die();
|
die();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$free_times = $p_free['value'];
|
$free_times = $p_free['value'];
|
||||||
$video_times = $p_video['value'];
|
$video_times = $p_video['value'];
|
||||||
|
$diamond_times = $p_diamond['value'];
|
||||||
|
$now_days = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($diamond_times > 0) {
|
||||||
$coststrs = explode("|", $costlist['value']);
|
$coststrs = explode("|", $costlist['value']);
|
||||||
$costlen = sizeof($coststrs);
|
$costlen = sizeof($coststrs);
|
||||||
$left = $free_times + $video_times;
|
if ($costlen >= $diamond_times) {
|
||||||
if ($left > 0) {
|
$cur_cost = $coststrs[$costlen - $diamond_times];
|
||||||
if ($costlen >= $left) {
|
|
||||||
$cur_cost = $coststrs[$costlen - $left];
|
|
||||||
} else {
|
} else {
|
||||||
$cur_cost = $coststrs[$costlen - 1];
|
$cur_cost = $coststrs[$costlen - 1];
|
||||||
}
|
}
|
||||||
@ -305,6 +317,7 @@ class ActivityController{
|
|||||||
'draw_uuid' => $draw_uuid,
|
'draw_uuid' => $draw_uuid,
|
||||||
'free_times' => $free_times,
|
'free_times' => $free_times,
|
||||||
'video_times' => $video_times,
|
'video_times' => $video_times,
|
||||||
|
'diamond_times' => $diamond_times,
|
||||||
'cur_price' => $cur_cost,
|
'cur_price' => $cur_cost,
|
||||||
'item_list' => $draw_list,
|
'item_list' => $draw_list,
|
||||||
));
|
));
|
||||||
@ -324,10 +337,12 @@ class ActivityController{
|
|||||||
phpcommon\sendError(ERR_USER_BASE + 2, '没有这个玩家');
|
phpcommon\sendError(ERR_USER_BASE + 2, '没有这个玩家');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$row = $conn->execQueryOne('SELECT free_times, video_times, now_days FROM activity WHERE accountid=:accountid;',
|
$row = $conn->execQueryOne(
|
||||||
|
'SELECT free_times, video_times, diamond_times, now_days FROM activity WHERE accountid=:accountid;',
|
||||||
array(
|
array(
|
||||||
':accountid' => $account_id
|
':accountid' => $account_id
|
||||||
));
|
)
|
||||||
|
);
|
||||||
if (!$row) {
|
if (!$row) {
|
||||||
phpcommon\sendError(ERR_USER_BASE + 2, '没有这个玩家');
|
phpcommon\sendError(ERR_USER_BASE + 2, '没有这个玩家');
|
||||||
return;
|
return;
|
||||||
@ -335,8 +350,9 @@ class ActivityController{
|
|||||||
|
|
||||||
$p_free = $this->getParameter(FREELOTTERY_TIME);
|
$p_free = $this->getParameter(FREELOTTERY_TIME);
|
||||||
$p_video = $this->getParameter(VIDEOLOTTERY_TIME);
|
$p_video = $this->getParameter(VIDEOLOTTERY_TIME);
|
||||||
|
$p_diamond = $this->getParameter(DIAMONDLOTTERY_TIME);
|
||||||
$costlist = $this->getParameter(LOTTERY_COST);
|
$costlist = $this->getParameter(LOTTERY_COST);
|
||||||
$left = $p_free['value'] + $p_video['value'] - $row['free_times'] - $row['video_times'];
|
$left = $p_free['value'] + $p_video['value'] + $p_diamond['value'] - $row['free_times'] - $row['video_times'] - $row['diamond_times'];
|
||||||
if ($left < 1) {
|
if ($left < 1) {
|
||||||
phpcommon\sendError(ERR_USER_BASE + 2, '没有这个玩家');
|
phpcommon\sendError(ERR_USER_BASE + 2, '没有这个玩家');
|
||||||
return;
|
return;
|
||||||
@ -363,11 +379,13 @@ class ActivityController{
|
|||||||
phpcommon\sendError(ERR_USER_BASE + 1, 'session失效');
|
phpcommon\sendError(ERR_USER_BASE + 1, 'session失效');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if ($row['free_times'] + $row['video_times'] + 1 == 5) {
|
if ($row['free_times'] + $row['video_times'] + $row['diamond_times'] + 1 == 5) {
|
||||||
$day = 1;
|
$day = 1;
|
||||||
if (phpcommon\extractChannel($account_id) == 6001 ||
|
if (
|
||||||
|
phpcommon\extractChannel($account_id) == 6001 ||
|
||||||
phpcommon\extractChannel($account_id) == 6000 ||
|
phpcommon\extractChannel($account_id) == 6000 ||
|
||||||
phpcommon\extractChannel($account_id) == 6006) {
|
phpcommon\extractChannel($account_id) == 6006
|
||||||
|
) {
|
||||||
$day = $row['now_days'];
|
$day = $row['now_days'];
|
||||||
}
|
}
|
||||||
$g_conf_lot_cluster = require('../res/lottery@lottery.php');
|
$g_conf_lot_cluster = require('../res/lottery@lottery.php');
|
||||||
@ -431,6 +449,51 @@ class ActivityController{
|
|||||||
phpcommon\sendError(ERR_USER_BASE + 3, '没有这个物品');
|
phpcommon\sendError(ERR_USER_BASE + 3, '没有这个物品');
|
||||||
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;
|
||||||
|
}
|
||||||
|
} else 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;
|
||||||
|
}
|
||||||
|
} else if ($_REQUEST['type'] == 2) {
|
||||||
//扣钻石
|
//扣钻石
|
||||||
$cur_cost = 0;
|
$cur_cost = 0;
|
||||||
$coststrs = explode("|", $costlist['value']);
|
$coststrs = explode("|", $costlist['value']);
|
||||||
@ -470,35 +533,14 @@ class ActivityController{
|
|||||||
die();
|
die();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if ($_REQUEST['type'] == 0) {
|
$p_flush = $this->getParameter(DIAMONDLOTTERY_TIME);
|
||||||
$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;
|
|
||||||
}
|
|
||||||
} else if ($_REQUEST['type'] == 1) {
|
|
||||||
$p_flush = $this->getParameter(VIDEOLOTTERY_TIME);
|
|
||||||
$now_days = $row['now_days'];
|
$now_days = $row['now_days'];
|
||||||
if ($p_flush['value'] <= $row['video_times']) {
|
if ($p_flush['value'] <= $row['diamond_times']) {
|
||||||
phpcommon\sendError(ERR_USER_BASE + 3, '今日刷新次数已满');
|
phpcommon\sendError(ERR_USER_BASE + 3, '今日刷新次数已满');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if ($p_flush['value'] == $row['video_times'] + 1) {
|
if ($p_flush['value'] == $row['diamond_times'] + 1) {
|
||||||
$last_conf = $this->getLottery(count($g_conf_lot_cluster));
|
$last_conf = $this->getLottery(count($g_conf_lot_cluster));
|
||||||
$now_days++;
|
$now_days++;
|
||||||
if ($last_conf && $now_days >= $last_conf['day']) {
|
if ($last_conf && $now_days >= $last_conf['day']) {
|
||||||
@ -508,20 +550,24 @@ class ActivityController{
|
|||||||
$now_days = 1;
|
$now_days = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$ret = $conn->execScript('UPDATE activity SET video_times=:video_times,item_id=:item_id, item_num=:item_num, modify_time=:modify_time, now_days=:now_days ' .
|
|
||||||
|
$ret = $conn->execScript(
|
||||||
|
'UPDATE activity SET diamond_times=:diamond_times,item_id=:item_id, item_num=:item_num, modify_time=:modify_time, now_days=:now_days ' .
|
||||||
' WHERE accountid=:accountid;',
|
' WHERE accountid=:accountid;',
|
||||||
array(
|
array(
|
||||||
':accountid' => $account_id,
|
':accountid' => $account_id,
|
||||||
':video_times' => $row['video_times'] + 1,
|
':diamond_times' => $row['diamond_times'] + 1,
|
||||||
':item_id' => $item_id,
|
':item_id' => $item_id,
|
||||||
':item_num' => $item_num,
|
':item_num' => $item_num,
|
||||||
':modify_time' => time(),
|
':modify_time' => time(),
|
||||||
':now_days' => $now_days
|
':now_days' => $now_days
|
||||||
));
|
)
|
||||||
|
);
|
||||||
if (!$ret) {
|
if (!$ret) {
|
||||||
die();
|
die();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
die();
|
die();
|
||||||
return;
|
return;
|
||||||
@ -597,7 +643,7 @@ class ActivityController{
|
|||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function luckDrawInfo()
|
private function luckDrawInfo()
|
||||||
{
|
{
|
||||||
$account_id = $_REQUEST['account_id'];
|
$account_id = $_REQUEST['account_id'];
|
||||||
//登录校验
|
//登录校验
|
||||||
@ -623,46 +669,57 @@ class ActivityController{
|
|||||||
//刷新次数
|
//刷新次数
|
||||||
$p_free = $this->getParameter(FREELOTTERY_TIME);
|
$p_free = $this->getParameter(FREELOTTERY_TIME);
|
||||||
$p_video = $this->getParameter(VIDEOLOTTERY_TIME);
|
$p_video = $this->getParameter(VIDEOLOTTERY_TIME);
|
||||||
|
$p_diamond = $this->getParameter(DIAMONDLOTTERY_TIME);
|
||||||
$free_times = $p_free['value'];
|
$free_times = $p_free['value'];
|
||||||
$video_times = $p_video['value'];
|
$video_times = $p_video['value'];
|
||||||
|
$diamond_times = $p_diamond['value'];
|
||||||
$flush_flag = 0;
|
$flush_flag = 0;
|
||||||
$row = $conn->execQueryOne('SELECT free_times, video_times, modify_time FROM activity WHERE accountid=:accountid;',
|
$row = $conn->execQueryOne(
|
||||||
|
'SELECT free_times, video_times, diamond_times, modify_time FROM activity WHERE accountid=:accountid;',
|
||||||
array(
|
array(
|
||||||
':accountid' => $account_id
|
':accountid' => $account_id
|
||||||
));
|
)
|
||||||
|
);
|
||||||
if (!$row) {
|
if (!$row) {
|
||||||
$ret = $conn->execScript('INSERT INTO activity(accountid, free_times, video_times, item_id, item_num, create_time, modify_time) ' .
|
$ret = $conn->execScript(
|
||||||
' VALUES(:accountid, 0, 0, 0, 0, :create_time, :modify_time) ' .
|
'INSERT INTO activity(accountid, free_times, video_times, diamond_times, item_id, item_num, create_time, modify_time) ' .
|
||||||
' ON DUPLICATE KEY UPDATE accountid=:accountid, free_times=0, video_times=0, item_id=0, item_num=0, modify_time=:modify_time;',
|
' VALUES(:accountid, 0, 0, 0, 0, 0, :create_time, :modify_time) ' .
|
||||||
|
' ON DUPLICATE KEY UPDATE accountid=:accountid, free_times=0, video_times=0, diamond_times=0, item_id=0, item_num=0, modify_time=:modify_time;',
|
||||||
array(
|
array(
|
||||||
':accountid' => $account_id,
|
':accountid' => $account_id,
|
||||||
':create_time' => time(),
|
':create_time' => time(),
|
||||||
':modify_time' => time()
|
':modify_time' => time()
|
||||||
));
|
)
|
||||||
|
);
|
||||||
if (!$ret) {
|
if (!$ret) {
|
||||||
die();
|
die();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$free_times = $p_free['value'];
|
$free_times = $p_free['value'];
|
||||||
$video_times = $p_video['value'];
|
$video_times = $p_video['value'];
|
||||||
|
$diamond_times = $p_diamond['value'];
|
||||||
} else {
|
} else {
|
||||||
$free_times = $p_free['value'] - $row['free_times'];
|
$free_times = $p_free['value'] - $row['free_times'];
|
||||||
$video_times = $p_video['value'] - $row['video_times'];
|
$video_times = $p_video['value'] - $row['video_times'];
|
||||||
|
$diamond_times = $p_diamond['value'] - $row['diamond_times'];
|
||||||
//刷新抽奖活动奖励
|
//刷新抽奖活动奖励
|
||||||
if (phpcommon\getdayseconds(time()) - phpcommon\getdayseconds($row['modify_time']) > 0) {
|
if (phpcommon\getdayseconds(time()) - phpcommon\getdayseconds($row['modify_time']) > 0) {
|
||||||
$flush_flag = 1;
|
$flush_flag = 1;
|
||||||
$lottery_ret = $conn->execScript('UPDATE activity SET free_times=0, video_times=0, modify_time=:modify_time ' .
|
$lottery_ret = $conn->execScript(
|
||||||
|
'UPDATE activity SET free_times=0, video_times=0, diamond_times=0, modify_time=:modify_time ' .
|
||||||
' WHERE accountid=:accountid;',
|
' WHERE accountid=:accountid;',
|
||||||
array(
|
array(
|
||||||
':accountid' => $account_id,
|
':accountid' => $account_id,
|
||||||
':modify_time' => time(),
|
':modify_time' => time(),
|
||||||
));
|
)
|
||||||
|
);
|
||||||
if (!$lottery_ret) {
|
if (!$lottery_ret) {
|
||||||
die();
|
die();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$free_times = $p_free['value'];
|
$free_times = $p_free['value'];
|
||||||
$video_times = $p_video['value'];
|
$video_times = $p_video['value'];
|
||||||
|
$diamond_times = $p_diamond['value'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//道具物品
|
//道具物品
|
||||||
@ -716,12 +773,12 @@ class ActivityController{
|
|||||||
'draw_uuid' => $draw_uuid,
|
'draw_uuid' => $draw_uuid,
|
||||||
'free_times' => $free_times,
|
'free_times' => $free_times,
|
||||||
'video_times' => $video_times,
|
'video_times' => $video_times,
|
||||||
|
'diamond_times' => $diamond_times,
|
||||||
'item_list' => $draw_list,
|
'item_list' => $draw_list,
|
||||||
));
|
));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getDrawTable()
|
private function getDrawTable()
|
||||||
{
|
{
|
||||||
$account_id = $_REQUEST['account_id'];
|
$account_id = $_REQUEST['account_id'];
|
||||||
//登录校验
|
//登录校验
|
||||||
@ -785,13 +842,15 @@ class ActivityController{
|
|||||||
phpcommon\sendError(ERR_USER_BASE + 3, '没有这个物品');
|
phpcommon\sendError(ERR_USER_BASE + 3, '没有这个物品');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$ret = $conn->execScript('UPDATE activity SET item_id=:item_id, item_num=:item_num ' .
|
$ret = $conn->execScript(
|
||||||
|
'UPDATE activity SET item_id=:item_id, item_num=:item_num ' .
|
||||||
' WHERE accountid=:accountid;',
|
' WHERE accountid=:accountid;',
|
||||||
array(
|
array(
|
||||||
':accountid' => $account_id,
|
':accountid' => $account_id,
|
||||||
':item_id' => $item_id,
|
':item_id' => $item_id,
|
||||||
':item_num' => $item_num,
|
':item_num' => $item_num,
|
||||||
));
|
)
|
||||||
|
);
|
||||||
if (!$ret) {
|
if (!$ret) {
|
||||||
die();
|
die();
|
||||||
return;
|
return;
|
||||||
@ -831,10 +890,12 @@ class ActivityController{
|
|||||||
phpcommon\sendError(ERR_USER_BASE + 2, '没有这个玩家');
|
phpcommon\sendError(ERR_USER_BASE + 2, '没有这个玩家');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$row = $conn->execQueryOne('SELECT free_times, video_times FROM activity WHERE accountid=:accountid;',
|
$row = $conn->execQueryOne(
|
||||||
|
'SELECT free_times, video_times, diamond_times FROM activity WHERE accountid=:accountid;',
|
||||||
array(
|
array(
|
||||||
':accountid' => $account_id
|
':accountid' => $account_id
|
||||||
));
|
)
|
||||||
|
);
|
||||||
if (!$row) {
|
if (!$row) {
|
||||||
phpcommon\sendError(ERR_USER_BASE + 2, '没有这个玩家');
|
phpcommon\sendError(ERR_USER_BASE + 2, '没有这个玩家');
|
||||||
return;
|
return;
|
||||||
@ -861,11 +922,13 @@ class ActivityController{
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($row['free_times'] + $row['video_times'] + 1 == 5) {
|
if ($row['free_times'] + $row['video_times'] + $row['diamond_times'] + 1 == 5) {
|
||||||
$day = 1;
|
$day = 1;
|
||||||
if (phpcommon\extractChannel($account_id) == DOUYIN_CHANNEL ||
|
if (
|
||||||
|
phpcommon\extractChannel($account_id) == DOUYIN_CHANNEL ||
|
||||||
phpcommon\extractChannel($account_id) == 6001 ||
|
phpcommon\extractChannel($account_id) == 6001 ||
|
||||||
phpcommon\extractChannel($account_id) == 6000) {
|
phpcommon\extractChannel($account_id) == 6000
|
||||||
|
) {
|
||||||
$day = date('w', time());
|
$day = date('w', time());
|
||||||
if ($day == 0) {
|
if ($day == 0) {
|
||||||
$day = 7;
|
$day = 7;
|
||||||
@ -890,7 +953,7 @@ class ActivityController{
|
|||||||
} else {
|
} else {
|
||||||
$key = $lot_array[1]['key'];
|
$key = $lot_array[1]['key'];
|
||||||
}
|
}
|
||||||
} else if ($row['free_times'] + $row['video_times'] + 1 == 6) {
|
} else if ($row['free_times'] + $row['video_times'] + $row['diamond_times'] + 1 == 6) {
|
||||||
foreach ($user_db['draw_list'] as $draw) {
|
foreach ($user_db['draw_list'] as $draw) {
|
||||||
if (isset($draw['status']) && $draw['status'] != 0) {
|
if (isset($draw['status']) && $draw['status'] != 0) {
|
||||||
continue;
|
continue;
|
||||||
@ -972,7 +1035,8 @@ class ActivityController{
|
|||||||
phpcommon\sendError(ERR_USER_BASE + 3, '今日刷新次数已满');
|
phpcommon\sendError(ERR_USER_BASE + 3, '今日刷新次数已满');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$ret = $conn->execScript('UPDATE activity SET free_times=:free_times, item_id=:item_id, item_num=:item_num, modify_time=:modify_time ' .
|
$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;',
|
' WHERE accountid=:accountid;',
|
||||||
array(
|
array(
|
||||||
':accountid' => $account_id,
|
':accountid' => $account_id,
|
||||||
@ -980,7 +1044,8 @@ class ActivityController{
|
|||||||
':item_id' => $item_id,
|
':item_id' => $item_id,
|
||||||
':item_num' => $item_num,
|
':item_num' => $item_num,
|
||||||
':modify_time' => time()
|
':modify_time' => time()
|
||||||
));
|
)
|
||||||
|
);
|
||||||
if (!$ret) {
|
if (!$ret) {
|
||||||
die();
|
die();
|
||||||
return;
|
return;
|
||||||
@ -992,7 +1057,8 @@ class ActivityController{
|
|||||||
phpcommon\sendError(ERR_USER_BASE + 3, '今日刷新次数已满');
|
phpcommon\sendError(ERR_USER_BASE + 3, '今日刷新次数已满');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$ret = $conn->execScript('UPDATE activity SET video_times=:video_times,item_id=:item_id, item_num=:item_num, modify_time=:modify_time ' .
|
$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;',
|
' WHERE accountid=:accountid;',
|
||||||
array(
|
array(
|
||||||
':accountid' => $account_id,
|
':accountid' => $account_id,
|
||||||
@ -1000,7 +1066,8 @@ class ActivityController{
|
|||||||
':item_id' => $item_id,
|
':item_id' => $item_id,
|
||||||
':item_num' => $item_num,
|
':item_num' => $item_num,
|
||||||
':modify_time' => time()
|
':modify_time' => time()
|
||||||
));
|
)
|
||||||
|
);
|
||||||
if (!$ret) {
|
if (!$ret) {
|
||||||
die();
|
die();
|
||||||
return;
|
return;
|
||||||
@ -1035,10 +1102,12 @@ class ActivityController{
|
|||||||
phpcommon\sendError(ERR_USER_BASE + 2, '没有这个玩家');
|
phpcommon\sendError(ERR_USER_BASE + 2, '没有这个玩家');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$row = $conn->execQueryOne('SELECT item_id, item_num FROM activity WHERE accountid=:accountid;',
|
$row = $conn->execQueryOne(
|
||||||
|
'SELECT item_id, item_num FROM activity WHERE accountid=:accountid;',
|
||||||
array(
|
array(
|
||||||
':accountid' => $account_id
|
':accountid' => $account_id
|
||||||
));
|
)
|
||||||
|
);
|
||||||
if (!$row) {
|
if (!$row) {
|
||||||
phpcommon\sendError(ERR_USER_BASE + 2, '没有这个玩家');
|
phpcommon\sendError(ERR_USER_BASE + 2, '没有这个玩家');
|
||||||
return;
|
return;
|
||||||
@ -1067,8 +1136,10 @@ class ActivityController{
|
|||||||
|
|
||||||
$day = 1;
|
$day = 1;
|
||||||
if ($type == 1) {
|
if ($type == 1) {
|
||||||
if (phpcommon\extractChannel($accountid) == 6001 ||
|
if (
|
||||||
phpcommon\extractChannel($accountid) == 6000) {
|
phpcommon\extractChannel($accountid) == 6001 ||
|
||||||
|
phpcommon\extractChannel($accountid) == 6000
|
||||||
|
) {
|
||||||
$day = $days;
|
$day = $days;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1133,9 +1204,11 @@ class ActivityController{
|
|||||||
}
|
}
|
||||||
$day = 1;
|
$day = 1;
|
||||||
if ($type == 1) {
|
if ($type == 1) {
|
||||||
if (phpcommon\extractChannel($accountid) == 6001 ||
|
if (
|
||||||
|
phpcommon\extractChannel($accountid) == 6001 ||
|
||||||
phpcommon\extractChannel($accountid) == 6006 ||
|
phpcommon\extractChannel($accountid) == 6006 ||
|
||||||
phpcommon\extractChannel($accountid) == 6000) {
|
phpcommon\extractChannel($accountid) == 6000
|
||||||
|
) {
|
||||||
$day = date('w', time());
|
$day = date('w', time());
|
||||||
if ($day == 0) {
|
if ($day == 0) {
|
||||||
$day = 7;
|
$day = 7;
|
||||||
@ -1345,10 +1418,12 @@ class ActivityController{
|
|||||||
phpcommon\sendError(ERR_USER_BASE + 2, '没有这个玩家');
|
phpcommon\sendError(ERR_USER_BASE + 2, '没有这个玩家');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$row = $conn->execQueryOne('SELECT daily_order1, daily_order2, daily_order3 FROM user WHERE accountid=:accountid;',
|
$row = $conn->execQueryOne(
|
||||||
|
'SELECT daily_order1, daily_order2, daily_order3 FROM user WHERE accountid=:accountid;',
|
||||||
array(
|
array(
|
||||||
':accountid' => $account_id
|
':accountid' => $account_id
|
||||||
));
|
)
|
||||||
|
);
|
||||||
if (!$row) {
|
if (!$row) {
|
||||||
phpcommon\sendError(ERR_USER_BASE + 2, '没有这个玩家');
|
phpcommon\sendError(ERR_USER_BASE + 2, '没有这个玩家');
|
||||||
return;
|
return;
|
||||||
@ -1456,14 +1531,16 @@ class ActivityController{
|
|||||||
'status' => $status
|
'status' => $status
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
$ret = $conn->execScript('UPDATE user SET daily_order1=:daily_order1, daily_order2=:daily_order2, daily_order3=:daily_order3 ' .
|
$ret = $conn->execScript(
|
||||||
|
'UPDATE user SET daily_order1=:daily_order1, daily_order2=:daily_order2, daily_order3=:daily_order3 ' .
|
||||||
' WHERE accountid=:accountid;',
|
' WHERE accountid=:accountid;',
|
||||||
array(
|
array(
|
||||||
':accountid' => $account_id,
|
':accountid' => $account_id,
|
||||||
':daily_order1' => $daily_order1,
|
':daily_order1' => $daily_order1,
|
||||||
':daily_order2' => $daily_order2,
|
':daily_order2' => $daily_order2,
|
||||||
':daily_order3' => $daily_order3
|
':daily_order3' => $daily_order3
|
||||||
));
|
)
|
||||||
|
);
|
||||||
if (!$ret) {
|
if (!$ret) {
|
||||||
die();
|
die();
|
||||||
return;
|
return;
|
||||||
@ -1490,10 +1567,12 @@ class ActivityController{
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$id = $_REQUEST['id'];
|
$id = $_REQUEST['id'];
|
||||||
$row = $conn->execQueryOne('SELECT daily_order1, daily_order2, daily_order3 FROM user WHERE accountid=:accountid;',
|
$row = $conn->execQueryOne(
|
||||||
|
'SELECT daily_order1, daily_order2, daily_order3 FROM user WHERE accountid=:accountid;',
|
||||||
array(
|
array(
|
||||||
':accountid' => $account_id
|
':accountid' => $account_id
|
||||||
));
|
)
|
||||||
|
);
|
||||||
if (!$row) {
|
if (!$row) {
|
||||||
phpcommon\sendError(ERR_USER_BASE + 2, '没有这个玩家');
|
phpcommon\sendError(ERR_USER_BASE + 2, '没有这个玩家');
|
||||||
return;
|
return;
|
||||||
@ -1503,11 +1582,13 @@ class ActivityController{
|
|||||||
phpcommon\sendError(ERR_USER_BASE + 3, '奖励不可领');
|
phpcommon\sendError(ERR_USER_BASE + 3, '奖励不可领');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$ret = $conn->execScript('UPDATE user SET daily_order1=2 ' .
|
$ret = $conn->execScript(
|
||||||
|
'UPDATE user SET daily_order1=2 ' .
|
||||||
' WHERE accountid=:accountid;',
|
' WHERE accountid=:accountid;',
|
||||||
array(
|
array(
|
||||||
':accountid' => $account_id,
|
':accountid' => $account_id,
|
||||||
));
|
)
|
||||||
|
);
|
||||||
if (!$ret) {
|
if (!$ret) {
|
||||||
die();
|
die();
|
||||||
return;
|
return;
|
||||||
@ -1517,11 +1598,13 @@ class ActivityController{
|
|||||||
phpcommon\sendError(ERR_USER_BASE + 3, '奖励不可领');
|
phpcommon\sendError(ERR_USER_BASE + 3, '奖励不可领');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$ret = $conn->execScript('UPDATE user SET daily_order2=2 ' .
|
$ret = $conn->execScript(
|
||||||
|
'UPDATE user SET daily_order2=2 ' .
|
||||||
' WHERE accountid=:accountid;',
|
' WHERE accountid=:accountid;',
|
||||||
array(
|
array(
|
||||||
':accountid' => $account_id,
|
':accountid' => $account_id,
|
||||||
));
|
)
|
||||||
|
);
|
||||||
if (!$ret) {
|
if (!$ret) {
|
||||||
die();
|
die();
|
||||||
return;
|
return;
|
||||||
@ -1531,11 +1614,13 @@ class ActivityController{
|
|||||||
phpcommon\sendError(ERR_USER_BASE + 3, '奖励不可领');
|
phpcommon\sendError(ERR_USER_BASE + 3, '奖励不可领');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$ret = $conn->execScript('UPDATE user SET daily_order3=2 ' .
|
$ret = $conn->execScript(
|
||||||
|
'UPDATE user SET daily_order3=2 ' .
|
||||||
' WHERE accountid=:accountid;',
|
' WHERE accountid=:accountid;',
|
||||||
array(
|
array(
|
||||||
':accountid' => $account_id,
|
':accountid' => $account_id,
|
||||||
));
|
)
|
||||||
|
);
|
||||||
if (!$ret) {
|
if (!$ret) {
|
||||||
die();
|
die();
|
||||||
return;
|
return;
|
||||||
@ -1608,7 +1693,8 @@ class ActivityController{
|
|||||||
protected function insertDrawDB($account_id, $id)
|
protected function insertDrawDB($account_id, $id)
|
||||||
{
|
{
|
||||||
$conn = $this->getMysql($account_id);
|
$conn = $this->getMysql($account_id);
|
||||||
$ret = $conn->execScript('INSERT INTO draw(accountid, id, cd_time, createtime, modifytime) ' .
|
$ret = $conn->execScript(
|
||||||
|
'INSERT INTO draw(accountid, id, cd_time, createtime, modifytime) ' .
|
||||||
' VALUES(:account_id, :id, 0, :createtime, :modifytime) ' .
|
' VALUES(:account_id, :id, 0, :createtime, :modifytime) ' .
|
||||||
' ON DUPLICATE KEY UPDATE accountid=:account_id, id=:id, cd_time=0, modifytime=:modifytime;',
|
' ON DUPLICATE KEY UPDATE accountid=:account_id, id=:id, cd_time=0, modifytime=:modifytime;',
|
||||||
array(
|
array(
|
||||||
@ -1616,7 +1702,8 @@ class ActivityController{
|
|||||||
':id' => $id,
|
':id' => $id,
|
||||||
':createtime' => time(),
|
':createtime' => time(),
|
||||||
':modifytime' => time(),
|
':modifytime' => time(),
|
||||||
));
|
)
|
||||||
|
);
|
||||||
if (!$ret) {
|
if (!$ret) {
|
||||||
die();
|
die();
|
||||||
return;
|
return;
|
||||||
@ -1637,10 +1724,12 @@ class ActivityController{
|
|||||||
phpcommon\sendError(ERR_USER_BASE + 1, '没有这个玩家');
|
phpcommon\sendError(ERR_USER_BASE + 1, '没有这个玩家');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$rows = $conn->execQuery('SELECT id, cd_time FROM draw WHERE accountid=:accountid;',
|
$rows = $conn->execQuery(
|
||||||
|
'SELECT id, cd_time FROM draw WHERE accountid=:accountid;',
|
||||||
array(
|
array(
|
||||||
':accountid' => $account_id,
|
':accountid' => $account_id,
|
||||||
));
|
)
|
||||||
|
);
|
||||||
$info_list = array();
|
$info_list = array();
|
||||||
if (!$rows) {
|
if (!$rows) {
|
||||||
$draw_conf = metatable\getDrawConf();
|
$draw_conf = metatable\getDrawConf();
|
||||||
@ -1654,14 +1743,16 @@ class ActivityController{
|
|||||||
} else {
|
} else {
|
||||||
foreach ($rows as $row) {
|
foreach ($rows as $row) {
|
||||||
if ($row['cd_time'] <= time()) {
|
if ($row['cd_time'] <= time()) {
|
||||||
$ret = $conn->execScript('UPDATE draw SET cd_time=:cd_time, modifytime=:modifytime ' .
|
$ret = $conn->execScript(
|
||||||
|
'UPDATE draw SET cd_time=:cd_time, modifytime=:modifytime ' .
|
||||||
' WHERE accountid=:accountid AND id=:id;',
|
' WHERE accountid=:accountid AND id=:id;',
|
||||||
array(
|
array(
|
||||||
':accountid' => $account_id,
|
':accountid' => $account_id,
|
||||||
':cd_time' => 0,
|
':cd_time' => 0,
|
||||||
':id' => $row['id'],
|
':id' => $row['id'],
|
||||||
':modifytime' => time()
|
':modifytime' => time()
|
||||||
));
|
)
|
||||||
|
);
|
||||||
if (!$ret) {
|
if (!$ret) {
|
||||||
die();
|
die();
|
||||||
return;
|
return;
|
||||||
@ -1701,11 +1792,13 @@ class ActivityController{
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$id = $_REQUEST['id'];
|
$id = $_REQUEST['id'];
|
||||||
$row = $conn->execQueryOne('SELECT cd_time FROM draw WHERE accountid=:accountid AND id=:id;',
|
$row = $conn->execQueryOne(
|
||||||
|
'SELECT cd_time FROM draw WHERE accountid=:accountid AND id=:id;',
|
||||||
array(
|
array(
|
||||||
':accountid' => $account_id,
|
':accountid' => $account_id,
|
||||||
':id' => $id,
|
':id' => $id,
|
||||||
));
|
)
|
||||||
|
);
|
||||||
if (!$row) {
|
if (!$row) {
|
||||||
phpcommon\sendError(ERR_USER_BASE + 1, '没有这个玩家');
|
phpcommon\sendError(ERR_USER_BASE + 1, '没有这个玩家');
|
||||||
return;
|
return;
|
||||||
@ -1769,14 +1862,16 @@ class ActivityController{
|
|||||||
$extra_id = $dr['ten_drop'];
|
$extra_id = $dr['ten_drop'];
|
||||||
$extra_times = $dr['ten_count'];
|
$extra_times = $dr['ten_count'];
|
||||||
$cdtime = $dr['time_cd'];
|
$cdtime = $dr['time_cd'];
|
||||||
$ret = $conn->execScript('UPDATE draw SET cd_time=:cd_time, modifytime=:modifytime ' .
|
$ret = $conn->execScript(
|
||||||
|
'UPDATE draw SET cd_time=:cd_time, modifytime=:modifytime ' .
|
||||||
' WHERE accountid=:accountid AND id=:id;',
|
' WHERE accountid=:accountid AND id=:id;',
|
||||||
array(
|
array(
|
||||||
':accountid' => $account_id,
|
':accountid' => $account_id,
|
||||||
':cd_time' => time() + $cdtime,
|
':cd_time' => time() + $cdtime,
|
||||||
':id' => $id,
|
':id' => $id,
|
||||||
':modifytime' => time()
|
':modifytime' => time()
|
||||||
));
|
)
|
||||||
|
);
|
||||||
if (!$ret) {
|
if (!$ret) {
|
||||||
die();
|
die();
|
||||||
return;
|
return;
|
||||||
@ -1828,10 +1923,12 @@ class ActivityController{
|
|||||||
phpcommon\sendError(ERR_USER_BASE + 1, '没有这个玩家');
|
phpcommon\sendError(ERR_USER_BASE + 1, '没有这个玩家');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$rowuser = $conn->execQueryOne('SELECT diamond_num, coin_num FROM user WHERE accountid=:accountid;',
|
$rowuser = $conn->execQueryOne(
|
||||||
|
'SELECT diamond_num, coin_num FROM user WHERE accountid=:accountid;',
|
||||||
array(
|
array(
|
||||||
':accountid' => $account_id
|
':accountid' => $account_id
|
||||||
));
|
)
|
||||||
|
);
|
||||||
if (!$rowuser) {
|
if (!$rowuser) {
|
||||||
phpcommon\sendError(ERR_USER_BASE + 1, '没有这个玩家');
|
phpcommon\sendError(ERR_USER_BASE + 1, '没有这个玩家');
|
||||||
return;
|
return;
|
||||||
@ -1859,23 +1956,27 @@ class ActivityController{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$ret = $conn->execScript('UPDATE user SET coin_num=:coin_num, diamond_num=:diamond_num, modify_time=:modifytime ' .
|
$ret = $conn->execScript(
|
||||||
|
'UPDATE user SET coin_num=:coin_num, diamond_num=:diamond_num, modify_time=:modifytime ' .
|
||||||
' WHERE accountid=:accountid;',
|
' WHERE accountid=:accountid;',
|
||||||
array(
|
array(
|
||||||
':accountid' => $account_id,
|
':accountid' => $account_id,
|
||||||
':coin_num' => $coin_num,
|
':coin_num' => $coin_num,
|
||||||
':diamond_num' => $diamond_num,
|
':diamond_num' => $diamond_num,
|
||||||
':modifytime' => time()
|
':modifytime' => time()
|
||||||
));
|
)
|
||||||
|
);
|
||||||
if (!$ret) {
|
if (!$ret) {
|
||||||
die();
|
die();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$rows = $conn->execQuery('SELECT id, cd_time FROM draw WHERE accountid=:accountid;',
|
$rows = $conn->execQuery(
|
||||||
|
'SELECT id, cd_time FROM draw WHERE accountid=:accountid;',
|
||||||
array(
|
array(
|
||||||
':accountid' => $account_id,
|
':accountid' => $account_id,
|
||||||
));
|
)
|
||||||
|
);
|
||||||
if (!$rows) {
|
if (!$rows) {
|
||||||
phpcommon\sendError(ERR_USER_BASE + 1, '没有这个玩家');
|
phpcommon\sendError(ERR_USER_BASE + 1, '没有这个玩家');
|
||||||
return;
|
return;
|
||||||
@ -1889,14 +1990,16 @@ class ActivityController{
|
|||||||
if ($cd_time <= time()) {
|
if ($cd_time <= time()) {
|
||||||
$cd_time = 0;
|
$cd_time = 0;
|
||||||
}
|
}
|
||||||
$ret = $conn->execScript('UPDATE draw SET cd_time=:cd_time, modifytime=:modifytime ' .
|
$ret = $conn->execScript(
|
||||||
|
'UPDATE draw SET cd_time=:cd_time, modifytime=:modifytime ' .
|
||||||
' WHERE accountid=:accountid AND id=:id;',
|
' WHERE accountid=:accountid AND id=:id;',
|
||||||
array(
|
array(
|
||||||
':accountid' => $account_id,
|
':accountid' => $account_id,
|
||||||
':cd_time' => $cd_time,
|
':cd_time' => $cd_time,
|
||||||
':id' => $row['id'],
|
':id' => $row['id'],
|
||||||
':modifytime' => time()
|
':modifytime' => time()
|
||||||
));
|
)
|
||||||
|
);
|
||||||
if (!$ret) {
|
if (!$ret) {
|
||||||
die();
|
die();
|
||||||
return;
|
return;
|
||||||
@ -1924,10 +2027,12 @@ class ActivityController{
|
|||||||
phpcommon\sendError(ERR_USER_BASE + 1, '没有这个玩家');
|
phpcommon\sendError(ERR_USER_BASE + 1, '没有这个玩家');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$rowuser = $conn->execQueryOne('SELECT daily_diamond_times FROM user WHERE accountid=:accountid;',
|
$rowuser = $conn->execQueryOne(
|
||||||
|
'SELECT daily_diamond_times FROM user WHERE accountid=:accountid;',
|
||||||
array(
|
array(
|
||||||
':accountid' => $account_id
|
':accountid' => $account_id
|
||||||
));
|
)
|
||||||
|
);
|
||||||
if (!$rowuser) {
|
if (!$rowuser) {
|
||||||
phpcommon\sendError(ERR_USER_BASE + 1, '没有这个玩家');
|
phpcommon\sendError(ERR_USER_BASE + 1, '没有这个玩家');
|
||||||
return;
|
return;
|
||||||
@ -1941,13 +2046,15 @@ class ActivityController{
|
|||||||
}
|
}
|
||||||
$addreward->addReward(10003, $num, $account_id, 0, 0);
|
$addreward->addReward(10003, $num, $account_id, 0, 0);
|
||||||
$diamond_times = $rowuser['daily_diamond_times'] + 1;
|
$diamond_times = $rowuser['daily_diamond_times'] + 1;
|
||||||
$ret = $conn->execScript('UPDATE user SET daily_diamond_times=:daily_diamond_times, modify_time=:modify_time ' .
|
$ret = $conn->execScript(
|
||||||
|
'UPDATE user SET daily_diamond_times=:daily_diamond_times, modify_time=:modify_time ' .
|
||||||
' WHERE accountid=:accountid;',
|
' WHERE accountid=:accountid;',
|
||||||
array(
|
array(
|
||||||
':accountid' => $account_id,
|
':accountid' => $account_id,
|
||||||
':daily_diamond_times' => $diamond_times,
|
':daily_diamond_times' => $diamond_times,
|
||||||
':modify_time' => time()
|
':modify_time' => time()
|
||||||
));
|
)
|
||||||
|
);
|
||||||
if (!$ret) {
|
if (!$ret) {
|
||||||
die();
|
die();
|
||||||
return;
|
return;
|
||||||
@ -1971,4 +2078,3 @@ class ActivityController{
|
|||||||
));
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user