diff --git a/sql/gamedb.sql b/sql/gamedb.sql index dabe4ae..07f7643 100644 --- a/sql/gamedb.sql +++ b/sql/gamedb.sql @@ -44,6 +44,9 @@ CREATE TABLE `t_user` ( `last_season_id` int(11) NOT NULL DEFAULT '0' COMMENT '最后一次赛季id', `activated` int(11) NOT NULL DEFAULT '0' COMMENT '是否已激活', `activatetime` int(11) NOT NULL DEFAULT '0' COMMENT '激活时间', + `head_list` mediumblob COMMENT '拥有的头像列表', + `head_frame_list` mediumblob COMMENT '拥有的头像框列表', + `total_battle_times` int(11) NOT NULL DEFAULT '0' COMMENT '总战斗次数', `total_single_battle_times` int(11) NOT NULL DEFAULT '0' COMMENT '总战斗次数(单人)', `total_team_battle_times` int(11) NOT NULL DEFAULT '0' COMMENT '总战斗次数(组队)', diff --git a/webapp/controller/UserController.class.php b/webapp/controller/UserController.class.php index 6db0495..ee2d5b0 100644 --- a/webapp/controller/UserController.class.php +++ b/webapp/controller/UserController.class.php @@ -71,6 +71,8 @@ class UserController extends BaseAuthedController { 'head_id' => 18001, 'hero_id' => 30100, 'last_season_id' => $currSeasonMeta ? $currSeasonMeta['id'] : 0, + 'head_list' => json_encode(array(18001)), + 'head_frame_list' => json_encode(array(19003)), 'createtime' => $this->_getNowTime(), 'modifytime' => $this->_getNowTime(), ) diff --git a/webapp/models/User.php b/webapp/models/User.php index 43562da..3fa1275 100644 --- a/webapp/models/User.php +++ b/webapp/models/User.php @@ -7,6 +7,7 @@ class User extends BaseModel { public static function show($row) { return array( + 'activated' => $row['activated'], 'account_id' => $row['account_id'], 'name' => $row['name'], 'sex' => $row['sex'], @@ -20,13 +21,15 @@ class User extends BaseModel { 'diamond' => $row['diamond'], 'hero_id' => $row['hero_id'], 'first_fight' => $row['first_fight'], - 'activated' => $row['activated'], + 'head_list' => !empty($row['head_list']) ? json_decode($row['head_list'], true) : array(), + 'head_frame_list' => !empty($row['head_frame_list']) ? json_decode($row['head_frame_list'], true) : array(), ); } public static function info($row) { return array( + 'activated' => $row['activated'], 'account_id' => $row['account_id'], 'name' => $row['name'], 'sex' => $row['sex'], @@ -40,7 +43,8 @@ class User extends BaseModel { 'diamond' => $row['diamond'], 'hero_id' => $row['hero_id'], 'first_fight' => $row['first_fight'], - 'activated' => $row['activated'], + 'head_list' => !empty($row['head_list']) ? json_decode($row['head_list'], true) : array(), + 'head_frame_list' => !empty($row['head_frame_list']) ? json_decode($row['head_frame_list'], true) : array(), ); }