From 07fcd70d29604084e45aa3433b14aec59348b265 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Fri, 13 Dec 2019 15:33:14 +0800 Subject: [PATCH] 1 --- sql/gamedb.sql | 1 + webapp/controller/RankController.class.php | 2 +- webapp/controller/RoleController.class.php | 7 +++++-- webapp/controller/TankController.class.php | 15 +++++++++++++++ 4 files changed, 22 insertions(+), 3 deletions(-) diff --git a/sql/gamedb.sql b/sql/gamedb.sql index d669279..429452b 100644 --- a/sql/gamedb.sql +++ b/sql/gamedb.sql @@ -62,6 +62,7 @@ CREATE TABLE `user` ( `new_info` mediumblob NOT NULL COMMENT '新手信息', `daily_buy_times` int(11) NOT NULL DEFAULT '0' COMMENT '每日购买次数', `daily_time` int(11) NOT NULL DEFAULT '0' COMMENT '每日刷新时间', + `pass_reward` mediumblob NOT NULL COMMENT '通关奖励信息', PRIMARY KEY (`idx`), UNIQUE KEY `accountid` (`accountid`) ) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COLLATE=utf8_bin; diff --git a/webapp/controller/RankController.class.php b/webapp/controller/RankController.class.php index 266822f..907c624 100644 --- a/webapp/controller/RankController.class.php +++ b/webapp/controller/RankController.class.php @@ -117,7 +117,7 @@ class RankController{ echo json_encode(array( 'errcode' => 0, 'errmsg' => "", - //'user_list' => $user_list, + 'user_list' => $user_list, 'pass_rank' => $pass_rank, 'pass_list' => $pass_list, 'coin_rank' => $coin_rank, diff --git a/webapp/controller/RoleController.class.php b/webapp/controller/RoleController.class.php index 115a07f..413e69f 100644 --- a/webapp/controller/RoleController.class.php +++ b/webapp/controller/RoleController.class.php @@ -40,8 +40,8 @@ class RoleController{ ':accountid' => $account_id )); if (!$row) { - $ret = $conn->execScript('INSERT INTO user(accountid, user_name, avatar_url, coin_num, create_time, modify_time, collect_status, kefu_status, sign_sum, diamond_num, pass_status, pass, energy, buy_data, tank_data, cumul_coin, off_time, battlecount, invite_status, life_times, new_info, daily_buy_times, daily_time) ' . - ' VALUES(:accountid, :user_name, :avatar_url, 100, :create_time, :modify_time, 0, 0, 0, 0, 0, 0, 0, :buy_data, :tank_data, 0, :off_time, 0, 0, 0, :new_info, 0, 0)', + $ret = $conn->execScript('INSERT INTO user(accountid, user_name, avatar_url, coin_num, create_time, modify_time, collect_status, kefu_status, sign_sum, diamond_num, pass_status, pass, energy, buy_data, tank_data, cumul_coin, off_time, battlecount, invite_status, life_times, new_info, daily_buy_times, daily_time, pass_reward) ' . + ' VALUES(:accountid, :user_name, :avatar_url, 100, :create_time, :modify_time, 0, 0, 0, 0, 0, 0, 0, :buy_data, :tank_data, 0, :off_time, 0, 0, 0, :new_info, 0, 0, :pass_reward)', array( ':accountid' => $account_id, ':user_name' => $user_name, @@ -52,6 +52,7 @@ class RoleController{ ':modify_time' => time(), ':off_time' => time(), ':new_info' => '', + ':pass_reward' => '', )); if (!$ret) { die(); @@ -75,6 +76,7 @@ class RoleController{ 'life_times' => 0, 'new_info' => '', 'daily_buy_times' => 0, + 'pass_reward' => '', )); } else { if ($user_name != $row['user_name']) { @@ -125,6 +127,7 @@ class RoleController{ 'life_times' => $life_times, 'new_info' => $row['new_info'], 'daily_buy_times' => $daily_buy_times, + 'pass_reward' => $row['pass_reward'], )); } } diff --git a/webapp/controller/TankController.class.php b/webapp/controller/TankController.class.php index 9feabe7..3482ea6 100644 --- a/webapp/controller/TankController.class.php +++ b/webapp/controller/TankController.class.php @@ -242,6 +242,21 @@ class TankController{ 'errcode' => 0, 'errmsg' => '', )); + + if (isset($tankInfo['pass_reward'])) { + $pass_reward = $tankInfo['pass_reward']; + $ret = $conn->execScript('UPDATE user SET pass_reward=:pass_reward, modify_time=:modify_time ' . + ' WHERE accountid=:account_id;', + array( + ':account_id' => $account_id, + ':pass_reward' => json_encode($pass_reward), + ':modify_time' => time() + )); + if (!$ret) { + die(); + return; + } + } } } ?>