1
This commit is contained in:
parent
5904f412d9
commit
c2ab5f176a
9
sql/gamedb2004_n_migrate_200911_01.sql
Normal file
9
sql/gamedb2004_n_migrate_200911_01.sql
Normal file
@ -0,0 +1,9 @@
|
||||
begin;
|
||||
|
||||
update activity set now_days=1 where 1=1;
|
||||
UPDATE user set box_num=1 WHERE 1=1;
|
||||
UPDATE activity SET modify_time=1599703200 WHERE modify_time>=1599753600;
|
||||
|
||||
insert into version (version) values(2020091101);
|
||||
|
||||
commit;
|
@ -174,7 +174,7 @@ class ActivityController{
|
||||
phpcommon\sendError(ERR_USER_BASE + 1, '没有这个玩家');
|
||||
return;
|
||||
}
|
||||
$draw_uuid = 'game2004api_newlot_uuid:' . md5($_REQUEST['account_id']);
|
||||
$draw_uuid = 'game2004api_newlot_uuid:' . $_REQUEST['account_id'];
|
||||
$draw_list = array();
|
||||
$r = $this->getRedis($draw_uuid);
|
||||
if (!$r) {
|
||||
@ -331,7 +331,7 @@ class ActivityController{
|
||||
$day = 1;
|
||||
if (phpcommon\extractChannel($account_id) == 6001 ||
|
||||
phpcommon\extractChannel($account_id) == 6000 ||
|
||||
phpcommon\extractChaanel($account_id) == 6006) {
|
||||
phpcommon\extractChannel($account_id) == 6006) {
|
||||
$day = $row['now_days'];
|
||||
}
|
||||
$g_conf_lot_cluster = require('../res/lottery@lottery.php');
|
||||
@ -505,7 +505,7 @@ class ActivityController{
|
||||
return;
|
||||
}
|
||||
|
||||
$drawtable_uuid = 'game2004api_drawtable_uuid:' . md5($_REQUEST['account_id']);
|
||||
$drawtable_uuid = 'game2004api_drawtable_uuid:' . $_REQUEST['account_id'];
|
||||
$drawtable_list = array();
|
||||
$r = $this->getRedis($drawtable_uuid);
|
||||
if (!$r) {
|
||||
@ -514,7 +514,6 @@ class ActivityController{
|
||||
}
|
||||
|
||||
//道具物品
|
||||
//$user_db_str = $r->get($drawtable_uuid);
|
||||
$drawtable_list = $this->randomReward(2,$account_id);
|
||||
$drawtable_db = array(
|
||||
'drawtable_uuid' => $drawtable_uuid,
|
||||
@ -983,10 +982,12 @@ class ActivityController{
|
||||
$addreward = new classes\AddReward();
|
||||
$addreward->addReward($row['item_id'], $row['item_num'] * $times, $account_id,0,0);
|
||||
$coin_num = $addreward->getCoinNum($account_id);
|
||||
$diamond_num = $addreward->getDiamondNum($account_id);
|
||||
echo json_encode(array(
|
||||
'errcode' => 0,
|
||||
'errmsg'=> '',
|
||||
'coin_nums' => $coin_num,
|
||||
'diamond_nums' => $diamond_num,
|
||||
));
|
||||
}
|
||||
protected function randomNewReward($type,$accountid,$days)
|
||||
|
@ -587,7 +587,8 @@ class EquipController{
|
||||
}
|
||||
$active_time = $row['active_time'];
|
||||
if ($active_time + $sub_time <= time() ||
|
||||
$active_time + $row['sub_time'] <= time() + 30) {
|
||||
$active_time + $row['sub_time'] <= time() + 30 ||
|
||||
$type == 0) {
|
||||
$active_time = 0;
|
||||
$sub_time = 0;
|
||||
$flag = 1;
|
||||
|
@ -165,7 +165,8 @@ class GameOverController{
|
||||
//道具物品
|
||||
$first_list = array();
|
||||
if (phpcommon\extractChannel($account_id) == 6001 ||
|
||||
phpcommon\extractChannel($account_id) == 6000) {
|
||||
phpcommon\extractChannel($account_id) == 6006 ||
|
||||
phpcommon\extractChannel($account_id) == 6000) {
|
||||
array_push($first_list, array(
|
||||
'item_id' => 18006,
|
||||
'item_num' => $num,
|
||||
@ -375,4 +376,68 @@ class GameOverController{
|
||||
}
|
||||
return $flag;
|
||||
}
|
||||
|
||||
public function airDropBoxReward()
|
||||
{
|
||||
$account_id = $_REQUEST['account_id'];
|
||||
//登录校验
|
||||
$login = loginVerify($account_id, $_REQUEST['session_id']);
|
||||
if (!$login) {
|
||||
phpcommon\sendError(ERR_USER_BASE + 1, 'session无效');
|
||||
return;
|
||||
}
|
||||
$conn = $this->getMysql($account_id);
|
||||
if (!$conn) {
|
||||
phpcommon\sendError(ERR_USER_BASE + 2, '没有这个玩家');
|
||||
return;
|
||||
}
|
||||
$box_num = 0;
|
||||
$row = $conn->execQueryOne('SELECT box_num FROM user WHERE accountid=:accountid;',
|
||||
array(
|
||||
':accountid' => $account_id
|
||||
));
|
||||
if (!$row) {
|
||||
phpcommon\sendError(ERR_USER_BASE + 2, '没有这个玩家');
|
||||
return;
|
||||
}
|
||||
if ($row['box_num'] >= 1) {
|
||||
phpcommon\sendError(ERR_USER_BASE + 3, '今日开箱子次数已用完');
|
||||
return;
|
||||
}
|
||||
|
||||
$ret = $conn->execScript('UPDATE user SET box_num=1 WHERE accountid=:accountid;',
|
||||
array(
|
||||
':accountid' => $account_id,
|
||||
));
|
||||
if (!$ret) {
|
||||
die();
|
||||
return;
|
||||
}
|
||||
$box_num = 1;
|
||||
$item_list = array();
|
||||
$item_list = $this->fixReward($item_list, 10);
|
||||
$all_item_list = array();
|
||||
$addreward = new classes\AddReward();
|
||||
foreach ($item_list as $item) {
|
||||
$items = $addreward->addReward($item['item_id'], $item['item_num'], $account_id, $item['time'], 0);
|
||||
foreach($items as $i) {
|
||||
array_push($all_item_list, array(
|
||||
'item_id' => $i['item_id'],
|
||||
'item_num' => $i['item_num'],
|
||||
'time' => $i['time'],
|
||||
));
|
||||
}
|
||||
}
|
||||
$coin_num = $addreward->getCoinNum($account_id);
|
||||
$num = $addreward->getDiamondNum($account_id);
|
||||
echo json_encode(array(
|
||||
'errcode' => 0,
|
||||
'errmsg' => '',
|
||||
'coin_nums' => $coin_num,
|
||||
'item_list' => $item_list,
|
||||
'diamond_nums' => $num,
|
||||
'all_item_list' => $all_item_list,
|
||||
'box_num' => $box_num,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
@ -314,7 +314,7 @@ class RoleController{
|
||||
}
|
||||
if ($row['update_time'] == 0 || ($nowTime - phpcommon\getdayseconds($row['update_time']) > 0)) {
|
||||
$ret = $conn->execScript('UPDATE user SET daily_first_login=0, kefu_status=0, coin_times=0, ' .
|
||||
'modify_time=:modify_time, first_day_ad=0, share_video_times=0 WHERE accountid=:accountid;',
|
||||
'modify_time=:modify_time, first_day_ad=0, share_video_times=0, box_num=0 WHERE accountid=:accountid;',
|
||||
array(
|
||||
':accountid' => $account_id,
|
||||
':modify_time' => time(),
|
||||
@ -884,11 +884,7 @@ class RoleController{
|
||||
if ($add_HP_his < $row['add_HP_his']) {
|
||||
$add_HP_his = $row['add_HP_his'];
|
||||
}
|
||||
//添加空投箱
|
||||
$box_num = $row['box_num'];
|
||||
if ($row['box_num'] + 1 <= 20) {
|
||||
$box_num = $row['box_num'] + 1;
|
||||
}
|
||||
|
||||
$nowTime = phpcommon\getdayseconds(time());
|
||||
$daily_time = $row['daily_time'];
|
||||
if ($daily_time == 0 || ($nowTime - phpcommon\getdayseconds($daily_time) > 0)) {
|
||||
@ -921,7 +917,7 @@ class RoleController{
|
||||
$game_times2++;
|
||||
}
|
||||
|
||||
$ret = $conn->execScript('UPDATE user SET game_times=:game_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, modify_time=:modify_time, first_fight=1, box_num=:box_num, score=:score, daily_time=:daily_time, season_games=:season_games, sea_max_kill=:sea_max_kill, sea_max_hart=:sea_max_hart, sea_avg_kill=:sea_avg_kill, newhand=:newhand, newhand2=:newhand2, game_times2=:game_times2 ' .
|
||||
$ret = $conn->execScript('UPDATE user SET game_times=:game_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, modify_time=:modify_time, first_fight=1, score=:score, daily_time=:daily_time, season_games=:season_games, sea_max_kill=:sea_max_kill, sea_max_hart=:sea_max_hart, sea_avg_kill=:sea_avg_kill, newhand=:newhand, newhand2=:newhand2, game_times2=:game_times2 ' .
|
||||
'WHERE accountid=:accountid;',
|
||||
array(
|
||||
':game_times' => $row['game_times'] + 1,
|
||||
@ -936,7 +932,6 @@ class RoleController{
|
||||
':accountid' => $account_id,
|
||||
':coin_num' => $row['coin_num'] + $coin_num,
|
||||
':modify_time' => time(),
|
||||
':box_num' => $box_num,
|
||||
':score' => $row['score'] + $score,
|
||||
':daily_time' => $daily_time,
|
||||
':season_games' => $row['season_games'] + 1,
|
||||
@ -1442,11 +1437,10 @@ class RoleController{
|
||||
return;
|
||||
}
|
||||
|
||||
$id = 12141;
|
||||
$id = 12151;
|
||||
if (isset($_REQUEST['id'])) {
|
||||
$id = $_REQUEST['id'];
|
||||
}
|
||||
|
||||
$rowEquip = $conn->execQueryOne('SELECT id, lv FROM equip WHERE accountid=:accountid AND id=:id;',
|
||||
array(
|
||||
':accountid' => $account_id,
|
||||
|
@ -401,10 +401,12 @@ class ShareController{
|
||||
$r->del($boxreward_uuid, json_encode($user_db));
|
||||
$addreward = new classes\AddReward();
|
||||
$coin_num = $addreward->getCoinNum($account_id);
|
||||
$diamond_num = $addreward->getDiamondNum($account_id);
|
||||
echo json_encode(array(
|
||||
'errcode' => 0,
|
||||
'errmsg' => '',
|
||||
'coin_nums' => $coin_num,
|
||||
'diamond_nums' => $diamond_num,
|
||||
));
|
||||
}
|
||||
|
||||
|
@ -268,7 +268,8 @@ class SignController{
|
||||
'errmsg' => '',
|
||||
'sign_days' => $rowUser['sign_sum'],
|
||||
'sign_list' => $sign_list,
|
||||
'item_list' => $item_list
|
||||
'item_list' => $item_list,
|
||||
'week' => $week,
|
||||
));
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user