This commit is contained in:
hujiabin 2023-05-18 19:22:03 +08:00
parent b74526c112
commit 08cf62cfed
2 changed files with 14 additions and 2 deletions

View File

@ -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'];
}

View File

@ -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);