From c32c4a279322d9d965f14cdb611f9b600660f42f Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Tue, 7 Dec 2021 15:47:01 +0800 Subject: [PATCH] 1 --- webapp/controller/UserController.class.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/webapp/controller/UserController.class.php b/webapp/controller/UserController.class.php index 2a9710d..c094649 100644 --- a/webapp/controller/UserController.class.php +++ b/webapp/controller/UserController.class.php @@ -109,9 +109,9 @@ class UserController extends BaseAuthedController { } } } - $headId = 0; - $headFrame = 0; - $heroId = 0; + $headId = !empty($headList) ? $headList[rand() % count($headList)] : 0; + $headFrame = !empty($headFrameList) ? $headFrameList[rand() % count($headFrameList)] : 0; + $heroId = !empty($heroList) ? $heroList[rand() % count($heroList)] : 0; SqlHelper::upsert ($this->_getSelfMysql(), 't_user', @@ -141,6 +141,7 @@ class UserController extends BaseAuthedController { 'modifytime' => $this->_getNowTime(), ) ); + $this->_addItems($addItems); } public function active()