1
This commit is contained in:
parent
ef7b0759c3
commit
a0593a21da
18
doc/Other.py
18
doc/Other.py
@ -11,17 +11,11 @@ class Other(object):
|
||||
'url': 'webapp/index.php?c=Other&a=tag',
|
||||
'params': [
|
||||
_common.ReqHead(),
|
||||
['param', '0', '1:任务 2:碎片'],
|
||||
['types', '', '红点类型(!!!注意由于红点的计算量较大,最好并发分批取红点状态)","分割 1:英雄 2:芯片 3:背包 4:签到 5:算力'],
|
||||
],
|
||||
'response': [
|
||||
_common.RspHead(),
|
||||
['!data', [
|
||||
['mission',0,'任务: 1 提示, 0 不提示'],
|
||||
['piece',[
|
||||
['hero',0,'英雄碎片: 1 提示, 0 不提示'],
|
||||
['gun',0,'枪械碎片: 1 提示, 0 不提示'],
|
||||
],'碎片']
|
||||
], '提示信息'],
|
||||
['!list', [Tag()], '红点列表']
|
||||
]
|
||||
},
|
||||
{
|
||||
@ -77,3 +71,11 @@ class Other(object):
|
||||
]
|
||||
},
|
||||
]
|
||||
|
||||
class Tag(object):
|
||||
|
||||
def __init__(self):
|
||||
self.fields = [
|
||||
['type', 0, '红点类型'],
|
||||
['state', 0, '红点状态 0:无 1:有'],
|
||||
]
|
||||
|
@ -174,6 +174,7 @@ CREATE TABLE `t_hero` (
|
||||
`wealth_attr` mediumblob COMMENT '财富值属性',
|
||||
`seal_type` int(11) NOT NULL DEFAULT '0' COMMENT '0:未封存 1:已封存',
|
||||
`unseal_time` int(11) NOT NULL DEFAULT '0' COMMENT '解开封时间',
|
||||
`is_new` tinyint(4) NOT NULL DEFAULT '0' COMMENT '0:展示红点 1:不用展示 ',
|
||||
|
||||
PRIMARY KEY (`idx`),
|
||||
UNIQUE KEY `token_id` (`token_id`),
|
||||
@ -220,6 +221,7 @@ CREATE TABLE `t_bag` (
|
||||
`rand_attr` mediumblob COMMENT '随机属性',
|
||||
`today_get_gold` bigint NOT NULL DEFAULT '0' COMMENT '金币',
|
||||
`last_get_gold_time` int(11) NOT NULL DEFAULT '0' COMMENT '最后获取金币的时间',
|
||||
`is_new` tinyint(4) NOT NULL DEFAULT '0' COMMENT '0:展示红点 1:不用展示 ',
|
||||
`createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
|
||||
`modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
|
||||
PRIMARY KEY (`idx`),
|
||||
@ -256,8 +258,10 @@ CREATE TABLE `t_chip` (
|
||||
`activate` int(11) NOT NULL DEFAULT '0' COMMENT '是否激活 1:已初始激活',
|
||||
`quality` int(11) NOT NULL DEFAULT '0' COMMENT '品阶',
|
||||
`wealth_attr` mediumblob COMMENT '财富值属性',
|
||||
`is_new` tinyint(4) NOT NULL DEFAULT '0' COMMENT '0:展示红点 1:不用展示 ',
|
||||
`createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
|
||||
`modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
|
||||
|
||||
PRIMARY KEY (`idx`),
|
||||
UNIQUE KEY `token_id` (`token_id`),
|
||||
KEY `item_id` (`item_id`),
|
||||
|
11
sql/gamedb2006_migrate_240423_01.sql
Normal file
11
sql/gamedb2006_migrate_240423_01.sql
Normal file
@ -0,0 +1,11 @@
|
||||
begin;
|
||||
|
||||
alter table t_hero add column `is_new` tinyint(4) NOT NULL DEFAULT '0' COMMENT '0:展示红点 1:不用展示 ';
|
||||
alter table t_chip add column `is_new` tinyint(4) NOT NULL DEFAULT '0' COMMENT '0:展示红点 1:不用展示 ';
|
||||
alter table t_bag add column `is_new` tinyint(4) NOT NULL DEFAULT '0' COMMENT '0:展示红点 1:不用展示 ';
|
||||
|
||||
|
||||
|
||||
insert into version (version) values(2024042301);
|
||||
|
||||
commit;
|
@ -44,6 +44,7 @@ define('TN_TOTAL_DIAMOND_CONSUME', 8016);//钻石消耗
|
||||
define('TN_TOTAL_CEG_CONSUME', 8017);//ceg消耗
|
||||
define('TN_TOTAL_GATHER_GOLD', 8018);//收集金币
|
||||
define('TN_TOTAL_LOOT_TIMES', 8019);//掉落包操作计数 0总计数 1循环计数
|
||||
define('TN_TOTAL_HASH_RATE_REWARD', 8020);
|
||||
|
||||
define('TN_DAILY_BEGIN', 9001);
|
||||
define('TN_DAILY_LOGINS', 9001);
|
||||
|
@ -6,6 +6,7 @@ require_once('mt/HashRateCommon.php');
|
||||
require_once('mt/ActivityRewards.php');
|
||||
require_once('mt/MapMode.php');
|
||||
require_once('mt/ServerTaskTime.php');
|
||||
require_once('mt/AchievementsCycle.php');
|
||||
|
||||
require_once('models/Mission.php');
|
||||
require_once('models/Fragment.php');
|
||||
@ -16,6 +17,7 @@ require_once('models/Staking.php');
|
||||
require_once('models/SeasonRanking.php');
|
||||
require_once('models/RewardsCec.php');
|
||||
require_once('models/GlobalData.php');
|
||||
require_once('models/HashRate.php');
|
||||
|
||||
use models\SignLog;
|
||||
use phpcommon\SqlHelper;
|
||||
@ -27,50 +29,95 @@ use models\Staking;
|
||||
use models\SeasonRanking;
|
||||
use models\RewardsCec;
|
||||
use models\GlobalData;
|
||||
use models\HashRate;
|
||||
|
||||
class OtherController extends BaseAuthedController {
|
||||
const MISSION = 1;
|
||||
const PIECE = 2;
|
||||
const HERO = 1;
|
||||
const CHIP = 2;
|
||||
const BAG = 3;
|
||||
const SIGN = 4;
|
||||
const HASH_RATE = 5;
|
||||
|
||||
public function tag()
|
||||
{
|
||||
$param = getReqVal('param', 0);
|
||||
$req = array(
|
||||
'mission' => 0,
|
||||
'piece' => array(),
|
||||
);
|
||||
switch ($param){
|
||||
case self::MISSION : {
|
||||
$userInfo = $this->_safeGetOrmUserInfo();
|
||||
// $currRankSeasonMeta = mt\RankSeason::getCurrentSeason();
|
||||
// $seasonDb = Season::find($currRankSeasonMeta['id']);
|
||||
$missionService = new services\MissionService();
|
||||
$missionService->init($userInfo, null);;
|
||||
$missionMetaList = mt\Task::getCustomTypeMetaList(1, $missionService);
|
||||
$missionHash = Mission::allToHash();
|
||||
foreach ($missionMetaList as $missionMeta) {
|
||||
$missionDb = getXVal($missionHash, $missionMeta['id'], null);
|
||||
$missionDto = $missionService->getMissionDto('', '', $missionDb, $missionMeta);
|
||||
if ($missionDto['state'] == Mission::RECEIVEABLE_STATE){
|
||||
$req['mission'] = 1;
|
||||
break;
|
||||
$types = getReqVal('types', 0);
|
||||
$typeArr = explode(",",$types);
|
||||
$list = array();
|
||||
foreach ($typeArr as $type){
|
||||
$state = 0;
|
||||
switch ($type){
|
||||
case self::HERO : {
|
||||
$res = myself()->_getSelfMysql()->execQueryOne("SELECT COUNT(idx) as totalNum FROM t_hero WHERE account_id=:account AND is_new=:is_new LIMIT 1",array(
|
||||
'account' => myself()->_getAccountId(),
|
||||
'is_new' => 0,
|
||||
));
|
||||
if ($res['totalNum']){
|
||||
$state = 1;
|
||||
}
|
||||
array_push($list,array(
|
||||
'type' => self::HERO,
|
||||
'state' => $state,
|
||||
));
|
||||
}
|
||||
break;
|
||||
case self::CHIP :{
|
||||
$res = myself()->_getSelfMysql()->execQueryOne("SELECT COUNT(idx) as totalNum FROM t_chip WHERE account_id=:account AND is_new=:is_new LIMIT 1",array(
|
||||
'account' => myself()->_getAccountId(),
|
||||
'is_new' => 0,
|
||||
));
|
||||
if ($res['totalNum']){
|
||||
$state = 1;
|
||||
}
|
||||
array_push($list,array(
|
||||
'type' => self::CHIP,
|
||||
'state' => $state,
|
||||
));
|
||||
}
|
||||
break;
|
||||
case self::BAG :{
|
||||
$res = myself()->_getSelfMysql()->execQueryOne("SELECT COUNT(idx) as totalNum FROM t_bag WHERE account_id=:account AND is_new=:is_new LIMIT 1",array(
|
||||
'account' => myself()->_getAccountId(),
|
||||
'is_new' => 0,
|
||||
));
|
||||
if ($res['totalNum']){
|
||||
$state = 1;
|
||||
}
|
||||
array_push($list,array(
|
||||
'type' => self::BAG,
|
||||
'state' => $state,
|
||||
));
|
||||
}
|
||||
break;
|
||||
case self::SIGN :{
|
||||
$signDb = SignLog::find();
|
||||
if ($signDb && $signDb['is_receive'] == 0){
|
||||
$state = 1;
|
||||
}
|
||||
array_push($list,array(
|
||||
'type' => self::SIGN,
|
||||
'state' => $state,
|
||||
));
|
||||
}
|
||||
break;
|
||||
case self::HASH_RATE :{
|
||||
$currentPeriod= \mt\AchievementsCycle::getCurrentPeriod();
|
||||
if ($currentPeriod){
|
||||
$myHashRate = HashRate::getMyHashRate($currentPeriod['id']);
|
||||
$rewardNum = myself()->_getV(TN_TOTAL_HASH_RATE_REWARD,$currentPeriod['id']);
|
||||
if ($rewardNum>0 && $rewardNum>$myHashRate){
|
||||
$state = 1;
|
||||
}
|
||||
}
|
||||
array_push($list,array(
|
||||
'type' => self::HASH_RATE,
|
||||
'state' => $state,
|
||||
));
|
||||
}
|
||||
}
|
||||
break;
|
||||
case self::PIECE : {
|
||||
$req['piece'] = Fragment::isSatisfy();
|
||||
}
|
||||
break;
|
||||
default:{
|
||||
$req = array(
|
||||
'mission' => 0,
|
||||
'piece' => array(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
$this->_rspData(array(
|
||||
'data'=>$req
|
||||
'list'=>$list
|
||||
));
|
||||
}
|
||||
|
||||
|
@ -182,6 +182,7 @@ class HashRateService extends BaseService
|
||||
'modifytime' => myself()->_getNowTime()
|
||||
);
|
||||
HashRate::add($fieldKv);
|
||||
myself()->_incV(TN_TOTAL_HASH_RATE_REWARD,$currentPeriod['id'], $taskMate['Reward_quantity']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user