From 08cf62cfeda11be631d76aa1bb0b95bbb684cd2f Mon Sep 17 00:00:00 2001 From: hujiabin <519660157@qq.com> Date: Thu, 18 May 2023 19:22:03 +0800 Subject: [PATCH] 1 --- webapp/controller/RankingController.class.php | 4 ++-- webapp/models/HeroSkin.php | 12 ++++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) 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);