diff --git a/doc/Gun.py b/doc/Gun.py index 2bdad0d..80f7908 100644 --- a/doc/Gun.py +++ b/doc/Gun.py @@ -39,7 +39,6 @@ class Gun(object): 'url': 'webapp/index.php?c=Gun&a=upgradeTalentLv', 'params': [ _common.ReqHead(), - ['type_id', 0, '枪支类型'], ['talent_id', 0, '天赋id'], ], 'response': [ diff --git a/doc/_common.py b/doc/_common.py index 33872bc..74f810f 100644 --- a/doc/_common.py +++ b/doc/_common.py @@ -29,7 +29,6 @@ class GunTalent(object): def __init__(self): self.fields = [ - ['type_id', 0, '枪支类型'], ['talent_id', 0, '天赋'], ['talent_lv', 0, '天赋等级'], ] diff --git a/sql/gamedb.sql b/sql/gamedb.sql index 6c7acdc..b4a16c9 100644 --- a/sql/gamedb.sql +++ b/sql/gamedb.sql @@ -145,13 +145,12 @@ DROP TABLE IF EXISTS `t_gun_talent`; CREATE TABLE `t_gun_talent` ( `idx` bigint NOT NULL AUTO_INCREMENT COMMENT '自增id', `account_id` varchar(60) CHARACTER SET utf8 NOT NULL COMMENT 'account_id', - `type_id` int(11) NOT NULL DEFAULT '0' COMMENT '枪类型的id', `talent_id` int(11) NOT NULL DEFAULT '0' COMMENT '技能ID', `talent_lv` int(11) NOT NULL DEFAULT '0' COMMENT '技能等级', `createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间', `modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间', PRIMARY KEY (`idx`), - UNIQUE KEY `account_id_type_id_talent_id` (`account_id`, `type_id`,`talent_id`) + UNIQUE KEY `account_id_talent_id` (`account_id`, `talent_id`) ) ENGINE=InnoDB AUTO_INCREMENT=10000 DEFAULT CHARSET=utf8 COLLATE=utf8_bin; /*!40101 SET character_set_client = @saved_cs_client */; diff --git a/webapp/controller/GunController.class.php b/webapp/controller/GunController.class.php index dd99fea..6d0e503 100644 --- a/webapp/controller/GunController.class.php +++ b/webapp/controller/GunController.class.php @@ -54,10 +54,9 @@ class GunController extends BaseAuthedController { public function upgradeTalentLv() { - $typeId = getReqVal('type_id', 0); $talentId = getReqVal('talent_id', 0); - $talentMeta = mt\GunTalent::get($typeId); + /*$talentMeta = mt\GunTalent::get($talentId); if (!$talentMeta) { $this->_rspErr(1, 'type_id参数错误'); return; @@ -65,8 +64,8 @@ class GunController extends BaseAuthedController { if (!mt\GunTalent::isValidTalent($talentMeta, $talentId)) { $this->_rspErr(1, 'talent_id参数错误'); return; - } - $talentDb = GunTalent::find($typeId, $talentId); + }*/ + $talentDb = GunTalent::find($talentId); $currLv = isset($talentDb) ? $talentDb['talent_lv'] : 0; $growMeta = mt\GunTalentGrow::getByIdLv($talentId, $currLv + 1); if (!$growMeta) { @@ -85,7 +84,7 @@ class GunController extends BaseAuthedController { return; } $this->_decItems($costList); - GunTalent::upgradeLv($typeId, $talentId, $currLv + 1); + GunTalent::upgradeLv($talentId, $currLv + 1); $propertyChgService = new services\PropertyChgService(); $propertyChgService->addUserChg(); $this->_rspData(array( diff --git a/webapp/controller/MissionController.class.php b/webapp/controller/MissionController.class.php index c7f5099..9792740 100644 --- a/webapp/controller/MissionController.class.php +++ b/webapp/controller/MissionController.class.php @@ -49,8 +49,12 @@ class MissionController extends BaseAuthedController { private function getMissionDto($missionDb, $missionMeta) { $missionDto = array( - + 'mission_id' => $missionMeta['id'], + 'current' => 0, + 'target' => 0, + 'state' => 0, ); + return $missionDto; } } diff --git a/webapp/controller/UserController.class.php b/webapp/controller/UserController.class.php index 0bc8ee3..889fe52 100644 --- a/webapp/controller/UserController.class.php +++ b/webapp/controller/UserController.class.php @@ -59,19 +59,15 @@ class UserController extends BaseAuthedController { array( 'account_id' => $this->_getAccountId(), 'name' => $userName, + 'sex' => 2, #'avatar_url' => $avatar_url, 'gold' => 10000 * 10000, 'diamond' => 10000 * 10000, - #'season_status' => 1, - #'newInfo' => '', - #'new_second_equip' => 2, 'head_frame' => 19003, - 'sex' => 2, + 'level' => 100, + 'exp' => 0, 'head_id' => 18001, 'hero_id' => 30100, - #'integral' => 0, - #'season_time' => mt\Season::getCurrSeasonTime(), - #'team_name' => '', 'createtime' => $this->_getNowTime(), 'modifytime' => $this->_getNowTime(), ) diff --git a/webapp/models/GunTalent.php b/webapp/models/GunTalent.php index 46e5aba..d1860cb 100644 --- a/webapp/models/GunTalent.php +++ b/webapp/models/GunTalent.php @@ -7,14 +7,13 @@ use phpcommon\SqlHelper; class GunTalent extends BaseModel { - public static function find($typeId, $talentId) + public static function find($talentId) { $row = SqlHelper::ormSelectOne( myself()->_getSelfMysql(), 't_gun_talent', array( 'account_id' => myself()->_getAccountId(), - 'type_id' => $typeId, 'talent_id' => $talentId ) ); @@ -24,20 +23,18 @@ class GunTalent extends BaseModel { public static function toDto($row) { return array( - 'type_id' => $row['type_id'], 'talent_id' => $row['talent_id'], 'talent_lv' => $row['talent_lv'], ); } - public static function upgradeLv($typeId, $talentId, $talentLv) + public static function upgradeLv($talentId, $talentLv) { SqlHelper::upsert( myself()->_getSelfMysql(), 't_gun_talent', array( 'account_id' => myself()->_getAccountId(), - 'type_id' => $typeId, 'talent_id' => $talentId ), array( @@ -46,7 +43,6 @@ class GunTalent extends BaseModel { ), array( 'account_id' => myself()->_getAccountId(), - 'type_id' => $typeId, 'talent_id' => $talentId, 'talent_lv' => $talentLv, 'createtime' => myself()->_getNowTime(),