_rspData(array( 'skin_list' => $skinList )); } public function takeonSkin() { $heroUniId = getReqVal('hero_uniid', 0); $skinUniId = getReqVal('skin_uniid', 0); $heroDb = Hero::find($heroUniId); $heroSkinDb = HeroSkin::find($skinUniId); if (!$heroDb) { $this->_rspErr(1, "You don't have the hero yet"); return; } if (!$heroSkinDb) { $this->_rspErr(1, "You don't have the skin yet"); return; } Hero::update( $heroUniId,array( 'skin_id' => $skinUniId )); $this->_rspOk(); } public function unequip(){ $heroUniId = getReqVal('hero_uniid', 0); $heroDb = Hero::find($heroUniId); if (!$heroDb) { $this->_rspErr(1, "You don't have the hero yet"); return; } Hero::update( $heroUniId,array( 'skin_id' => 0 )); $this->_rspOk(); } }