From 256b236b9101eaba3880338858d7958cbd5abf04 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Tue, 7 Dec 2021 16:17:04 +0800 Subject: [PATCH] 1 --- webapp/models/User.php | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/webapp/models/User.php b/webapp/models/User.php index 8525cd8..e0a8f9e 100644 --- a/webapp/models/User.php +++ b/webapp/models/User.php @@ -2,6 +2,11 @@ namespace models; +require_once('mt/Item.php'); + +use mt; +use phpcommon\SqlHelper; + class User extends BaseModel { public static function show($row) @@ -65,8 +70,19 @@ class User extends BaseModel { private static function getHeadList($userInfo) { $headList = emptyReplace(json_decode($userInfo['head_list'], true), array()); - $heroList = array(); - $heroSkinList = array(); + $rows = SqlHelper::ormSelect( + myself()->_getSelfMysql(), + 't_hero', + array( + 'account_id' => $userInfo['account_id'], + ) + ); + foreach ($rows as $row) { + $itemMeta = mt\Item::get($row['hero_id']); + if ($itemMeta && $itemMeta['hero_head']) { + array_push($headList, $itemMeta['hero_head']); + } + } return $headList; }