69 lines
1.7 KiB
PHP
69 lines
1.7 KiB
PHP
<?php
|
|
|
|
require_once('models/User.php');
|
|
require_once('models/Hero.php');
|
|
|
|
require_once('mt/Parameter.php');
|
|
require_once('mt/Drop.php');
|
|
require_once('mt/Season.php');
|
|
|
|
require_once('services/PropertyChgService.php');
|
|
require_once('services/SeasonService.php');
|
|
|
|
use phpcommon\SqlHelper;
|
|
use models\User;
|
|
use models\Hero;
|
|
|
|
class SeasonCardController extends BaseAuthedController {
|
|
|
|
private $propertyChgService = null;
|
|
private $userInfo = null;
|
|
private $seasonService = null;
|
|
private $currSeasonMeta = null;
|
|
private $seasonDb = null;
|
|
private $seasonCardDb = null;
|
|
|
|
public function _handlePre()
|
|
{
|
|
parent::_handlePre();
|
|
$this->currSeasonMeta = mt\Season::getCurrentSeason();
|
|
if (!$this->currSeasonMeta) {
|
|
$this->_rspErr(10, '服务器内部错误');
|
|
die();
|
|
}
|
|
$this->propertyChgService = new services\PropertyChgService();
|
|
$this->userInfo = $this->_safeGetOrmUserInfo();
|
|
$this->seasonService = new services\SeasonService();
|
|
if (!$this->seasonService->checkSeason($this->userInfo)) {
|
|
$this->userInfo = $this->_safeGetOrmUserInfo();
|
|
$this->propertyChgService->addUserChg();
|
|
}
|
|
}
|
|
|
|
public function info()
|
|
{
|
|
$this->_rspData(array(
|
|
array(
|
|
'info' => array(
|
|
'season_id' => $this->currSeasonMeta['id'],
|
|
'card_lv' => $this->seasonDb ? $this->seasonDb['card_lv'] : 1,
|
|
'card_exp' => $this->seasonDb ? $this->seasonDb['card_exp'] : 0,
|
|
)
|
|
)
|
|
));
|
|
}
|
|
|
|
public function getReward()
|
|
{
|
|
}
|
|
|
|
public function buyLevel()
|
|
{
|
|
}
|
|
|
|
public function buyGiftPackage()
|
|
{
|
|
}
|
|
|
|
}
|