From 8b90fe7e5a84d502479062f546038a2ee34c3265 Mon Sep 17 00:00:00 2001 From: hujiabin <519660157@qq.com> Date: Wed, 13 Mar 2024 15:14:43 +0800 Subject: [PATCH] 1 --- webapp/controller/HeroController.class.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/webapp/controller/HeroController.class.php b/webapp/controller/HeroController.class.php index f9c5e9ec..9b2e8ac3 100644 --- a/webapp/controller/HeroController.class.php +++ b/webapp/controller/HeroController.class.php @@ -37,8 +37,13 @@ class HeroController extends BaseAuthedController { public function heroList() { $heroList = array(); - Hero::getHeroList(function ($row) use(&$heroList) { + $userDb = myself()->_getOrmUserInfo(); + Hero::getHeroList(function ($row) use(&$heroList,$userDb) { $row['hero_uniid'] = $row['idx']; + $row['is_select'] = 0; + if ($row['idx'] == $userDb['hero_id']){ + $row['is_select'] = 1; + } array_push($heroList, $row); }); $this->_rspData(array(