添加算力玩法
This commit is contained in:
parent
8d28eb373d
commit
f7ad15c6bd
@ -19,6 +19,46 @@ class ComputingPower(object):
|
||||
['info', _common.ComputingPower(), '算力信息']
|
||||
]
|
||||
},
|
||||
{
|
||||
'name': 'getCrystalUi',
|
||||
'desc': '获取晶体ui信息',
|
||||
'group': 'ComputingPower',
|
||||
'url': 'webapp/index.php?c=ComputingPower&a=getCrystalUi',
|
||||
'params': [
|
||||
_common.ReqHead(),
|
||||
],
|
||||
'response': [
|
||||
_common.RspHead(),
|
||||
['data', _common.CrystalUI(), '晶体的获取方式信息']
|
||||
]
|
||||
},
|
||||
{
|
||||
'name': 'exchangeCrystal',
|
||||
'desc': '兑换晶体',
|
||||
'group': 'ComputingPower',
|
||||
'url': 'webapp/index.php?c=ComputingPower&a=exchangeCrystal',
|
||||
'params': [
|
||||
_common.ReqHead(),
|
||||
['item_id', 0, '晶体item'],
|
||||
['item_num', 0, '晶体数量'],
|
||||
],
|
||||
'response': [
|
||||
_common.RspHead(),
|
||||
]
|
||||
},
|
||||
{
|
||||
'name': 'getExchangeCrystalRecord',
|
||||
'desc': '获取兑换晶体记录',
|
||||
'group': 'ComputingPower',
|
||||
'url': 'webapp/index.php?c=ComputingPower&a=getExchangeCrystalRecord',
|
||||
'params': [
|
||||
_common.ReqHead(),
|
||||
],
|
||||
'response': [
|
||||
_common.RspHead(),
|
||||
['data', _common.ExchangeCrystalRecord(), '算力信息']
|
||||
]
|
||||
},
|
||||
{
|
||||
'name': 'exchangePower',
|
||||
'desc': '晶体兑换算力',
|
||||
@ -32,30 +72,20 @@ class ComputingPower(object):
|
||||
]
|
||||
},
|
||||
{
|
||||
'name': 'exchangeCrystal',
|
||||
'desc': '兑换晶体',
|
||||
'name': 'exchangeUplimit',
|
||||
'desc': '每周晶体兑换上限',
|
||||
'group': 'ComputingPower',
|
||||
'url': 'webapp/index.php?c=ComputingPower&a=exchangeCrystal',
|
||||
'url': 'webapp/index.php?c=ComputingPower&a=exchangeUplimit',
|
||||
'params': [
|
||||
_common.ReqHead(),
|
||||
],
|
||||
'response': [
|
||||
_common.RspHead(),
|
||||
['data', _common.ExchangeCrystalNum(), '本周期晶体兑换信息']
|
||||
]
|
||||
},
|
||||
{
|
||||
'name': 'getCrystalUi',
|
||||
'desc': '获取晶体ui信息',
|
||||
'group': 'ComputingPower',
|
||||
'url': 'webapp/index.php?c=ComputingPower&a=getCrystalUi',
|
||||
'params': [
|
||||
_common.ReqHead(),
|
||||
],
|
||||
'response': [
|
||||
_common.RspHead(),
|
||||
['info', _common.ComputingPower(), '算力信息']
|
||||
]
|
||||
},
|
||||
|
||||
|
||||
{
|
||||
'name': 'getRewardHistorys',
|
||||
'desc': '获取奖励历史',
|
||||
@ -69,19 +99,7 @@ class ComputingPower(object):
|
||||
['info', _common.ComputingPower(), '算力信息']
|
||||
]
|
||||
},
|
||||
{
|
||||
'name': 'getExchangeCrystalHistorys',
|
||||
'desc': '获取兑换晶体历史',
|
||||
'group': 'ComputingPower',
|
||||
'url': 'webapp/index.php?c=ComputingPower&a=getExchangeCrystalHistorys',
|
||||
'params': [
|
||||
_common.ReqHead(),
|
||||
],
|
||||
'response': [
|
||||
_common.RspHead(),
|
||||
['info', _common.ComputingPower(), '算力信息']
|
||||
]
|
||||
},
|
||||
|
||||
{
|
||||
'name': 'getExchangePowerHistorys',
|
||||
'desc': '获取兑换算力历史',
|
||||
|
21
doc/Other.py
21
doc/Other.py
@ -23,5 +23,24 @@ class Other(object):
|
||||
],'碎片']
|
||||
], '提示信息'],
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
'name': 'getGameModuleState',
|
||||
'desc': '功能模块的状态',
|
||||
'group': 'Other',
|
||||
'url': 'webapp/index.php?c=Other&a=getGameModuleState',
|
||||
'params': [
|
||||
_common.ReqHead(),
|
||||
],
|
||||
'response': [
|
||||
_common.RspHead(),
|
||||
['data', [
|
||||
['firstTopUp',0,'首充: 1 已充, 0 未充'],
|
||||
['signDayState',0,'7日签到: 1 签满, 0 未签满'],
|
||||
['rankState',0,'排位: 1 赛季开始了, 0 赛季未开始'],
|
||||
['nextRankSeasonCountdown',0,'下赛季倒计时'],
|
||||
['hashRateState',0,'算力: 1 开始, 0 未开始'],
|
||||
], '信息'],
|
||||
]
|
||||
},
|
||||
]
|
@ -1325,42 +1325,77 @@ class MallGoods(object):
|
||||
['modify_countdown', 0, '可修改价格倒计时:-1不可修改价格'],
|
||||
]
|
||||
|
||||
class ComputingPowerSelf(object):
|
||||
|
||||
def __init__(self):
|
||||
self.fields = [
|
||||
['exchange_hash_rate', '', "我已兑换的算力"],
|
||||
]
|
||||
|
||||
class ComputingPowerCurr(object):
|
||||
|
||||
def __init__(self):
|
||||
self.fields = [
|
||||
['period_begin', '', '本期开始时间'],
|
||||
['period_end', '', '本期结束时间'],
|
||||
['assignable_cec', '', '可分配的cec'],
|
||||
# ['current_state', '', '周期状态 -1:算力周期未开始 0:正常周期 1:等待周期 2:维护周期'],
|
||||
['period_begin', '', '本期开始时间(0 不显示)'],
|
||||
['period_end', '', '本期结束时间(0 不显示)'],
|
||||
['await_time', '', '结算等待时间'],
|
||||
['assignable_cec', '', '可分配的总cec奖励'],
|
||||
['total_target', '', '全服算力总目标'],
|
||||
|
||||
['total_target', '', '总目标'],
|
||||
['total_hash_rate', '', '总算力'],
|
||||
['refresh_remain_time', '', '刷新剩余时间'],
|
||||
['total_exchange_hash_rate', '', "总兑换算力"],
|
||||
# ['refresh_remain_time', '', '刷新剩余时间'],
|
||||
['total_hash_rate', '', '全服总兑换算力'],
|
||||
['total_exchange_hash_rate', '', "玩家已兑换算力"],
|
||||
]
|
||||
|
||||
class ComputingPowerLast(object):
|
||||
|
||||
def __init__(self):
|
||||
self.fields = [
|
||||
['period_begin', '', ''],
|
||||
['period_end', '', '商品唯一id'],
|
||||
['period_reward', '', '商品唯一id'],
|
||||
['clamid', '', ''],
|
||||
['period_begin', 0, '上期开始时间(0 不显示)'],
|
||||
['period_end', 0, '上期结束时间(0 不显示)'],
|
||||
['reward', 0, '上期的cec奖励'],
|
||||
]
|
||||
|
||||
class ComputingPower(object):
|
||||
|
||||
def __init__(self):
|
||||
self.fields = [
|
||||
['curr_period', ComputingPowerCurr(), ''],
|
||||
['curr_self', ComputingPowerSelf(), ''],
|
||||
['last_period', ComputingPowerLast(), '商品唯一id'],
|
||||
['period_state', 0, '周期状态 -1:算力周期未开始 0:正常周期 1:等待周期 2:维护周期'],
|
||||
['curr_period', ComputingPowerCurr(), '本期相关信息'],
|
||||
['last_period', ComputingPowerLast(), '上期相关信息'],
|
||||
['listing_state', 0, 'listing状态 0:之前 1:之后'],
|
||||
['owned_cec', 0, '拥有的cec数量'],
|
||||
]
|
||||
|
||||
class CrystalUI(object):
|
||||
|
||||
def __init__(self):
|
||||
self.fields = [
|
||||
['item_id', 0, 'item_id'],
|
||||
['pending', 0, 'pending'],
|
||||
['total', CrystalUIParam(), '统计信息'],
|
||||
['claimed', 0, '已领取的数量'],
|
||||
['state', 0, '是否能领取 1:可领取 0:反之'],
|
||||
]
|
||||
|
||||
class CrystalUIParam(object):
|
||||
|
||||
def __init__(self):
|
||||
self.fields = [
|
||||
['param1', 0, '击杀数/其它晶体的价值数'],
|
||||
['param2', 0, '星星数'],
|
||||
['param3', 0, '升段数'],
|
||||
]
|
||||
|
||||
class ExchangeCrystalRecord(object):
|
||||
|
||||
def __init__(self):
|
||||
self.fields = [
|
||||
['item_id', 0, '晶体item'],
|
||||
['item_num', 0, '晶体数'],
|
||||
['createtime', 0, '领取时间'],
|
||||
]
|
||||
|
||||
class ExchangeCrystalNum(object):
|
||||
|
||||
def __init__(self):
|
||||
self.fields = [
|
||||
['num1', 0, '本期晶体260001兑换数'],
|
||||
['num2', 0, '本期晶体260002兑换数'],
|
||||
['num3', 0, '本期晶体260003兑换数'],
|
||||
['num4', 0, '本期晶体260004兑换数'],
|
||||
]
|
0
server/game2006service/tasks/hourlyTask.js
Normal file
0
server/game2006service/tasks/hourlyTask.js
Normal file
@ -1531,26 +1531,7 @@ CREATE TABLE `t_market_transaction_record` (
|
||||
KEY `order_id` (`order_id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=10002 DEFAULT CHARSET=utf8;
|
||||
|
||||
--
|
||||
-- Table structure for table `t_crystal`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `t_crystal`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
CREATE TABLE `t_crystal` (
|
||||
`idx` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||
`account_id` varchar(60) NOT NULL DEFAULT '' COMMENT '账号id',
|
||||
`address` varchar(60) COMMENT 'address',
|
||||
`item_id` int(11) NOT NULL DEFAULT '0' COMMENT '道具id',
|
||||
`item_num` bigint NOT NULL DEFAULT '0' COMMENT '道具数量',
|
||||
`createtime` int(11) NOT NULL COMMENT '创建时间',
|
||||
`modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
|
||||
PRIMARY KEY (`idx`),
|
||||
UNIQUE KEY `account_id_item_id` (`account_id`, `item_id`),
|
||||
KEY `account_id` (`account_id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Table structure for table `t_crystal_exchange_record`
|
||||
@ -1585,8 +1566,11 @@ CREATE TABLE `t_power_exchange_record` (
|
||||
`account_id` varchar(60) NOT NULL DEFAULT '' COMMENT '账号id',
|
||||
`address` varchar(60) COMMENT 'address',
|
||||
`period` int(11) NOT NULL DEFAULT '0' COMMENT '第几期',
|
||||
`item_id` int(11) NOT NULL DEFAULT '0' COMMENT '道具id',
|
||||
`item_num` bigint NOT NULL DEFAULT '0' COMMENT '道具数量',
|
||||
`item_num1` int(11) NOT NULL DEFAULT '0' COMMENT '晶体道具260001兑换算力数量',
|
||||
`item_num2` int(11) NOT NULL DEFAULT '0' COMMENT '晶体道具260002兑换算力数量',
|
||||
`item_num3` int(11) NOT NULL DEFAULT '0' COMMENT '晶体道具260003兑换算力数量',
|
||||
`item_num4` int(11) NOT NULL DEFAULT '0' COMMENT '晶体道具260004兑换算力数量',
|
||||
`total_num` double NOT NULL DEFAULT '0' COMMENT '算力总量',
|
||||
`createtime` int(11) NOT NULL COMMENT '创建时间',
|
||||
`modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
|
||||
PRIMARY KEY (`idx`),
|
||||
@ -1594,6 +1578,16 @@ CREATE TABLE `t_power_exchange_record` (
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
CREATE TABLE `t_computing_power_period` (
|
||||
`idx` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||
`period` int(11) NOT NULL DEFAULT '0' COMMENT '第几期',
|
||||
`total_num` varchar(60) COMMENT '全服算力总量',
|
||||
`createtime` int(11) NOT NULL COMMENT '创建时间',
|
||||
`modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
|
||||
PRIMARY KEY (`idx`),
|
||||
UNIQUE KEY `period` (`period`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8;
|
||||
|
||||
--
|
||||
-- Table structure for table `t_computing_power_period`
|
||||
--
|
||||
@ -1601,17 +1595,17 @@ CREATE TABLE `t_power_exchange_record` (
|
||||
DROP TABLE IF EXISTS `t_computing_power_period`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
CREATE TABLE `t_computing_power_period` (
|
||||
CREATE TABLE `t_hash_rate_reward` (
|
||||
`idx` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||
`account_id` varchar(60) NOT NULL DEFAULT '' COMMENT '账号id',
|
||||
`address` varchar(60) COMMENT 'address',
|
||||
`period` int(11) NOT NULL DEFAULT '0' COMMENT '第几期',
|
||||
`power` varchar(60) COMMENT '算力',
|
||||
`reward_cec` varchar(60) COMMENT 'reward cec',
|
||||
`reward1` int(11) NOT NULL DEFAULT '0' COMMENT '第1期奖励',
|
||||
`reward2` int(11) NOT NULL DEFAULT '0' COMMENT '第2期奖励',
|
||||
`reward3` int(11) NOT NULL DEFAULT '0' COMMENT '第3期奖励',
|
||||
`reward4` int(11) NOT NULL DEFAULT '0' COMMENT '第4期奖励',
|
||||
`reward1` int(11) NOT NULL DEFAULT '0' COMMENT '第1周奖励',
|
||||
`reward2` int(11) NOT NULL DEFAULT '0' COMMENT '第2周奖励',
|
||||
`reward3` int(11) NOT NULL DEFAULT '0' COMMENT '第3周奖励',
|
||||
`reward4` int(11) NOT NULL DEFAULT '0' COMMENT '第4周奖励',
|
||||
|
||||
`createtime` int(11) NOT NULL COMMENT '创建时间',
|
||||
`modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
|
||||
|
77
sql/gamedb2006_migrate_230816_01.sql
Normal file
77
sql/gamedb2006_migrate_230816_01.sql
Normal file
@ -0,0 +1,77 @@
|
||||
begin;
|
||||
|
||||
-- CREATE TABLE `t_crystal` (
|
||||
-- `idx` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||
-- `account_id` varchar(60) NOT NULL DEFAULT '' COMMENT '账号id',
|
||||
-- `address` varchar(60) COMMENT 'address',
|
||||
-- `item_id` int(11) NOT NULL DEFAULT '0' COMMENT '道具id',
|
||||
-- `item_num` bigint NOT NULL DEFAULT '0' COMMENT '道具数量',
|
||||
-- `createtime` int(11) NOT NULL COMMENT '创建时间',
|
||||
-- `modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
|
||||
-- PRIMARY KEY (`idx`),
|
||||
-- UNIQUE KEY `account_id_item_id` (`account_id`, `item_id`),
|
||||
-- KEY `account_id` (`account_id`)
|
||||
-- ) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8;
|
||||
|
||||
|
||||
CREATE TABLE `t_crystal_exchange_record` (
|
||||
`idx` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||
`account_id` varchar(60) NOT NULL DEFAULT '' COMMENT '账号id',
|
||||
`address` varchar(60) COMMENT 'address',
|
||||
`period` int(11) NOT NULL DEFAULT '0' COMMENT '第几期',
|
||||
`item_id` int(11) NOT NULL DEFAULT '0' COMMENT '道具id',
|
||||
`item_num` bigint NOT NULL DEFAULT '0' COMMENT '道具数量',
|
||||
`createtime` int(11) NOT NULL COMMENT '创建时间',
|
||||
`modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
|
||||
PRIMARY KEY (`idx`),
|
||||
KEY `account_id` (`account_id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8;
|
||||
|
||||
CREATE TABLE `t_power_exchange_record` (
|
||||
`idx` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||
`account_id` varchar(60) NOT NULL DEFAULT '' COMMENT '账号id',
|
||||
`address` varchar(60) COMMENT 'address',
|
||||
`period` int(11) NOT NULL DEFAULT '0' COMMENT '第几期',
|
||||
`item_num1` int(11) NOT NULL DEFAULT '0' COMMENT '晶体道具260001兑换算力数量',
|
||||
`item_num2` int(11) NOT NULL DEFAULT '0' COMMENT '晶体道具260002兑换算力数量',
|
||||
`item_num3` int(11) NOT NULL DEFAULT '0' COMMENT '晶体道具260003兑换算力数量',
|
||||
`item_num4` int(11) NOT NULL DEFAULT '0' COMMENT '晶体道具260004兑换算力数量',
|
||||
`total_num` double NOT NULL DEFAULT '0' COMMENT '算力总量',
|
||||
`createtime` int(11) NOT NULL COMMENT '创建时间',
|
||||
`modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
|
||||
PRIMARY KEY (`idx`),
|
||||
KEY `account_id` (`account_id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8;
|
||||
|
||||
CREATE TABLE `t_computing_power_period` (
|
||||
`idx` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||
`period` int(11) NOT NULL DEFAULT '0' COMMENT '第几期',
|
||||
`total_num` varchar(60) COMMENT '全服算力总量',
|
||||
`createtime` int(11) NOT NULL COMMENT '创建时间',
|
||||
`modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
|
||||
PRIMARY KEY (`idx`),
|
||||
UNIQUE KEY `period` (`period`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8;
|
||||
|
||||
CREATE TABLE `t_hash_rate_reward` (
|
||||
`idx` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||
`account_id` varchar(60) NOT NULL DEFAULT '' COMMENT '账号id',
|
||||
`address` varchar(60) COMMENT 'address',
|
||||
`period` int(11) NOT NULL DEFAULT '0' COMMENT '第几期',
|
||||
`power` varchar(60) COMMENT '算力',
|
||||
`reward_cec` varchar(60) COMMENT 'reward cec',
|
||||
`reward1` int(11) NOT NULL DEFAULT '0' COMMENT '第1周奖励',
|
||||
`reward2` int(11) NOT NULL DEFAULT '0' COMMENT '第2周奖励',
|
||||
`reward3` int(11) NOT NULL DEFAULT '0' COMMENT '第3周奖励',
|
||||
`reward4` int(11) NOT NULL DEFAULT '0' COMMENT '第4周奖励',
|
||||
|
||||
`createtime` int(11) NOT NULL COMMENT '创建时间',
|
||||
`modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
|
||||
PRIMARY KEY (`idx`),
|
||||
KEY `account_id` (`account_id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8;
|
||||
|
||||
|
||||
insert into version (version) values(2023081601);
|
||||
|
||||
commit;
|
@ -31,6 +31,9 @@ define('TN_LAST_RANKING_TIME', 8009);
|
||||
define('TN_MISSION_STAR_SEASON', 8010);
|
||||
define('TN_RANK_STATUS', 8011);
|
||||
define('TN_FIRST_TUPOP_STATUS', 8012);
|
||||
define('TN_TOTAL_KILLS_NUM', 8013);
|
||||
define('TN_TOTAL_STAR_NUM', 8014);
|
||||
define('TN_TOTAL_RANK_NUM', 8015);
|
||||
|
||||
|
||||
define('TN_DAILY_BEGIN', 9001);
|
||||
|
262
webapp/controller/ComputingPowerController.class.php
Normal file
262
webapp/controller/ComputingPowerController.class.php
Normal file
@ -0,0 +1,262 @@
|
||||
<?php
|
||||
require_once('mt/HashRate.php');
|
||||
require_once('mt/HashRateCommon.php');
|
||||
require_once('mt/Item.php');
|
||||
require_once('services/HashRateService.php');
|
||||
require_once('services/AwardService.php');
|
||||
require_once('services/PropertyChgService.php');
|
||||
|
||||
require_once('models/ComputingPower.php');
|
||||
require_once('models/CrystalRecord.php');
|
||||
|
||||
use models\ComputingPower;
|
||||
use models\CrystalRecord;
|
||||
use phpcommon\SqlHelper;
|
||||
class ComputingPowerController extends BaseAuthedController
|
||||
{
|
||||
public function info(){
|
||||
$period_state = -1 ; //-1:算力周期未开始 0:正常周期 1:等待周期 2:维护周期
|
||||
$curr_period = array(
|
||||
// "current_state" => -1, //-1:算力周期未开始 0:正常周期 1:等待周期 2:维护周期
|
||||
"period_begin" => 0,
|
||||
"period_end" => 0,
|
||||
"await_time" => 0,
|
||||
"assignable_cec" => 0,
|
||||
"total_target" => 0,
|
||||
"total_exchange_hash_rate" => 0,
|
||||
"total_hash_rate" => 0,
|
||||
// "refresh_remain_time" => 0,
|
||||
|
||||
);
|
||||
$last_period = array(
|
||||
"period_begin" => 0,
|
||||
"period_end" => 0,
|
||||
"reward" => 0,
|
||||
);
|
||||
$lastMeta = \mt\HashRateCommon::getLastPeriod();
|
||||
$currentMeta = \mt\HashRateCommon::getCurrentPeriod();
|
||||
$nextMeta = \mt\HashRateCommon::getNextPeriod();
|
||||
if (!$currentMeta && $lastMeta){
|
||||
if ($nextMeta){
|
||||
$period_state = 1;
|
||||
// $curr_period['current_state'] = 1;
|
||||
$curr_period['period_begin'] = strtotime($nextMeta['start_time']);
|
||||
$curr_period['period_end'] = strtotime($nextMeta['end_time']);
|
||||
$curr_period['await_time'] = strtotime($nextMeta['start_time']) - myself()->_getNowTime();
|
||||
}else{
|
||||
// $curr_period['current_state'] = 2;
|
||||
$period_state = 2;
|
||||
}
|
||||
}
|
||||
if ($currentMeta){
|
||||
|
||||
$period_state = 0;
|
||||
// $curr_period['current_state'] = 0;
|
||||
$curr_period['period_begin'] = strtotime($currentMeta['start_time']);
|
||||
$curr_period['period_end'] = strtotime($currentMeta['end_time']);
|
||||
$curr_period['assignable_cec'] = $currentMeta['cec_pool'];
|
||||
$curr_period['total_target'] = $currentMeta['target'];
|
||||
|
||||
|
||||
$curr_period['total_exchange_hash_rate'] = ComputingPower::getOwnedBH($currentMeta['id']);
|
||||
$rowDb = ComputingPower::getTotalBH($currentMeta['id']);
|
||||
$curr_period['total_hash_rate'] = ( $rowDb ? $rowDb['total_num'] : 0 ) + $currentMeta['hashrate_add'];
|
||||
// $curr_period['refresh_remain_time'] = $rowDb ? $rowDb['modifytime'] + 3600 - myself()->_getNowTime() : 0;
|
||||
|
||||
}
|
||||
|
||||
if ($lastMeta){
|
||||
$last_period['period_begin'] = strtotime($lastMeta['start_time']);
|
||||
$last_period['period_end'] = strtotime($lastMeta['end_time']);
|
||||
}
|
||||
|
||||
|
||||
$info = array(
|
||||
'period_state' => $period_state,
|
||||
'curr_period' => $curr_period,
|
||||
'last_period' => $last_period,
|
||||
'listing_state' => LISTING_SWITCH,
|
||||
'owned_cec' => 0,
|
||||
);
|
||||
$this->_rspData(array(
|
||||
'info' => $info
|
||||
));
|
||||
}
|
||||
|
||||
public function getCrystalUi(){
|
||||
$crystalList = array();
|
||||
$itemMetas = \mt\Item::getMetaListByType(\mt\Item::CRYSTAL_TYPE);
|
||||
$hashRateService = new \services\HashRateService();
|
||||
foreach ($itemMetas as $meta){
|
||||
$crystalDto = array();
|
||||
$hashRateService->getCrystalDto($meta,$crystalDto);
|
||||
array_push($crystalList,$crystalDto);
|
||||
}
|
||||
$this->_rspData(array(
|
||||
'data' => $crystalList
|
||||
));
|
||||
}
|
||||
|
||||
public function exchangeCrystal(){
|
||||
$itemId = getReqVal('item_id', 0);
|
||||
$itemNum = getReqVal('item_num', 0);
|
||||
$itemMeta = \mt\Item::get($itemId);
|
||||
if (!$itemMeta || $itemMeta['type'] != \mt\Item::CRYSTAL_TYPE || !$itemNum){
|
||||
$this->_rspErr(1, 'param error');
|
||||
return ;
|
||||
}
|
||||
$items = array(
|
||||
array(
|
||||
'item_id' => $itemId,
|
||||
'item_num' => $itemNum,
|
||||
)
|
||||
);
|
||||
$propertyChgService = new services\PropertyChgService();
|
||||
$awardService = new services\AwardService();
|
||||
$this->_addItems($items,$awardService,$propertyChgService);
|
||||
CrystalRecord::addCrystalRecord($itemId,$itemNum);
|
||||
$this->_rspData(array(
|
||||
'award' => $awardService->toDto(),
|
||||
'property_chg' => $propertyChgService->toDto(),
|
||||
));
|
||||
}
|
||||
|
||||
public function getExchangeCrystalRecord(){
|
||||
$crystalRecordList = array();
|
||||
CrystalRecord::getCrystalRecordList(function ($row) use (&$crystalRecordList) {
|
||||
array_push($crystalRecordList,array(
|
||||
'item_id' => $row['item_id'],
|
||||
'item_num' => $row['item_num'],
|
||||
'createtime' => $row['createtime'],
|
||||
));
|
||||
});
|
||||
$this->_rspData(array(
|
||||
'data' => $crystalRecordList,
|
||||
));
|
||||
}
|
||||
|
||||
public function exchangeUplimit(){
|
||||
$currentMeta = \mt\HashRateCommon::getCurrentPeriod();
|
||||
if (!$currentMeta){
|
||||
$this->_rspErr(1, 'kindly await');
|
||||
return ;
|
||||
}
|
||||
$list = ComputingPower::findByPeriod($currentMeta['id']);
|
||||
$this->_rspData(array(
|
||||
'data' => $list,
|
||||
));
|
||||
}
|
||||
|
||||
public function exchangePower(){
|
||||
$num1 = getReqVal('num1', 0);
|
||||
$num2 = getReqVal('num2', 0);
|
||||
$num3 = getReqVal('num3', 0);
|
||||
$num4 = getReqVal('num4', 0);
|
||||
$currentMeta = \mt\HashRateCommon::getCurrentPeriod();
|
||||
if (!$currentMeta){
|
||||
$this->_rspErr(1, 'kindly await');
|
||||
return ;
|
||||
}
|
||||
if (!$num1 && !$num2 && !$num3 && !$num4 ){
|
||||
$this->_rspErr(1, 'exchange none');
|
||||
return ;
|
||||
}
|
||||
$BH = 0 ;
|
||||
$costItems = array();
|
||||
if ($num1 > 0){
|
||||
$meta = \mt\HashRate::findHash(ComputingPower::CRYSTAL1);
|
||||
$this->_verificationCeiling($currentMeta['id'],$meta,$num1,$num2,$num3,$num4);
|
||||
$BH += $num1 * $meta['amount_bh'];
|
||||
array_push($costItems,array(
|
||||
'item_id' => ComputingPower::CRYSTAL1,
|
||||
'item_num' => $num1
|
||||
));
|
||||
}
|
||||
if ($num2 > 0){
|
||||
$meta = \mt\HashRate::findHash(ComputingPower::CRYSTAL2);
|
||||
$this->_verificationCeiling($currentMeta['id'],$meta,$num1,$num2,$num3,$num4);
|
||||
$BH += $num2 * $meta['amount_bh'];
|
||||
array_push($costItems,array(
|
||||
'item_id' => ComputingPower::CRYSTAL2,
|
||||
'item_num' => $num2
|
||||
));
|
||||
}
|
||||
if ($num3 > 0){
|
||||
$meta = \mt\HashRate::findHash(ComputingPower::CRYSTAL3);
|
||||
$this->_verificationCeiling($currentMeta['id'],$meta,$num1,$num2,$num3,$num4);
|
||||
$BH += $num3 * $meta['amount_bh'];
|
||||
array_push($costItems,array(
|
||||
'item_id' => ComputingPower::CRYSTAL3,
|
||||
'item_num' => $num3
|
||||
));
|
||||
}
|
||||
if ($num4 > 0){
|
||||
$meta = \mt\HashRate::findHash(ComputingPower::CRYSTAL4);
|
||||
$this->_verificationCeiling($currentMeta['id'],$meta,$num1,$num2,$num3,$num4);
|
||||
$BH += $num4 * $meta['amount_bh'];
|
||||
array_push($costItems,array(
|
||||
'item_id' => ComputingPower::CRYSTAL4,
|
||||
'item_num' => $num4
|
||||
));
|
||||
}
|
||||
$lackItem = null;
|
||||
if (!$this->_hasEnoughItems($costItems, $lackItem)) {
|
||||
$this->_rspErr(3, $this->_getLackItemErrMsg($lackItem));
|
||||
return;
|
||||
}
|
||||
$this->_decItems($costItems);
|
||||
$propertyChgService = new services\PropertyChgService();
|
||||
$propertyChgService->addBagChg();
|
||||
ComputingPower::addPowerRecord(
|
||||
array(
|
||||
'period' => $currentMeta['id'],
|
||||
'item_num1' => $num1,
|
||||
'item_num2' => $num2,
|
||||
'item_num3' => $num3,
|
||||
'item_num4' => $num4,
|
||||
'total_num' => $BH,
|
||||
)
|
||||
);
|
||||
$this->_rspData(array(
|
||||
'property_chg' => $propertyChgService->toDto(),
|
||||
));
|
||||
|
||||
}
|
||||
|
||||
public function _verificationCeiling($period,$meta,$num1,$num2,$num3,$num4){
|
||||
$list = ComputingPower::findByPeriod($period);
|
||||
switch ($meta['item_id']){
|
||||
case ComputingPower::CRYSTAL1 : {
|
||||
if ($list['num1'] + $num1 > $meta['week_max']){
|
||||
$this->_rspErr(1, 'Micro crystal exchange ceiling');
|
||||
die ;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case ComputingPower::CRYSTAL2 : {
|
||||
if ($list['num2'] + $num2 > $meta['week_max']){
|
||||
$this->_rspErr(1, 'Standard crystal exchange ceiling');
|
||||
die ;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case ComputingPower::CRYSTAL3 : {
|
||||
if ($list['num3'] + $num3 > $meta['week_max']){
|
||||
$this->_rspErr(1, 'Large crystal exchange ceiling');
|
||||
die ;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case ComputingPower::CRYSTAL4 : {
|
||||
if ($list['num4'] + $num4 > $meta['week_max']){
|
||||
$this->_rspErr(1, 'Giant crystal exchange ceiling');
|
||||
die ;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
@ -49,6 +49,9 @@ class GMController extends BaseAuthedController {
|
||||
},
|
||||
'.reset_mission' => function () use($params) {
|
||||
$this->resetMission($params);
|
||||
},
|
||||
'.addtest' => function () use($params) {
|
||||
$this->addDyndata($params);
|
||||
}
|
||||
);
|
||||
$func = getXVal($cmdHash, $cmd);
|
||||
@ -69,6 +72,7 @@ class GMController extends BaseAuthedController {
|
||||
.getsystime //获取服务器时间
|
||||
.setsystime //设置服务器时间,示例:.setsystime 2021-12-08 00:00:00
|
||||
.reset_mission //重置任务
|
||||
.addtest //添加测试数据 1:击杀数 2:星星数 3:升段数
|
||||
END
|
||||
));
|
||||
}
|
||||
@ -182,4 +186,22 @@ END
|
||||
myself()->_rspOk();
|
||||
}
|
||||
|
||||
private function addDyndata($params){
|
||||
$type = getXVal($params, 0, 0);
|
||||
$num = getXVal($params, 1, 0);
|
||||
switch ($type){
|
||||
case 1 : {
|
||||
myself()->_incV(TN_TOTAL_KILLS_NUM,0,$num);
|
||||
}
|
||||
break;
|
||||
case 2 : {
|
||||
myself()->_incV(TN_TOTAL_STAR_NUM,0,$num);
|
||||
}
|
||||
break;
|
||||
case 3 : {
|
||||
myself()->_incV(TN_TOTAL_RANK_NUM,0,$num);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,11 +1,15 @@
|
||||
<?php
|
||||
|
||||
require_once('services/MissionService.php');
|
||||
require_once('mt/RankSeason.php');
|
||||
require_once('mt/HashRateCommon.php');
|
||||
|
||||
require_once('models/Mission.php');
|
||||
require_once('models/Fragment.php');
|
||||
require_once('models/Season.php');
|
||||
require_once('models/SignLog.php');
|
||||
|
||||
use models\SignLog;
|
||||
use phpcommon\SqlHelper;
|
||||
use models\Mission;
|
||||
use models\Fragment;
|
||||
@ -55,4 +59,42 @@ class OtherController extends BaseAuthedController {
|
||||
'data'=>$req
|
||||
));
|
||||
}
|
||||
|
||||
public function getGameModuleState(){
|
||||
//七日签到
|
||||
$signState = 0;
|
||||
$signDb = SignLog::find();
|
||||
if($signDb['days'] >= 7 && $signDb['is_receive'] == 1){
|
||||
$signState = 1;
|
||||
}
|
||||
//排位
|
||||
$rankState = 0;
|
||||
$currSeasonMeta = mt\RankSeason::getCurrentSeason();
|
||||
if($currSeasonMeta){
|
||||
$rankState = 1;
|
||||
|
||||
}
|
||||
$countdown = 0;
|
||||
$nextCurrSeasonMeta = mt\RankSeason::getNextCurrentSeason();
|
||||
if ($nextCurrSeasonMeta){
|
||||
$countdown = strtotime($nextCurrSeasonMeta['start_time']) - myself()->_getNowTime();
|
||||
}
|
||||
//算力
|
||||
$hashRateState = 0;
|
||||
$hashRateMeta = \mt\HashRateCommon::find(1);
|
||||
if (myself()->_getNowTime() > strtotime($hashRateMeta['start_time'])){
|
||||
$hashRateState = 1;
|
||||
}
|
||||
|
||||
$data = array(
|
||||
"firstTopUp" => myself()->_getV(TN_FIRST_TUPOP_STATUS,0),
|
||||
"signDayState" => $signState,
|
||||
"rankState" => $rankState,
|
||||
"nextRankSeasonCountdown" => $countdown,
|
||||
"hashRateState" => $hashRateState,
|
||||
);
|
||||
$this->_rspData(array(
|
||||
'data'=>$data
|
||||
));
|
||||
}
|
||||
}
|
||||
|
95
webapp/models/ComputingPower.php
Normal file
95
webapp/models/ComputingPower.php
Normal file
@ -0,0 +1,95 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace models;
|
||||
|
||||
use mt;
|
||||
use phpcommon\SqlHelper;
|
||||
class ComputingPower extends BaseModel
|
||||
{
|
||||
const CRYSTAL1 = 260001;
|
||||
const CRYSTAL2 = 260002;
|
||||
const CRYSTAL3 = 260003;
|
||||
const CRYSTAL4 = 260004;
|
||||
|
||||
//获取我的算力
|
||||
public static function getOwnedBH($period){
|
||||
$rows = SqlHelper::ormSelect(
|
||||
myself()->_getSelfMysql(),
|
||||
't_power_exchange_record',
|
||||
array(
|
||||
'account_id'=>myself()->_getAccountId(),
|
||||
'period' => $period
|
||||
)
|
||||
);
|
||||
$my_total_num = 0;
|
||||
if ($rows){
|
||||
foreach ($rows as $row){
|
||||
$my_total_num += $row['total_num'];
|
||||
}
|
||||
}
|
||||
return $my_total_num;
|
||||
}
|
||||
|
||||
//获取全服总算力
|
||||
public static function getTotalBH($period){
|
||||
$row = SqlHelper::ormSelectOne(
|
||||
myself()->_getSelfMysql(),
|
||||
't_computing_power_period',
|
||||
array(
|
||||
'period' => $period
|
||||
)
|
||||
);
|
||||
if (!$row){
|
||||
$row = null;
|
||||
}
|
||||
return $row;
|
||||
}
|
||||
|
||||
public static function findByPeriod($period){
|
||||
$rows = SqlHelper::ormSelect(
|
||||
myself()->_getSelfMysql(),
|
||||
't_power_exchange_record',
|
||||
array(
|
||||
'account_id'=>myself()->_getAccountId(),
|
||||
'period' => $period
|
||||
)
|
||||
);
|
||||
$list = array(
|
||||
'num1' => 0,
|
||||
'num2' => 0,
|
||||
'num3' => 0,
|
||||
'num4' => 0,
|
||||
);
|
||||
if ($rows){
|
||||
foreach ($rows as $row){
|
||||
$list['num1'] += $row['item_num1'];
|
||||
$list['num2'] += $row['item_num2'];
|
||||
$list['num3'] += $row['item_num3'];
|
||||
$list['num4'] += $row['item_num4'];
|
||||
}
|
||||
}
|
||||
return $list;
|
||||
}
|
||||
|
||||
public static function addPowerRecord($fieldKv){
|
||||
SqlHelper::insert(
|
||||
myself()->_getSelfMysql(),
|
||||
't_power_exchange_record',
|
||||
array(
|
||||
'account_id'=>myself()->_getAccountId(),
|
||||
'address'=>myself()->_getAddress(),
|
||||
'period'=>$fieldKv['period'],
|
||||
'item_num1'=>$fieldKv['item_num1'],
|
||||
'item_num2' => $fieldKv['item_num2'],
|
||||
'item_num3' => $fieldKv['item_num3'],
|
||||
'item_num4' => $fieldKv['item_num4'],
|
||||
'total_num' => $fieldKv['total_num'],
|
||||
'createtime'=>myself()->_getNowTime(),
|
||||
'modifytime'=>myself()->_getNowTime(),
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
}
|
57
webapp/models/CrystalRecord.php
Normal file
57
webapp/models/CrystalRecord.php
Normal file
@ -0,0 +1,57 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace models;
|
||||
|
||||
use mt;
|
||||
use phpcommon\SqlHelper;
|
||||
class CrystalRecord extends BaseModel
|
||||
{
|
||||
public static function getCrystalRecordList($cb){
|
||||
SqlHelper::ormSelect(
|
||||
myself()->_getSelfMysql(),
|
||||
't_crystal_exchange_record',
|
||||
array(
|
||||
'account_id'=>myself()->_getAccountId()
|
||||
),
|
||||
function ($row) use($cb) {
|
||||
$cb($row);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
public static function getCrystalNum($item_id){
|
||||
$rows = SqlHelper::ormSelect(
|
||||
myself()->_getSelfMysql(),
|
||||
't_crystal_exchange_record',
|
||||
array(
|
||||
'account_id'=>myself()->_getAccountId(),
|
||||
'item_id' => $item_id
|
||||
)
|
||||
);
|
||||
|
||||
$crystalNum = 0;
|
||||
if ($rows){
|
||||
foreach ($rows as $row){
|
||||
$crystalNum += $row['item_num'];
|
||||
}
|
||||
}
|
||||
return $crystalNum;
|
||||
}
|
||||
|
||||
public static function addCrystalRecord($itemId,$itemNum){
|
||||
SqlHelper::insert(
|
||||
myself()->_getSelfMysql(),
|
||||
't_crystal_exchange_record',
|
||||
array(
|
||||
'account_id'=>myself()->_getAccountId(),
|
||||
'address'=>myself()->_getAddress(),
|
||||
'item_id'=>$itemId,
|
||||
'item_num' => $itemNum,
|
||||
'createtime'=>myself()->_getNowTime(),
|
||||
'modifytime'=>myself()->_getNowTime(),
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
}
|
38
webapp/mt/HashRate.php
Normal file
38
webapp/mt/HashRate.php
Normal file
@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
namespace mt;
|
||||
|
||||
use phpcommon;
|
||||
|
||||
class HashRate {
|
||||
public static function find($id){
|
||||
return getXVal(self::getMetaList(), $id, null);
|
||||
}
|
||||
|
||||
public static function findHash($itemId){
|
||||
return getXVal(self::getHashMetaList(), $itemId, null);
|
||||
}
|
||||
|
||||
protected static function getMetaList()
|
||||
{
|
||||
if (!self::$metaList) {
|
||||
self::$metaList = getMetaTable('HashRate@HashRate.php');
|
||||
}
|
||||
return self::$metaList;
|
||||
}
|
||||
|
||||
protected static function getHashMetaList()
|
||||
{
|
||||
if (!self::$hashMetaList) {
|
||||
self::$hashMetaList = array();
|
||||
foreach (self::getMetaList() as $meta) {
|
||||
self::$hashMetaList[$meta['item_id']] = $meta;
|
||||
}
|
||||
}
|
||||
return self::$hashMetaList;
|
||||
}
|
||||
|
||||
protected static $metaList;
|
||||
protected static $hashMetaList;
|
||||
|
||||
}
|
67
webapp/mt/HashRateCommon.php
Normal file
67
webapp/mt/HashRateCommon.php
Normal file
@ -0,0 +1,67 @@
|
||||
<?php
|
||||
|
||||
namespace mt;
|
||||
|
||||
use phpcommon;
|
||||
|
||||
class HashRateCommon {
|
||||
|
||||
public static function find($id){
|
||||
return getXVal(self::getMetaList(), $id, null);
|
||||
}
|
||||
|
||||
public static function getCurrentPeriod()
|
||||
{
|
||||
foreach (self::getMetaList() as $meta) {
|
||||
if (myself()->_getNowTime() >= strtotime($meta['start_time']) &&
|
||||
myself()->_getNowTime() <= strtotime($meta['end_time'])) {
|
||||
return $meta;
|
||||
}
|
||||
}
|
||||
return array();
|
||||
}
|
||||
|
||||
public static function getNextPeriod()
|
||||
{
|
||||
$metaList = self::getMetaList();
|
||||
foreach ($metaList as $key => $meta) {
|
||||
if ($key == 1 && myself()->_getNowTime() <= strtotime($meta['start_time'])) {
|
||||
return $meta;
|
||||
}
|
||||
if ($key > 1 &&
|
||||
myself()->_getNowTime() >= strtotime($metaList[$key-1]['end_time']) &&
|
||||
myself()->_getNowTime() <= strtotime($metaList[$key]['start_time'])) {
|
||||
return $meta;
|
||||
}
|
||||
}
|
||||
return array();
|
||||
}
|
||||
|
||||
public static function getLastPeriod()
|
||||
{
|
||||
$metaList = self::getMetaList();
|
||||
$count = count($metaList);
|
||||
foreach ($metaList as $key => $meta) {
|
||||
if (myself()->_getNowTime() >= strtotime($metaList[$key]['end_time']) &&
|
||||
myself()->_getNowTime() <= strtotime($metaList[$key+1]['start_time'])) {
|
||||
return $meta;
|
||||
}
|
||||
if ($key == $count && myself()->_getNowTime() >= strtotime($meta['end_time'])) {
|
||||
return $meta;
|
||||
}
|
||||
}
|
||||
return array();
|
||||
}
|
||||
|
||||
|
||||
protected static function getMetaList()
|
||||
{
|
||||
if (!self::$metaList) {
|
||||
self::$metaList = getMetaTable('HashRateCommon@HashRateCommon.php');
|
||||
}
|
||||
return self::$metaList;
|
||||
}
|
||||
|
||||
protected static $metaList;
|
||||
|
||||
}
|
@ -28,6 +28,8 @@ class Item {
|
||||
16 降落伞皮肤
|
||||
19 赛季戒指
|
||||
23 随机宝箱
|
||||
24 Gacha
|
||||
26 晶体
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -98,6 +100,7 @@ class Item {
|
||||
const EMOJI_TYPE = 20;
|
||||
const RANDOM_BOX_TYPE = 21;
|
||||
const HONOR_TYPE = 24;
|
||||
const CRYSTAL_TYPE = 26;
|
||||
|
||||
const CHEST_BOX_TYPE = 23;
|
||||
|
||||
@ -263,6 +266,7 @@ class Item {
|
||||
14,
|
||||
self::FRAGMENT_BOX_TYPE,
|
||||
self::CHEST_BOX_TYPE,
|
||||
self::CRYSTAL_TYPE,
|
||||
));
|
||||
}
|
||||
|
||||
|
60
webapp/services/HashRateService.php
Normal file
60
webapp/services/HashRateService.php
Normal file
@ -0,0 +1,60 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace services;
|
||||
require_once('mt/HashRate.php');
|
||||
require_once('models/Bag.php');
|
||||
require_once('models/CrystalRecord.php');
|
||||
|
||||
use models\Bag;
|
||||
use models\CrystalRecord;
|
||||
use mt\HashRate;
|
||||
|
||||
class HashRateService extends BaseService
|
||||
{
|
||||
const NONE_STATE = 0;
|
||||
const RECEIVED_STATE = 1;
|
||||
public function getCrystalDto($crystalMeta,&$crystalDto){
|
||||
$crystalDto = array(
|
||||
'item_id' => $crystalMeta['id'],
|
||||
'pending' => 0,
|
||||
'total' => array(),
|
||||
'claimed' => 0,
|
||||
'state' => self::NONE_STATE,
|
||||
);
|
||||
$hashRateMeta = HashRate::findHash($crystalMeta['id']);
|
||||
switch ($crystalMeta['sub_type']){
|
||||
case 1 : {
|
||||
$killsNum = myself()->_getV(TN_TOTAL_KILLS_NUM,0);
|
||||
$starNum = myself()->_getV(TN_TOTAL_STAR_NUM,0);
|
||||
$rankNum = myself()->_getV(TN_TOTAL_RANK_NUM,0);
|
||||
$crystalDto['total'] = array(
|
||||
'param1' => intval($killsNum),
|
||||
'param2' => intval($starNum),
|
||||
'param3' => intval($rankNum),
|
||||
);
|
||||
$param = explode('|',$hashRateMeta['parameter']);
|
||||
$totalNum = max(0,floor($killsNum/$param[0]) +
|
||||
floor($starNum/$param[1]) + $rankNum);
|
||||
$ownedNum = CrystalRecord::getCrystalNum($crystalMeta['id']);
|
||||
$crystalDto['pending'] = intval(max(0,$totalNum - $ownedNum));
|
||||
$crystalDto['claimed'] = intval($ownedNum);
|
||||
$crystalDto['state'] = $crystalDto['pending'] > 0 ? self::RECEIVED_STATE : self::NONE_STATE;
|
||||
}
|
||||
break;
|
||||
case 2 : {
|
||||
// 游戏内消费总价值
|
||||
}
|
||||
break;
|
||||
case 3 : {
|
||||
// Market交易总价值
|
||||
}
|
||||
break;
|
||||
case 4 : {
|
||||
// 质压总价值
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user