1
This commit is contained in:
parent
b24d06e00e
commit
0548f58b7c
@ -39,7 +39,6 @@ class Gun(object):
|
|||||||
'url': 'webapp/index.php?c=Gun&a=upgradeTalentLv',
|
'url': 'webapp/index.php?c=Gun&a=upgradeTalentLv',
|
||||||
'params': [
|
'params': [
|
||||||
_common.ReqHead(),
|
_common.ReqHead(),
|
||||||
['type_id', 0, '枪支类型'],
|
|
||||||
['talent_id', 0, '天赋id'],
|
['talent_id', 0, '天赋id'],
|
||||||
],
|
],
|
||||||
'response': [
|
'response': [
|
||||||
|
@ -29,7 +29,6 @@ class GunTalent(object):
|
|||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.fields = [
|
self.fields = [
|
||||||
['type_id', 0, '枪支类型'],
|
|
||||||
['talent_id', 0, '天赋'],
|
['talent_id', 0, '天赋'],
|
||||||
['talent_lv', 0, '天赋等级'],
|
['talent_lv', 0, '天赋等级'],
|
||||||
]
|
]
|
||||||
|
@ -145,13 +145,12 @@ DROP TABLE IF EXISTS `t_gun_talent`;
|
|||||||
CREATE TABLE `t_gun_talent` (
|
CREATE TABLE `t_gun_talent` (
|
||||||
`idx` bigint NOT NULL AUTO_INCREMENT COMMENT '自增id',
|
`idx` bigint NOT NULL AUTO_INCREMENT COMMENT '自增id',
|
||||||
`account_id` varchar(60) CHARACTER SET utf8 NOT NULL COMMENT 'account_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_id` int(11) NOT NULL DEFAULT '0' COMMENT '技能ID',
|
||||||
`talent_lv` int(11) NOT NULL DEFAULT '0' COMMENT '技能等级',
|
`talent_lv` int(11) NOT NULL DEFAULT '0' COMMENT '技能等级',
|
||||||
`createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
|
`createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
|
||||||
`modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
|
`modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
|
||||||
PRIMARY KEY (`idx`),
|
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;
|
) ENGINE=InnoDB AUTO_INCREMENT=10000 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
|
||||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||||
|
|
||||||
|
@ -54,10 +54,9 @@ class GunController extends BaseAuthedController {
|
|||||||
|
|
||||||
public function upgradeTalentLv()
|
public function upgradeTalentLv()
|
||||||
{
|
{
|
||||||
$typeId = getReqVal('type_id', 0);
|
|
||||||
$talentId = getReqVal('talent_id', 0);
|
$talentId = getReqVal('talent_id', 0);
|
||||||
|
|
||||||
$talentMeta = mt\GunTalent::get($typeId);
|
/*$talentMeta = mt\GunTalent::get($talentId);
|
||||||
if (!$talentMeta) {
|
if (!$talentMeta) {
|
||||||
$this->_rspErr(1, 'type_id参数错误');
|
$this->_rspErr(1, 'type_id参数错误');
|
||||||
return;
|
return;
|
||||||
@ -65,8 +64,8 @@ class GunController extends BaseAuthedController {
|
|||||||
if (!mt\GunTalent::isValidTalent($talentMeta, $talentId)) {
|
if (!mt\GunTalent::isValidTalent($talentMeta, $talentId)) {
|
||||||
$this->_rspErr(1, 'talent_id参数错误');
|
$this->_rspErr(1, 'talent_id参数错误');
|
||||||
return;
|
return;
|
||||||
}
|
}*/
|
||||||
$talentDb = GunTalent::find($typeId, $talentId);
|
$talentDb = GunTalent::find($talentId);
|
||||||
$currLv = isset($talentDb) ? $talentDb['talent_lv'] : 0;
|
$currLv = isset($talentDb) ? $talentDb['talent_lv'] : 0;
|
||||||
$growMeta = mt\GunTalentGrow::getByIdLv($talentId, $currLv + 1);
|
$growMeta = mt\GunTalentGrow::getByIdLv($talentId, $currLv + 1);
|
||||||
if (!$growMeta) {
|
if (!$growMeta) {
|
||||||
@ -85,7 +84,7 @@ class GunController extends BaseAuthedController {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$this->_decItems($costList);
|
$this->_decItems($costList);
|
||||||
GunTalent::upgradeLv($typeId, $talentId, $currLv + 1);
|
GunTalent::upgradeLv($talentId, $currLv + 1);
|
||||||
$propertyChgService = new services\PropertyChgService();
|
$propertyChgService = new services\PropertyChgService();
|
||||||
$propertyChgService->addUserChg();
|
$propertyChgService->addUserChg();
|
||||||
$this->_rspData(array(
|
$this->_rspData(array(
|
||||||
|
@ -49,8 +49,12 @@ class MissionController extends BaseAuthedController {
|
|||||||
private function getMissionDto($missionDb, $missionMeta)
|
private function getMissionDto($missionDb, $missionMeta)
|
||||||
{
|
{
|
||||||
$missionDto = array(
|
$missionDto = array(
|
||||||
|
'mission_id' => $missionMeta['id'],
|
||||||
|
'current' => 0,
|
||||||
|
'target' => 0,
|
||||||
|
'state' => 0,
|
||||||
);
|
);
|
||||||
|
return $missionDto;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -59,19 +59,15 @@ class UserController extends BaseAuthedController {
|
|||||||
array(
|
array(
|
||||||
'account_id' => $this->_getAccountId(),
|
'account_id' => $this->_getAccountId(),
|
||||||
'name' => $userName,
|
'name' => $userName,
|
||||||
|
'sex' => 2,
|
||||||
#'avatar_url' => $avatar_url,
|
#'avatar_url' => $avatar_url,
|
||||||
'gold' => 10000 * 10000,
|
'gold' => 10000 * 10000,
|
||||||
'diamond' => 10000 * 10000,
|
'diamond' => 10000 * 10000,
|
||||||
#'season_status' => 1,
|
|
||||||
#'newInfo' => '',
|
|
||||||
#'new_second_equip' => 2,
|
|
||||||
'head_frame' => 19003,
|
'head_frame' => 19003,
|
||||||
'sex' => 2,
|
'level' => 100,
|
||||||
|
'exp' => 0,
|
||||||
'head_id' => 18001,
|
'head_id' => 18001,
|
||||||
'hero_id' => 30100,
|
'hero_id' => 30100,
|
||||||
#'integral' => 0,
|
|
||||||
#'season_time' => mt\Season::getCurrSeasonTime(),
|
|
||||||
#'team_name' => '',
|
|
||||||
'createtime' => $this->_getNowTime(),
|
'createtime' => $this->_getNowTime(),
|
||||||
'modifytime' => $this->_getNowTime(),
|
'modifytime' => $this->_getNowTime(),
|
||||||
)
|
)
|
||||||
|
@ -7,14 +7,13 @@ use phpcommon\SqlHelper;
|
|||||||
|
|
||||||
class GunTalent extends BaseModel {
|
class GunTalent extends BaseModel {
|
||||||
|
|
||||||
public static function find($typeId, $talentId)
|
public static function find($talentId)
|
||||||
{
|
{
|
||||||
$row = SqlHelper::ormSelectOne(
|
$row = SqlHelper::ormSelectOne(
|
||||||
myself()->_getSelfMysql(),
|
myself()->_getSelfMysql(),
|
||||||
't_gun_talent',
|
't_gun_talent',
|
||||||
array(
|
array(
|
||||||
'account_id' => myself()->_getAccountId(),
|
'account_id' => myself()->_getAccountId(),
|
||||||
'type_id' => $typeId,
|
|
||||||
'talent_id' => $talentId
|
'talent_id' => $talentId
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
@ -24,20 +23,18 @@ class GunTalent extends BaseModel {
|
|||||||
public static function toDto($row)
|
public static function toDto($row)
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
'type_id' => $row['type_id'],
|
|
||||||
'talent_id' => $row['talent_id'],
|
'talent_id' => $row['talent_id'],
|
||||||
'talent_lv' => $row['talent_lv'],
|
'talent_lv' => $row['talent_lv'],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function upgradeLv($typeId, $talentId, $talentLv)
|
public static function upgradeLv($talentId, $talentLv)
|
||||||
{
|
{
|
||||||
SqlHelper::upsert(
|
SqlHelper::upsert(
|
||||||
myself()->_getSelfMysql(),
|
myself()->_getSelfMysql(),
|
||||||
't_gun_talent',
|
't_gun_talent',
|
||||||
array(
|
array(
|
||||||
'account_id' => myself()->_getAccountId(),
|
'account_id' => myself()->_getAccountId(),
|
||||||
'type_id' => $typeId,
|
|
||||||
'talent_id' => $talentId
|
'talent_id' => $talentId
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
@ -46,7 +43,6 @@ class GunTalent extends BaseModel {
|
|||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
'account_id' => myself()->_getAccountId(),
|
'account_id' => myself()->_getAccountId(),
|
||||||
'type_id' => $typeId,
|
|
||||||
'talent_id' => $talentId,
|
'talent_id' => $talentId,
|
||||||
'talent_lv' => $talentLv,
|
'talent_lv' => $talentLv,
|
||||||
'createtime' => myself()->_getNowTime(),
|
'createtime' => myself()->_getNowTime(),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user