1
This commit is contained in:
parent
3575336fe4
commit
67646a85de
@ -5,15 +5,10 @@ require_once('models/Hero.php');
|
|||||||
|
|
||||||
require_once('mt/Parameter.php');
|
require_once('mt/Parameter.php');
|
||||||
require_once('mt/Drop.php');
|
require_once('mt/Drop.php');
|
||||||
require_once('mt/EquipUpgrade.php');
|
|
||||||
require_once('mt/Season.php');
|
require_once('mt/Season.php');
|
||||||
require_once('mt/SeasonPoint.php');
|
|
||||||
require_once('mt/RankReward.php');
|
|
||||||
require_once('mt/Equip.php');
|
|
||||||
require_once('mt/Hero.php');
|
|
||||||
require_once('mt/Robot.php');
|
|
||||||
|
|
||||||
require_once('services/PropertyChgService.php');
|
require_once('services/PropertyChgService.php');
|
||||||
|
require_once('services/SeasonService.php');
|
||||||
|
|
||||||
use phpcommon\SqlHelper;
|
use phpcommon\SqlHelper;
|
||||||
use models\User;
|
use models\User;
|
||||||
@ -21,6 +16,27 @@ use models\Hero;
|
|||||||
|
|
||||||
class SeasonCardController extends BaseAuthedController {
|
class SeasonCardController extends BaseAuthedController {
|
||||||
|
|
||||||
|
private $propertyChgService = null;
|
||||||
|
private $userInfo = null;
|
||||||
|
private $seasonService = null;
|
||||||
|
|
||||||
|
public function _handlePre()
|
||||||
|
{
|
||||||
|
parent::_handlePre();
|
||||||
|
$currSeasonMeta = mt\Season::getCurrentSeason();
|
||||||
|
if (!$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()
|
public function info()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@ -12,20 +12,29 @@ use models\User;
|
|||||||
|
|
||||||
class SeasonController extends BaseAuthedController {
|
class SeasonController extends BaseAuthedController {
|
||||||
|
|
||||||
public function info()
|
private $propertyChgService = null;
|
||||||
|
private $userInfo = null;
|
||||||
|
private $seasonService = null;
|
||||||
|
|
||||||
|
public function _handlePre()
|
||||||
{
|
{
|
||||||
|
parent::_handlePre();
|
||||||
$currSeasonMeta = mt\Season::getCurrentSeason();
|
$currSeasonMeta = mt\Season::getCurrentSeason();
|
||||||
if (!$currSeasonMeta) {
|
if (!$currSeasonMeta) {
|
||||||
$this->_rspErr(10, '服务器内部错误');
|
$this->_rspErr(10, '服务器内部错误');
|
||||||
return;
|
die();
|
||||||
}
|
}
|
||||||
$propertyChgService = new services\PropertyChgService();
|
$this->propertyChgService = new services\PropertyChgService();
|
||||||
$userInfo = $this->_safeGetOrmUserInfo();
|
$this->userInfo = $this->_safeGetOrmUserInfo();
|
||||||
$seasonService = new services\SeasonService();
|
$this->seasonService = new services\SeasonService();
|
||||||
if (!$seasonService->checkSeason($userInfo)) {
|
if (!$this->seasonService->checkSeason($this->userInfo)) {
|
||||||
$userInfo = $this->_safeGetOrmUserInfo();
|
$this->userInfo = $this->_safeGetOrmUserInfo();
|
||||||
$propertyChgService->addUserChg();
|
$this->propertyChgService->addUserChg();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function info()
|
||||||
|
{
|
||||||
$rankMeta = mt\Rank::get($userInfo['rank']);
|
$rankMeta = mt\Rank::get($userInfo['rank']);
|
||||||
$this->_rspData(array(
|
$this->_rspData(array(
|
||||||
array(
|
array(
|
||||||
@ -43,11 +52,6 @@ class SeasonController extends BaseAuthedController {
|
|||||||
|
|
||||||
public function getMissionReward()
|
public function getMissionReward()
|
||||||
{
|
{
|
||||||
$currSeasonMeta = mt\Season::getCurrentSeason();
|
|
||||||
if (!$currSeasonMeta) {
|
|
||||||
$this->_rspErr(10, '服务器内部错误');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
$mission = $this->getMissionInfo();
|
$mission = $this->getMissionInfo();
|
||||||
if ($mission['state'] != 1) {
|
if ($mission['state'] != 1) {
|
||||||
$this->_rspErr(1, '不可领取');
|
$this->_rspErr(1, '不可领取');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user