_getSelfMysql(), 't_gun_skin', array( 'account_id' => $this->_getAccountId() ), function ($row) use(&$skinList) { array_push($skinList, GunSkin::toDto($row)); } ); $this->_rspData(array( 'skin_list' => $skinList )); } public function talentList() { $talentList = array(); SqlHelper::ormSelect( $this->_getSelfMysql(), 't_gun_talent', array( 'account_id' => $this->_getAccountId() ), function ($row) use(&$talentList) { array_push($talentList, GunTalent::toDto($row)); } ); $this->_rspData(array( 'talent_list' => $talentList )); } public function upgradeTalentLv() { $talentId = getReqVal('talent_id', 0); $talentDb = GunTalent::find($talentId); $currLv = isset($talentDb) ? $talentDb['talent_lv'] : 1; $growMeta = mt\GunTalentGrow::getByIdLv($talentId, $currLv + 1); if (!$growMeta) { $this->_rspErr(2, '已满级'); return; } $ormUserInfo = $this->_getOrmUserInfo(); if ($ormUserInfo['level'] < $growMeta['need_user_level']) { $this->_rspErr(3, '用户等级未到达'); return; } $costList = mt\GunTalentGrow::getCostList($growMeta); $lackItem = array(); if (!$this->_hasEnoughItems($costList, $lackItem)) { $this->_rspErr(3, '缺少材料'); return; } $this->_decItems($costList); GunTalent::upgradeLv($talentId, $currLv + 1); $propertyChgService = new services\PropertyChgService(); $propertyChgService->addUserChg(); $this->_rspData(array( 'property_chg' => $propertyChgService->toDto() )); } }