From 2371e713d1bd5204a4d6d4a7fd5ceafb8c69c49b Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Wed, 2 Aug 2023 18:39:03 +0800 Subject: [PATCH] 1 --- .../controller/FirstTopupController.class.php | 52 ++----------------- 1 file changed, 5 insertions(+), 47 deletions(-) diff --git a/webapp/controller/FirstTopupController.class.php b/webapp/controller/FirstTopupController.class.php index e0658da7..8ba3c3df 100644 --- a/webapp/controller/FirstTopupController.class.php +++ b/webapp/controller/FirstTopupController.class.php @@ -10,30 +10,25 @@ use phpcommon\SqlHelper; use models\FirstTopup; -class FirstTopupController extends BaseAuthedController -{ +class FirstTopupController extends BaseAuthedController { public function info() { $dbInfo = FirstTopup::get(); + $status = array(0, 0, 0); if (!$dbInfo) { $this->_rspData(array( 'complete' => 0, 'firstTopupList' => mt\FirstTopup::getGroups(), - 'status' => 0, + 'status' => $status, ) ); return; } - - $status = $this->getStatusFromDB($conn); - - // 检查所有 奖励都 领取完成 $complete = ($status[0] == 2 && $status[1] == 2 && $status[2] == 2) ? 1 : 0; - if ($complete == 1) { - $this->_setV(TN_FIRST_TUPOP_STATUS, 0, 1); + if ($complete == 1 && myself()->_getV(TN_FIRST_TUPOP_STATUS, 0, 1) == 0) { + myself()->_setV(TN_FIRST_TUPOP_STATUS, 0, 1); } - $this->_rspData( array( 'complete' => $complete, @@ -185,41 +180,4 @@ class FirstTopupController extends BaseAuthedController return $status; } - private function internalAddItem($propertyChgService, $itemMeta, $count) - { - switch ($itemMeta['type']) { - case mt\Item::HERO_TYPE: { - Hero::addHero($itemMeta); - $propertyChgService->addHeroChg(); - $propertyChgService->addUserChg(); - } - break; - case mt\Item::HERO_SKIN_TYPE: { - HeroSkin::addSkin($itemMeta); - $propertyChgService->addHeroSkinChg(); - } - break; - case mt\Item::GUN_TYPE: { - Gun::addGun($itemMeta); - $propertyChgService->addGunChg(); - } - break; - case mt\Item::GUN_SKIN_TYPE: { - GunSkin::addSkin($itemMeta); - $propertyChgService->addGunSkinChg(); - } - break; - case mt\Item::CHIP_TYPE: { - Chip::addChip($itemMeta); - $propertyChgService->addChip(); - } - break; - default: { - Bag::addItem($itemMeta['id'], $count); - $propertyChgService->addBagChg(); - } - break; - } - } - }