From 3a8b989fb4467134b5aeac074931ed45fb604bbf Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Mon, 19 Sep 2022 18:57:51 +0800 Subject: [PATCH] 1 --- webapp/models/FragmentPool.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/webapp/models/FragmentPool.php b/webapp/models/FragmentPool.php index 68292c93..be0368a4 100644 --- a/webapp/models/FragmentPool.php +++ b/webapp/models/FragmentPool.php @@ -31,6 +31,26 @@ class FragmentPool extends BaseModel { return 0; } + public static function getHeroNum() + { + $items = self::internalGet(0); + $num = 0; + foreach ($items as $item) { + $num += $item['fragment_num']; + } + return $num; + } + + public static function getGunNum() + { + $items = self::internalGet(1); + $num = 0; + foreach ($items as $item) { + $num += $item['fragment_num']; + } + return $num; + } + private static function internalGet($type) { $allocTime = self::getAllocTime();