This commit is contained in:
wangwei01 2019-05-30 14:20:44 +08:00
parent 876c7718be
commit b408be64c8
4 changed files with 56 additions and 47 deletions

View File

@ -218,7 +218,6 @@ class ActivityController{
}
case 2: //活动皮肤兑换
{
var_dump(time());
$arr = $this->getExplode($act['exchange_item']);
$row = $conn->execQueryOne('SELECT * FROM skin WHERE accountid = :account_id AND skin_id = :skin_id;',
array(

View File

@ -121,7 +121,12 @@ class HangController{
return;
}
} else {
$num = time() - $row['hang_time'];
$p_num = $this->getParameter(GOLD);
$p_time_limit = $this->getParameter(TIME_LIMIT);
$num = time() - $row['hang_time'] / 5 * $p_num['param_value'];
if ($num >= $p_time_limit['param_value']) {
$num = $p_time_limit['param_value'] / 5 * $p_num['param_value'];
}
}
echo json_encode(array(

View File

@ -169,44 +169,47 @@ class RoleController{
array(
':accountid' => $account_id
));
if ($row) {
if ($kill_his < $row['kill_his']) {
$kill_his = $row['kill_his'];
}
if ($harm_his < $row['harm_his']) {
$harm_his = $row['harm_his'];
}
if ($rank == 1) {
$row['win_times']++;
}
if ($alive_time_his < $row['alive_time_his']) {
$alive_time_his = $row['alive_time_his'];
}
if ($add_HP_his < $row['add_HP_his']) {
$add_HP_his = $row['add_HP_his'];
}
$ret = $conn->execScript('UPDATE user SET game_times=:game_times, win_times=:win_times, kills=:kills, harm=:harm, add_HP=:add_HP, alive_time=:alive_time, kill_his=:kill_his, alive_time_his=:alive_time_his, harm_his=:harm_his, add_HP_his=:add_HP_his, coin_num=:coin_num, integral=:integral ' .
' WHERE accountid=:accountid;',
array(
':game_times' => $row['game_times'] + 1,
':win_times' => $row['win_times'],
':kill_his' => $kill_his,
':kills' => $row['kills'] + $kills,
':harm_his' => $harm_his,
':harm' => $row['harm'] + $harm,
':add_HP' => $row['add_HP'] + $add_HP,
':alive_time' => $row['alive_time'] + $alive_time,
':alive_time_his' => $alive_time_his,
':add_HP_his' => $add_HP_his,
':accountid' => $account_id,
':coin_num' => $row['coin_num'] + $coin_num,
':integral' => $row['integral'] + $integral
));
if (!$ret) {
die();
return;
}
if (!$row) {
phpcommon\sendError(ERR_USER_BASE + 1, '没有这个玩家');
return;
}
if ($kill_his < $row['kill_his']) {
$kill_his = $row['kill_his'];
}
if ($harm_his < $row['harm_his']) {
$harm_his = $row['harm_his'];
}
if ($rank == 1) {
$row['win_times']++;
}
if ($alive_time_his < $row['alive_time_his']) {
$alive_time_his = $row['alive_time_his'];
}
if ($add_HP_his < $row['add_HP_his']) {
$add_HP_his = $row['add_HP_his'];
}
$ret = $conn->execScript('UPDATE user SET game_times=:game_times, win_times=:win_times, kills=:kills, harm=:harm, add_HP=:add_HP, alive_time=:alive_time, kill_his=:kill_his, alive_time_his=:alive_time_his, harm_his=:harm_his, add_HP_his=:add_HP_his, coin_num=:coin_num, integral=:integral ' .
' WHERE accountid=:accountid;',
array(
':game_times' => $row['game_times'] + 1,
':win_times' => $row['win_times'],
':kill_his' => $kill_his,
':kills' => $row['kills'] + $kills,
':harm_his' => $harm_his,
':harm' => $row['harm'] + $harm,
':add_HP' => $row['add_HP'] + $add_HP,
':alive_time' => $row['alive_time'] + $alive_time,
':alive_time_his' => $alive_time_his,
':add_HP_his' => $add_HP_his,
':accountid' => $account_id,
':coin_num' => $row['coin_num'] + $coin_num,
':integral' => $row['integral'] + $integral
));
if (!$ret) {
die();
return;
}
//插入历史记录
$ret = $conn->execScript('INSERT INTO history_record(accountid, room_uuid, map_name, game_time, rank, kills, harms, hurts, alive_time, coin, status) ' .
' VALUES(:accountid, :room_uuid, :map_name, :game_time, :rank, :kills, :harms, :hurts, :alive_time, :coin, 0);',

View File

@ -152,19 +152,21 @@ class SupplyBoxController{
':accountid' => $account_id,
':box_id' => $box_id
));
if (!$row && $free_open == 0) {
phpcommon\sendError(ERR_USER_BASE + 2, '没有这个宝箱');
return;
} else if (!$row && $free_open == 1) {
$ret = $conn->execScript('INSERT INTO supplybox(accountid, box_id, box_num, buy_times, last_buy_time) ' .
if (!$row) {
if ($free_open == 0) {
phpcommon\sendError(ERR_USER_BASE + 2, '没有这个宝箱');
return;
} else if ($free_open == 1) {
$ret = $conn->execScript('INSERT INTO supplybox(accountid, box_id, box_num, buy_times, last_buy_time) ' .
' VALUES(:accountid, :box_id, 0, 0, 0);',
array(
':accountid' => $account_id,
':box_id' => $box_id,
));
if (!$ret) {
die();
return;
if (!$ret) {
die();
return;
}
}
}
if ($free_open == 0) {