1
This commit is contained in:
parent
6053829365
commit
2371e713d1
@ -10,30 +10,25 @@ use phpcommon\SqlHelper;
|
|||||||
|
|
||||||
use models\FirstTopup;
|
use models\FirstTopup;
|
||||||
|
|
||||||
class FirstTopupController extends BaseAuthedController
|
class FirstTopupController extends BaseAuthedController {
|
||||||
{
|
|
||||||
|
|
||||||
public function info()
|
public function info()
|
||||||
{
|
{
|
||||||
$dbInfo = FirstTopup::get();
|
$dbInfo = FirstTopup::get();
|
||||||
|
$status = array(0, 0, 0);
|
||||||
if (!$dbInfo) {
|
if (!$dbInfo) {
|
||||||
$this->_rspData(array(
|
$this->_rspData(array(
|
||||||
'complete' => 0,
|
'complete' => 0,
|
||||||
'firstTopupList' => mt\FirstTopup::getGroups(),
|
'firstTopupList' => mt\FirstTopup::getGroups(),
|
||||||
'status' => 0,
|
'status' => $status,
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$status = $this->getStatusFromDB($conn);
|
|
||||||
|
|
||||||
// 检查所有 奖励都 领取完成
|
|
||||||
$complete = ($status[0] == 2 && $status[1] == 2 && $status[2] == 2) ? 1 : 0;
|
$complete = ($status[0] == 2 && $status[1] == 2 && $status[2] == 2) ? 1 : 0;
|
||||||
if ($complete == 1) {
|
if ($complete == 1 && myself()->_getV(TN_FIRST_TUPOP_STATUS, 0, 1) == 0) {
|
||||||
$this->_setV(TN_FIRST_TUPOP_STATUS, 0, 1);
|
myself()->_setV(TN_FIRST_TUPOP_STATUS, 0, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->_rspData(
|
$this->_rspData(
|
||||||
array(
|
array(
|
||||||
'complete' => $complete,
|
'complete' => $complete,
|
||||||
@ -185,41 +180,4 @@ class FirstTopupController extends BaseAuthedController
|
|||||||
return $status;
|
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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user