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: //活动皮肤兑换 case 2: //活动皮肤兑换
{ {
var_dump(time());
$arr = $this->getExplode($act['exchange_item']); $arr = $this->getExplode($act['exchange_item']);
$row = $conn->execQueryOne('SELECT * FROM skin WHERE accountid = :account_id AND skin_id = :skin_id;', $row = $conn->execQueryOne('SELECT * FROM skin WHERE accountid = :account_id AND skin_id = :skin_id;',
array( array(

View File

@ -121,7 +121,12 @@ class HangController{
return; return;
} }
} else { } 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( echo json_encode(array(

View File

@ -169,7 +169,10 @@ class RoleController{
array( array(
':accountid' => $account_id ':accountid' => $account_id
)); ));
if ($row) { if (!$row) {
phpcommon\sendError(ERR_USER_BASE + 1, '没有这个玩家');
return;
}
if ($kill_his < $row['kill_his']) { if ($kill_his < $row['kill_his']) {
$kill_his = $row['kill_his']; $kill_his = $row['kill_his'];
} }
@ -206,7 +209,7 @@ class RoleController{
die(); die();
return; return;
} }
}
//插入历史记录 //插入历史记录
$ret = $conn->execScript('INSERT INTO history_record(accountid, room_uuid, map_name, game_time, rank, kills, harms, hurts, alive_time, coin, status) ' . $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);', ' VALUES(:accountid, :room_uuid, :map_name, :game_time, :rank, :kills, :harms, :hurts, :alive_time, :coin, 0);',

View File

@ -152,10 +152,11 @@ class SupplyBoxController{
':accountid' => $account_id, ':accountid' => $account_id,
':box_id' => $box_id ':box_id' => $box_id
)); ));
if (!$row && $free_open == 0) { if (!$row) {
if ($free_open == 0) {
phpcommon\sendError(ERR_USER_BASE + 2, '没有这个宝箱'); phpcommon\sendError(ERR_USER_BASE + 2, '没有这个宝箱');
return; return;
} else if (!$row && $free_open == 1) { } else if ($free_open == 1) {
$ret = $conn->execScript('INSERT INTO supplybox(accountid, box_id, box_num, buy_times, last_buy_time) ' . $ret = $conn->execScript('INSERT INTO supplybox(accountid, box_id, box_num, buy_times, last_buy_time) ' .
' VALUES(:accountid, :box_id, 0, 0, 0);', ' VALUES(:accountid, :box_id, 0, 0, 0);',
array( array(
@ -167,6 +168,7 @@ class SupplyBoxController{
return; return;
} }
} }
}
if ($free_open == 0) { if ($free_open == 0) {
if ($row['box_num'] <= 0) { if ($row['box_num'] <= 0) {
phpcommon\sendError(ERR_USER_BASE + 3, '宝箱数量不足'); phpcommon\sendError(ERR_USER_BASE + 3, '宝箱数量不足');