diff --git a/webapp/controller/RankingController.class.php b/webapp/controller/RankingController.class.php index e1ea772a..1a1fcd6d 100644 --- a/webapp/controller/RankingController.class.php +++ b/webapp/controller/RankingController.class.php @@ -99,11 +99,11 @@ class RankingController extends BaseAuthedController { if ($row){ $hero_skin = 0; - $heroDb = Hero::find($row['hero_id']); + $heroDb = Hero::findByAccountId($row['account_id'],$row['hero_id']); if ($heroDb){ $heroItemId = $heroDb['hero_id']; - $skinDb = HeroSkin::findBx($heroItemId); + $skinDb = HeroSkin::findByAccountId($row['account_id'],$heroItemId); $hero_skin = $skinDb['skin_id']; } diff --git a/webapp/models/HeroSkin.php b/webapp/models/HeroSkin.php index ad8e0be5..836e87f5 100644 --- a/webapp/models/HeroSkin.php +++ b/webapp/models/HeroSkin.php @@ -37,6 +37,18 @@ class HeroSkin extends BaseModel { ); return $row; } + public static function findByAccountId($accountId, $heroId) + { + $row = SqlHelper::ormSelectOne( + myself()->_getSelfMysql(), + 't_hero_skin', + array( + 'account_id' => $accountId, + 'hero_id' => $heroId + ) + ); + return $row; + } public static function takeonSkin($skinId,$heroId){ $row = self::findBx($heroId);