_getSelfMysql(), 't_hero', array( 'account_id' => $this->_getAccountId() ), function ($row) use(&$heroList) { array_push($heroList, Hero::toDto($row)); } ); $this->_rspData(array( 'hero_list' => $heroList )); } public function skinList() { $skinList = array(); SqlHelper::ormSelect( $this->_getSelfMysql(), 't_hero_skin', array( 'account_id' => $this->_getAccountId() ), function ($row) use(&$skinList) { array_push($skinList, HeroSkin::toDto($row)); } ); $this->_rspData(array( 'skin_list' => $skinList )); } public function takeonSkin() { $heroId = getReqVal('hero_id', 0); $skinId = getReqVal('skin_id', 0); $heroDb = Hero::find($heroId); $heroSkinDb = Hero::find($skinId); if (!$heroDb) { $this->_rspErr(1, '你还没这个英雄'); return; } if (!$heroSkinDb) { $this->_rspErr(2, '你还没这个皮肤'); return; } Hero::takeonSkin($heroId, $skinId); $this->_rspOk(); } public function upgradeSkill() { $heroId = getReqVal('hero_id', 0); $skillIdx = getReqVal('skill_idx', 0); $heroDb = Hero::find($heroId); if (!$heroDb) { $this->_rspErr(1, '你还没这个英雄'); return; } if (!in_array($skillIdx, array(0, 1))) { $this->_rspErr(1, 'skill_idx参数必须为0-1'); return; } Hero::upgradeSkill($heroId, $skillIdx); $this->_rspOk(); } public function useYokeItem() { $heroId = getReqVal('hero_id', 0); $itemId = getReqVal('item_id', 0); $itemNum = getReqVal('item_num', 0); $this->_rspOk(); } }