This commit is contained in:
aozhiwei 2019-12-13 15:33:14 +08:00
parent caba15a154
commit 07fcd70d29
4 changed files with 22 additions and 3 deletions

View File

@ -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;

View File

@ -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,

View File

@ -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'],
));
}
}

View File

@ -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;
}
}
}
}
?>