Compare commits
No commits in common. "master" and "yd" have entirely different histories.
@ -6,6 +6,6 @@ return array(
|
|||||||
'port' => 3306,
|
'port' => 3306,
|
||||||
'user' => 'root',
|
'user' => 'root',
|
||||||
'passwd' => 'keji178',
|
'passwd' => 'keji178',
|
||||||
'dbname' => 'frienddb_dev_new'
|
'dbname' => 'frienddb_dev_1'
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -1,31 +1,5 @@
|
|||||||
import _common
|
import _common
|
||||||
|
|
||||||
class circuitInfo(object):
|
|
||||||
|
|
||||||
def __init__(self):
|
|
||||||
self.fields = [
|
|
||||||
['start_time', 0, '开始时间'],
|
|
||||||
['end_time', 0, '结束时间'],
|
|
||||||
['ranking', 0, '排名'],
|
|
||||||
['score', 0, '积分'],
|
|
||||||
]
|
|
||||||
|
|
||||||
class rankingInfo(object):
|
|
||||||
|
|
||||||
def __init__(self):
|
|
||||||
self.fields = [
|
|
||||||
['account_id', 0, 'account'],
|
|
||||||
['name', 0, '名字'],
|
|
||||||
['head_id', 0, '头像'],
|
|
||||||
['head_frame', 0, '头像框'],
|
|
||||||
['hero_id', 0, '英雄ItemId'],
|
|
||||||
['skin_id', 0, '皮肤ItemId'],
|
|
||||||
['ranking', 0, '排名'],
|
|
||||||
['score', 0, '积分'],
|
|
||||||
['score_boost', 0, '加成的积分'],
|
|
||||||
['cec', 0, 'cec(个人榜信息才有)'],
|
|
||||||
]
|
|
||||||
|
|
||||||
class AAMarket(object):
|
class AAMarket(object):
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
@ -624,32 +598,4 @@ class AAMarket(object):
|
|||||||
], '开关信息(如果没有则默认为未开启)'],
|
], '开关信息(如果没有则默认为未开启)'],
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
|
||||||
'method': 'GET',
|
|
||||||
'name': '/api/circuit_ranking',
|
|
||||||
'desc': '巡回赛赛季排行',
|
|
||||||
'group': '!AAMarket',
|
|
||||||
'url': 'https://market-test.kingsome.cn/api/circuit_ranking',
|
|
||||||
'params': [
|
|
||||||
['address', '0', 'address'],
|
|
||||||
],
|
|
||||||
'response': [
|
|
||||||
_common.RspHead(),
|
|
||||||
['!rank_list', [rankingInfo()], '榜'],
|
|
||||||
['info', circuitInfo(), '信息'],
|
|
||||||
]
|
|
||||||
},{
|
|
||||||
'name': '/api/circuit_phase_ranking',
|
|
||||||
'desc': '巡回赛周期排行',
|
|
||||||
'group': '!AAMarket',
|
|
||||||
'url': 'https://market-test.kingsome.cn/api/circuit_phase_ranking',
|
|
||||||
'params': [
|
|
||||||
['address', '0', 'address'],
|
|
||||||
],
|
|
||||||
'response': [
|
|
||||||
_common.RspHead(),
|
|
||||||
['!rank_list', [rankingInfo()], '榜'],
|
|
||||||
['info', circuitInfo(), '信息'],
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
]
|
||||||
|
130
doc/AAWheel.py
130
doc/AAWheel.py
@ -1,130 +0,0 @@
|
|||||||
import _common
|
|
||||||
|
|
||||||
class AAWheel(object):
|
|
||||||
|
|
||||||
def __init__(self):
|
|
||||||
self.apis = [
|
|
||||||
{
|
|
||||||
'method': 'POST',
|
|
||||||
'name': '/api/v1/user/login',
|
|
||||||
'desc': '登录',
|
|
||||||
'group': '!AAActivity',
|
|
||||||
'url': 'https://wheel-test.kingsome.cn/api/v1/user/login',
|
|
||||||
'headers': _common.MaybeJwtHeader,
|
|
||||||
'is_json_params': True,
|
|
||||||
'request_params': [
|
|
||||||
],
|
|
||||||
'params': [
|
|
||||||
['token', '', 'token'],
|
|
||||||
],
|
|
||||||
'response': [
|
|
||||||
_common.RspHead(),
|
|
||||||
['info', _common.WheelUser(), '用户名'],
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'method': 'POST',
|
|
||||||
'name': '/api/v1/roll_dice',
|
|
||||||
'desc': '掷骰子',
|
|
||||||
'group': '!AAActivity',
|
|
||||||
'url': 'https://wheel-test.kingsome.cn/api/v1/roll_dice',
|
|
||||||
'headers': _common.JwtHeader,
|
|
||||||
'is_json_params': True,
|
|
||||||
'params': [
|
|
||||||
],
|
|
||||||
'response': [
|
|
||||||
_common.RspHead(),
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'method': 'GET',
|
|
||||||
'name': '/api/v1/friend/list',
|
|
||||||
'desc': '好友列表',
|
|
||||||
'group': '!AAActivity',
|
|
||||||
'url': 'https://wheel-test.kingsome.cn/api/v1/friend/list',
|
|
||||||
'headers': _common.JwtHeader,
|
|
||||||
'params': [
|
|
||||||
],
|
|
||||||
'response': [
|
|
||||||
_common.RspHead(),
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'method': 'GET',
|
|
||||||
'name': '/api/v1/friend/invite',
|
|
||||||
'desc': '好友邀请',
|
|
||||||
'group': '!AAActivity',
|
|
||||||
'url': 'https://wheel-test.kingsome.cn/api/v1/friend/invite',
|
|
||||||
'headers': _common.JwtHeader,
|
|
||||||
'params': [
|
|
||||||
],
|
|
||||||
'response': [
|
|
||||||
_common.RspHead(),
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'method': 'GET',
|
|
||||||
'name': '/api/v1/friend/agree',
|
|
||||||
'desc': '好友邀请',
|
|
||||||
'group': '!AAActivity',
|
|
||||||
'url': 'https://wheel-test.kingsome.cn/api/v1/friend/agree',
|
|
||||||
'headers': _common.JwtHeader,
|
|
||||||
'params': [
|
|
||||||
],
|
|
||||||
'response': [
|
|
||||||
_common.RspHead(),
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'method': 'GET',
|
|
||||||
'name': '/api/v1/mission/list',
|
|
||||||
'desc': '任务列表',
|
|
||||||
'group': '!AAActivity',
|
|
||||||
'url': 'https://wheel-test.kingsome.cn/api/v1/mission/list',
|
|
||||||
'headers': _common.JwtHeader,
|
|
||||||
'params': [
|
|
||||||
],
|
|
||||||
'response': [
|
|
||||||
_common.RspHead(),
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'method': 'GET',
|
|
||||||
'name': '/api/v1/chip/list',
|
|
||||||
'desc': '芯片列表',
|
|
||||||
'group': '!AAActivity',
|
|
||||||
'url': 'https://wheel-test.kingsome.cn/api/v1/chip/list',
|
|
||||||
'headers': _common.JwtHeader,
|
|
||||||
'params': [
|
|
||||||
],
|
|
||||||
'response': [
|
|
||||||
_common.RspHead(),
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'method': 'GET',
|
|
||||||
'name': '/api/v1/item/list',
|
|
||||||
'desc': '道具列表',
|
|
||||||
'group': '!AAActivity',
|
|
||||||
'url': 'https://wheel-test.kingsome.cn/api/v1/item/list',
|
|
||||||
'headers': _common.JwtHeader,
|
|
||||||
'params': [
|
|
||||||
],
|
|
||||||
'response': [
|
|
||||||
_common.RspHead(),
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'method': 'GET',
|
|
||||||
'name': '/api/v1/shop/goods',
|
|
||||||
'desc': '商店-商品列表',
|
|
||||||
'group': '!AAActivity',
|
|
||||||
'url': 'https://wheel-test.kingsome.cn/api/v1/shop/goods',
|
|
||||||
'headers': _common.JwtHeader,
|
|
||||||
'params': [
|
|
||||||
],
|
|
||||||
'response': [
|
|
||||||
_common.RspHead(),
|
|
||||||
]
|
|
||||||
},
|
|
||||||
]
|
|
@ -58,7 +58,6 @@ class Battle(object):
|
|||||||
['rank_score', 0, '排位积分'],
|
['rank_score', 0, '排位积分'],
|
||||||
#['pass_score', 0, '通行证积分'],
|
#['pass_score', 0, '通行证积分'],
|
||||||
['items', 0, '道具id:道具数量|'],
|
['items', 0, '道具id:道具数量|'],
|
||||||
['!battle_items', [_common.BattleItem()], '战斗道具'],
|
|
||||||
],
|
],
|
||||||
'response': [
|
'response': [
|
||||||
_common.RspHead(),
|
_common.RspHead(),
|
||||||
@ -143,8 +142,8 @@ class Battle(object):
|
|||||||
['pve_wave', 0, 'pve波次'],
|
['pve_wave', 0, 'pve波次'],
|
||||||
['pve_max_wave', 0, 'pve最大波次'],
|
['pve_max_wave', 0, 'pve最大波次'],
|
||||||
|
|
||||||
#['!members', _common.TeamReportMember(), '成员数据'],
|
['!members', _common.TeamReportMember(), '成员数据'],
|
||||||
#['!team_list', _common.TeamReportTeam(), '所有队伍成员数据']
|
['!team_list', _common.TeamReportTeam(), '所有队伍成员数据']
|
||||||
],
|
],
|
||||||
'response': [
|
'response': [
|
||||||
_common.RspHead(),
|
_common.RspHead(),
|
||||||
@ -162,7 +161,7 @@ class Battle(object):
|
|||||||
['room_mode', 0, '0:pvp 1:pve 2:moba'],
|
['room_mode', 0, '0:pvp 1:pve 2:moba'],
|
||||||
['map_mode', 0, ''],
|
['map_mode', 0, ''],
|
||||||
['map_id', 0, '地图id'],
|
['map_id', 0, '地图id'],
|
||||||
#['!team_list', [_common.MFRoomReportTeam()], '所有队伍数据']
|
['!team_list', [_common.MFRoomReportTeam()], '所有队伍数据']
|
||||||
],
|
],
|
||||||
'response': [
|
'response': [
|
||||||
_common.RspHead(),
|
_common.RspHead(),
|
||||||
|
@ -31,32 +31,7 @@ class Circuit(object):
|
|||||||
['!rank_list', [rankingInfo()], '榜信息'],
|
['!rank_list', [rankingInfo()], '榜信息'],
|
||||||
['my_rank', rankingInfo(), '个人榜信息'],
|
['my_rank', rankingInfo(), '个人榜信息'],
|
||||||
]
|
]
|
||||||
},{
|
}
|
||||||
'name': 'getCircuitPhaseRanking',
|
|
||||||
'desc': '巡回赛阶段排行',
|
|
||||||
'group': 'Circuit',
|
|
||||||
'url': 'webapp/index.php?c=Circuit&a=getCircuitPhaseRanking',
|
|
||||||
'params': [
|
|
||||||
_common.ReqHead(),
|
|
||||||
],
|
|
||||||
'response': [
|
|
||||||
_common.RspHead(),
|
|
||||||
['!rank_list', [rankingInfo()], '榜信息'],
|
|
||||||
['my_rank', rankingInfo(), '个人榜信息'],
|
|
||||||
]
|
|
||||||
},{
|
|
||||||
'name': 'CircuitTaskList',
|
|
||||||
'desc': '巡回赛任务',
|
|
||||||
'group': 'Circuit',
|
|
||||||
'url': 'webapp/index.php?c=Circuit&a=CircuitTaskList',
|
|
||||||
'params': [
|
|
||||||
_common.ReqHead(),
|
|
||||||
],
|
|
||||||
'response': [
|
|
||||||
_common.RspHead(),
|
|
||||||
['!list', [task()], '任务列表'],
|
|
||||||
]
|
|
||||||
},
|
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
@ -84,15 +59,5 @@ class rankingInfo(object):
|
|||||||
['skin_id', 0, '皮肤ItemId'],
|
['skin_id', 0, '皮肤ItemId'],
|
||||||
['ranking', 0, '排名'],
|
['ranking', 0, '排名'],
|
||||||
['score', 0, '积分'],
|
['score', 0, '积分'],
|
||||||
['score_boost', 0, '加成的积分'],
|
|
||||||
['cec', 0, 'cec(个人榜信息才有)'],
|
['cec', 0, 'cec(个人榜信息才有)'],
|
||||||
]
|
]
|
||||||
|
|
||||||
class task(object):
|
|
||||||
|
|
||||||
def __init__(self):
|
|
||||||
self.fields = [
|
|
||||||
['task_id', 0, '任务id'],
|
|
||||||
['current', 0, '当前进度'],
|
|
||||||
['target', 0, '目标进度'],
|
|
||||||
]
|
|
@ -11,7 +11,7 @@ class Other(object):
|
|||||||
'url': 'webapp/index.php?c=Other&a=tag',
|
'url': 'webapp/index.php?c=Other&a=tag',
|
||||||
'params': [
|
'params': [
|
||||||
_common.ReqHead(),
|
_common.ReqHead(),
|
||||||
['types', '', '红点类型(!!!注意由于红点的计算量较大,最好并发分批取红点状态)","分割 1:英雄 2:芯片 3:背包 4:签到 5:算力 6:皮肤 7:新人任务 8:日周常任务 9:拉新任务'],
|
['types', '', '红点类型(!!!注意由于红点的计算量较大,最好并发分批取红点状态)","分割 1:英雄 2:芯片 3:背包 4:签到 5:算力 6:皮肤 7:新人任务 8:日周常任务'],
|
||||||
],
|
],
|
||||||
'response': [
|
'response': [
|
||||||
_common.RspHead(),
|
_common.RspHead(),
|
||||||
@ -81,7 +81,6 @@ class Other(object):
|
|||||||
_common.RspHead(),
|
_common.RspHead(),
|
||||||
['!mode_list', [
|
['!mode_list', [
|
||||||
['id',0,'mapMode配置id'],
|
['id',0,'mapMode配置id'],
|
||||||
['task_state',0,'巡回赛状态 0:未开 1:已开,id=7(巡回模式)才有'],
|
|
||||||
['stage_state',0,'阶段开始状态 0:未开 1:已开,id=7(巡回模式)才有'],
|
['stage_state',0,'阶段开始状态 0:未开 1:已开,id=7(巡回模式)才有'],
|
||||||
['next_star_time',0,'下个阶段开始时间,id=7(巡回模式)才有'],
|
['next_star_time',0,'下个阶段开始时间,id=7(巡回模式)才有'],
|
||||||
['next_end_time',0,'下个阶段结束时间,id=7(巡回模式)才有'],
|
['next_end_time',0,'下个阶段结束时间,id=7(巡回模式)才有'],
|
||||||
|
@ -5,32 +5,6 @@ class OutAppTools(object):
|
|||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.apis = [
|
self.apis = [
|
||||||
{
|
{
|
||||||
'name': 'getCircuitRanking',
|
|
||||||
'desc': '巡回赛赛季排行',
|
|
||||||
'group': 'OutAppCircuit',
|
|
||||||
'url': 'webapp/index.php?c=OutAppCircuit&a=getCircuitRanking',
|
|
||||||
'params': [
|
|
||||||
['address', '0', 'address'],
|
|
||||||
],
|
|
||||||
'response': [
|
|
||||||
_common.RspHead(),
|
|
||||||
['!rank_list', [rankingInfo()], '榜'],
|
|
||||||
['info', circuitInfo(), '信息'],
|
|
||||||
]
|
|
||||||
},{
|
|
||||||
'name': 'getCircuitPhaseRanking',
|
|
||||||
'desc': '巡回赛周期排行',
|
|
||||||
'group': 'OutAppCircuit',
|
|
||||||
'url': 'webapp/index.php?c=OutAppCircuit&a=getCircuitPhaseRanking',
|
|
||||||
'params': [
|
|
||||||
['address', '0', 'address'],
|
|
||||||
],
|
|
||||||
'response': [
|
|
||||||
_common.RspHead(),
|
|
||||||
['!rank_list', [rankingInfo()], '榜'],
|
|
||||||
['info', circuitInfo(), '信息'],
|
|
||||||
]
|
|
||||||
},{
|
|
||||||
'name': 'getCircuitRewardHistory',
|
'name': 'getCircuitRewardHistory',
|
||||||
'desc': '获取巡回赛奖励记录',
|
'desc': '获取巡回赛奖励记录',
|
||||||
'group': 'OutAppCircuit',
|
'group': 'OutAppCircuit',
|
||||||
@ -42,16 +16,6 @@ class OutAppTools(object):
|
|||||||
_common.RspHead(),
|
_common.RspHead(),
|
||||||
['!data', [rewardInfo()], '奖励信息'],
|
['!data', [rewardInfo()], '奖励信息'],
|
||||||
]
|
]
|
||||||
},{
|
|
||||||
'name': 'circuitSettlement',
|
|
||||||
'desc': '巡回赛结算奖励',
|
|
||||||
'group': 'OutAppCircuit',
|
|
||||||
'url': 'webapp/index.php?c=OutAppCircuit&a=circuitSettlement',
|
|
||||||
'params': [
|
|
||||||
],
|
|
||||||
'response': [
|
|
||||||
_common.RspHead(),
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
|
|
||||||
]
|
]
|
||||||
@ -65,29 +29,3 @@ class rewardInfo(object):
|
|||||||
['end_time', 0, '阶段结束时间'],
|
['end_time', 0, '阶段结束时间'],
|
||||||
['reward', 0, '-1:未结算 0:结算无奖励'],
|
['reward', 0, '-1:未结算 0:结算无奖励'],
|
||||||
]
|
]
|
||||||
|
|
||||||
class circuitInfo(object):
|
|
||||||
|
|
||||||
def __init__(self):
|
|
||||||
self.fields = [
|
|
||||||
['start_time', 0, '开始时间'],
|
|
||||||
['end_time', 0, '结束时间'],
|
|
||||||
['ranking', 0, '排名'],
|
|
||||||
['score', 0, '积分'],
|
|
||||||
]
|
|
||||||
|
|
||||||
class rankingInfo(object):
|
|
||||||
|
|
||||||
def __init__(self):
|
|
||||||
self.fields = [
|
|
||||||
['account_id', 0, 'account'],
|
|
||||||
['name', 0, '名字'],
|
|
||||||
['head_id', 0, '头像'],
|
|
||||||
['head_frame', 0, '头像框'],
|
|
||||||
['hero_id', 0, '英雄ItemId'],
|
|
||||||
['skin_id', 0, '皮肤ItemId'],
|
|
||||||
['ranking', 0, '排名'],
|
|
||||||
['score', 0, '积分'],
|
|
||||||
['score_boost', 0, '加成的积分'],
|
|
||||||
['cec', 0, 'cec(个人榜信息才有)'],
|
|
||||||
]
|
|
13
doc/User.py
13
doc/User.py
@ -221,18 +221,5 @@ class User(object):
|
|||||||
_common.RspHead(),
|
_common.RspHead(),
|
||||||
['info',_common.UserInfo(), '用户信息'],
|
['info',_common.UserInfo(), '用户信息'],
|
||||||
]
|
]
|
||||||
},{
|
|
||||||
'name': 'getUserVip',
|
|
||||||
'desc': '用户VIP',
|
|
||||||
'group': 'User',
|
|
||||||
'url': 'webapp/index.php?c=User&a=getUserVip',
|
|
||||||
'params': [
|
|
||||||
_common.ReqHead(),
|
|
||||||
],
|
|
||||||
'response': [
|
|
||||||
_common.RspHead(),
|
|
||||||
['vip',0, 'vip等级'],
|
|
||||||
['exp',0, 'vip经验'],
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
@ -1032,13 +1032,6 @@ class BattleItemReward(object):
|
|||||||
['item_num', 0, '道具数量'],
|
['item_num', 0, '道具数量'],
|
||||||
]
|
]
|
||||||
|
|
||||||
class BattleItem(object):
|
|
||||||
|
|
||||||
def __init__(self):
|
|
||||||
self.fields = [
|
|
||||||
['item_id', 0, '道具id'],
|
|
||||||
['use_num', 0, '道具使用数量'],
|
|
||||||
]
|
|
||||||
|
|
||||||
class BattleRankScore(object):
|
class BattleRankScore(object):
|
||||||
|
|
||||||
@ -1222,7 +1215,6 @@ class TeamReportMember(object):
|
|||||||
['pve_max_wave', 0, 'pve最大波次'],
|
['pve_max_wave', 0, 'pve最大波次'],
|
||||||
['pve_boss_killed', 0, 'pve副本boss是否被击杀'],
|
['pve_boss_killed', 0, 'pve副本boss是否被击杀'],
|
||||||
['pve_rank_score', 0, 'pve积分'],
|
['pve_rank_score', 0, 'pve积分'],
|
||||||
['!battle_items', [_common.BattleItem()], '战斗道具'],
|
|
||||||
]
|
]
|
||||||
|
|
||||||
class TeamReportTeam(object):
|
class TeamReportTeam(object):
|
||||||
@ -1954,14 +1946,3 @@ class HashRateGoods(object):
|
|||||||
['max_num', 0, '最大数量(-1不限购)'],
|
['max_num', 0, '最大数量(-1不限购)'],
|
||||||
['count_down', 0, '倒计时(单位秒,只有已售罄才有效)'],
|
['count_down', 0, '倒计时(单位秒,只有已售罄才有效)'],
|
||||||
]
|
]
|
||||||
|
|
||||||
class WheelUser(object):
|
|
||||||
|
|
||||||
def __init__(self):
|
|
||||||
self.fields = [
|
|
||||||
['name', '', '用户名'],
|
|
||||||
['avatar', '', '头像'],
|
|
||||||
['score', '', '积分'],
|
|
||||||
['hourly_earnings', 0, '每小时收益'],
|
|
||||||
['dice', 0, '骰子数'],
|
|
||||||
]
|
|
||||||
|
@ -420,10 +420,11 @@ CREATE TABLE `t_vip_user` (
|
|||||||
`escec_balance` varchar(60) NOT NULL DEFAULT '' COMMENT 'esCec balance',
|
`escec_balance` varchar(60) NOT NULL DEFAULT '' COMMENT 'esCec balance',
|
||||||
`escec_stacking` varchar(60) NOT NULL DEFAULT '' COMMENT 'esCec stacking',
|
`escec_stacking` varchar(60) NOT NULL DEFAULT '' COMMENT 'esCec stacking',
|
||||||
`escec_convert` varchar(60) NOT NULL DEFAULT '' COMMENT 'esCec convert',
|
`escec_convert` varchar(60) NOT NULL DEFAULT '' COMMENT 'esCec convert',
|
||||||
|
`escec_total` varchar(60) NOT NULL DEFAULT '' COMMENT 'esCec total',
|
||||||
`stacking_last_src_idx` bigint NOT NULL DEFAULT '0' COMMENT 'stacking_last_src_idx',
|
`stacking_last_src_idx` bigint NOT NULL DEFAULT '0' COMMENT 'stacking_last_src_idx',
|
||||||
`escec_transfer_last_src_idx` bigint NOT NULL DEFAULT '0' COMMENT 'escec_transfer_last_src_idx',
|
`escec_transfer_last_src_idx` bigint NOT NULL DEFAULT '0' COMMENT 'escec_transfer_last_src_idx',
|
||||||
`deposit_convert_last_src_idx` bigint NOT NULL DEFAULT '0' COMMENT 'deposit_convert_last_src_idx',
|
`vester_deposit_last_src_idx` bigint NOT NULL DEFAULT '0' COMMENT 'vester_deposit_last_src_idx',
|
||||||
`last_convert_time` int(11) NOT NULL DEFAULT '0' COMMENT 'last_convert_time',
|
`vester_withdraw_last_src_idx` bigint NOT NULL DEFAULT '0' COMMENT 'vester_withdraw_last_src_idx',
|
||||||
`createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
|
`createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
|
||||||
`modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
|
`modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
|
||||||
PRIMARY KEY (`idx`),
|
PRIMARY KEY (`idx`),
|
||||||
|
@ -2060,27 +2060,6 @@ CREATE TABLE `t_circuit_battle` (
|
|||||||
) ENGINE=InnoDB AUTO_INCREMENT=10000 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
|
) ENGINE=InnoDB AUTO_INCREMENT=10000 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
|
||||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||||
|
|
||||||
|
|
||||||
--
|
|
||||||
-- Table structure for table `t_circuit_battle_phase`
|
|
||||||
--
|
|
||||||
|
|
||||||
DROP TABLE IF EXISTS `t_circuit_battle_phase`;
|
|
||||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
|
||||||
/*!40101 SET character_set_client = utf8 */;
|
|
||||||
CREATE TABLE `t_circuit_battle_phase` (
|
|
||||||
`idx` bigint NOT NULL AUTO_INCREMENT COMMENT '自增id',
|
|
||||||
`account_id` varchar(60) NOT NULL DEFAULT '' COMMENT '账号id(channel + "_" + gameid + "_" + openid)',
|
|
||||||
`season` int(11) NOT NULL DEFAULT '0' COMMENT '赛季',
|
|
||||||
`phase` int(11) NOT NULL DEFAULT '0' COMMENT '阶段',
|
|
||||||
`cumulative_score` int(11) NOT NULL DEFAULT '0' COMMENT '积分',
|
|
||||||
`createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
|
|
||||||
`modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
|
|
||||||
PRIMARY KEY (`idx`),
|
|
||||||
KEY `idx_account_season_phase` (`account_id`, `season`, `phase`)
|
|
||||||
) ENGINE=InnoDB AUTO_INCREMENT=10000 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
|
|
||||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
||||||
|
|
||||||
--
|
--
|
||||||
-- Table structure for table `t_circuit_reward`
|
-- Table structure for table `t_circuit_reward`
|
||||||
--
|
--
|
||||||
@ -2215,7 +2194,7 @@ CREATE TABLE `t_rookie_task_value` (
|
|||||||
) ENGINE=InnoDB AUTO_INCREMENT=10000 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
|
) ENGINE=InnoDB AUTO_INCREMENT=10000 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
|
||||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||||
|
|
||||||
--
|
|
||||||
-- Table structure for table `t_hashrate_shop_buy_record`
|
-- Table structure for table `t_hashrate_shop_buy_record`
|
||||||
--
|
--
|
||||||
|
|
||||||
@ -2240,59 +2219,3 @@ CREATE TABLE `t_hashrate_shop_buy_record` (
|
|||||||
) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
|
) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
|
||||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||||
|
|
||||||
--
|
|
||||||
-- Table structure for table `t_lucky_symbol`
|
|
||||||
--
|
|
||||||
|
|
||||||
DROP TABLE IF EXISTS `t_lucky_symbol`;
|
|
||||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
|
||||||
/*!40101 SET character_set_client = utf8 */;
|
|
||||||
CREATE TABLE `t_lucky_symbol` (
|
|
||||||
`idx` bigint NOT NULL AUTO_INCREMENT COMMENT '自增id',
|
|
||||||
`account_id` varchar(60) NOT NULL DEFAULT '' COMMENT '账号id',
|
|
||||||
`in_use_num` int(11) NOT NULL DEFAULT '0' COMMENT '使用中数量',
|
|
||||||
`createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
|
|
||||||
`modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
|
|
||||||
PRIMARY KEY (`idx`),
|
|
||||||
UNIQUE KEY `account_id` (`account_id`)
|
|
||||||
) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
|
|
||||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
||||||
|
|
||||||
--
|
|
||||||
-- Table structure for table `t_lucky_symbol_record`
|
|
||||||
--
|
|
||||||
|
|
||||||
DROP TABLE IF EXISTS `t_lucky_symbol_record`;
|
|
||||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
|
||||||
/*!40101 SET character_set_client = utf8 */;
|
|
||||||
CREATE TABLE `t_lucky_symbol_record` (
|
|
||||||
`idx` bigint NOT NULL AUTO_INCREMENT COMMENT '自增id',
|
|
||||||
`room_uuid` varchar(60) CHARACTER SET utf8 NOT NULL COMMENT 'room_uuid',
|
|
||||||
`account_id` varchar(60) NOT NULL DEFAULT '' COMMENT '账号id',
|
|
||||||
`createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
|
|
||||||
`modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
|
|
||||||
PRIMARY KEY (`idx`),
|
|
||||||
UNIQUE KEY `uk_room_uuid_account_id` (`room_uuid`, `account_id`)
|
|
||||||
) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
|
|
||||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
||||||
|
|
||||||
--
|
|
||||||
-- Table structure for table `t_circuit_task_value`
|
|
||||||
--
|
|
||||||
|
|
||||||
DROP TABLE IF EXISTS `t_circuit_task_value`;
|
|
||||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
|
||||||
/*!40101 SET character_set_client = utf8 */;
|
|
||||||
CREATE TABLE `t_circuit_task_value` (
|
|
||||||
`idx` bigint NOT NULL AUTO_INCREMENT COMMENT '自增id',
|
|
||||||
`account_id` varchar(60) NOT NULL DEFAULT '' COMMENT '账号id(channel + "_" + gameid + "_" + openid)',
|
|
||||||
`circuit_season` int(11) NOT NULL DEFAULT '0' COMMENT '期',
|
|
||||||
`task_type` int(11) NOT NULL DEFAULT '0' COMMENT '任务id',
|
|
||||||
`value` int(11) NOT NULL DEFAULT '0' COMMENT '任务进度',
|
|
||||||
`createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
|
|
||||||
`modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
|
|
||||||
PRIMARY KEY (`idx`),
|
|
||||||
UNIQUE KEY `account_id_task` (`account_id`, `task_type`)
|
|
||||||
) ENGINE=InnoDB AUTO_INCREMENT=10000 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
|
|
||||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
||||||
|
|
||||||
|
@ -63,50 +63,6 @@ CREATE TABLE `t_hashrate_shop_buy_record` (
|
|||||||
) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
|
) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
|
||||||
|
|
||||||
|
|
||||||
CREATE TABLE `t_circuit_task_value` (
|
|
||||||
`idx` bigint NOT NULL AUTO_INCREMENT COMMENT '自增id',
|
|
||||||
`account_id` varchar(60) NOT NULL DEFAULT '' COMMENT '账号id(channel + "_" + gameid + "_" + openid)',
|
|
||||||
`circuit_season` int(11) NOT NULL DEFAULT '0' COMMENT '期',
|
|
||||||
`task_type` int(11) NOT NULL DEFAULT '0' COMMENT '任务id',
|
|
||||||
`value` int(11) NOT NULL DEFAULT '0' COMMENT '任务进度',
|
|
||||||
`createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
|
|
||||||
`modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
|
|
||||||
PRIMARY KEY (`idx`),
|
|
||||||
UNIQUE KEY `account_id_task` (`account_id`, `task_type`)
|
|
||||||
) ENGINE=InnoDB AUTO_INCREMENT=10000 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
|
|
||||||
|
|
||||||
CREATE TABLE `t_lucky_symbol` (
|
|
||||||
`idx` bigint NOT NULL AUTO_INCREMENT COMMENT '自增id',
|
|
||||||
`account_id` varchar(60) NOT NULL DEFAULT '' COMMENT '账号id',
|
|
||||||
`in_use_num` int(11) NOT NULL DEFAULT '0' COMMENT '使用中数量',
|
|
||||||
`createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
|
|
||||||
`modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
|
|
||||||
PRIMARY KEY (`idx`),
|
|
||||||
UNIQUE KEY `account_id` (`account_id`)
|
|
||||||
) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
|
|
||||||
|
|
||||||
CREATE TABLE `t_lucky_symbol_record` (
|
|
||||||
`idx` bigint NOT NULL AUTO_INCREMENT COMMENT '自增id',
|
|
||||||
`room_uuid` varchar(60) CHARACTER SET utf8 NOT NULL COMMENT 'room_uuid',
|
|
||||||
`account_id` varchar(60) NOT NULL DEFAULT '' COMMENT '账号id',
|
|
||||||
`createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
|
|
||||||
`modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
|
|
||||||
PRIMARY KEY (`idx`),
|
|
||||||
UNIQUE KEY `uk_room_uuid_account_id` (`room_uuid`, `account_id`)
|
|
||||||
) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
|
|
||||||
|
|
||||||
CREATE TABLE `t_circuit_battle_phase` (
|
|
||||||
`idx` bigint NOT NULL AUTO_INCREMENT COMMENT '自增id',
|
|
||||||
`account_id` varchar(60) NOT NULL DEFAULT '' COMMENT '账号id(channel + "_" + gameid + "_" + openid)',
|
|
||||||
`season` int(11) NOT NULL DEFAULT '0' COMMENT '赛季',
|
|
||||||
`phase` int(11) NOT NULL DEFAULT '0' COMMENT '阶段',
|
|
||||||
`cumulative_score` int(11) NOT NULL DEFAULT '0' COMMENT '积分',
|
|
||||||
`createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
|
|
||||||
`modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
|
|
||||||
PRIMARY KEY (`idx`),
|
|
||||||
KEY `idx_account_season_phase` (`account_id`, `season`, `phase`)
|
|
||||||
) ENGINE=InnoDB AUTO_INCREMENT=10000 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
|
|
||||||
|
|
||||||
insert into version (version) values(2024092401);
|
insert into version (version) values(2024092401);
|
||||||
|
|
||||||
commit;
|
commit;
|
@ -15,7 +15,7 @@ require_once('models/User.php');
|
|||||||
require_once('models/RealtimeData.php');
|
require_once('models/RealtimeData.php');
|
||||||
require_once('models/ChipPage.php');
|
require_once('models/ChipPage.php');
|
||||||
require_once('models/Chip.php');
|
require_once('models/Chip.php');
|
||||||
require_once('models/LuckySymbol.php');
|
|
||||||
|
|
||||||
require_once('services/AwardService.php');
|
require_once('services/AwardService.php');
|
||||||
require_once('services/PropertyChgService.php');
|
require_once('services/PropertyChgService.php');
|
||||||
@ -31,7 +31,6 @@ use models\User;
|
|||||||
use models\RealtimeData;
|
use models\RealtimeData;
|
||||||
use models\ChipPage;
|
use models\ChipPage;
|
||||||
use models\Chip;
|
use models\Chip;
|
||||||
use models\LuckySymbol;
|
|
||||||
use services\LogService;
|
use services\LogService;
|
||||||
|
|
||||||
class BagController extends BaseAuthedController {
|
class BagController extends BaseAuthedController {
|
||||||
@ -135,11 +134,6 @@ class BagController extends BaseAuthedController {
|
|||||||
$this->useSealDrug($itemDb, $itemMeta, $itemNum, $param1, $param2, $param3);
|
$this->useSealDrug($itemDb, $itemMeta, $itemNum, $param1, $param2, $param3);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case mt\Item::LUCKY_SYMBOL_SUBTYPE:
|
|
||||||
{
|
|
||||||
$this->useSymbol($itemDb, $itemMeta, $itemNum, $param1, $param2, $param3);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
$this->_rspErr(4, 'The prop function has not been realized yet');
|
$this->_rspErr(4, 'The prop function has not been realized yet');
|
||||||
@ -886,24 +880,4 @@ class BagController extends BaseAuthedController {
|
|||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
private function useSymbol($itemDb, $itemMeta, $itemNum, $param1, $param2, $param3)
|
|
||||||
{
|
|
||||||
if (LuckySymbol::hasLuckySymbol()) {
|
|
||||||
$this->_rspErr(201, "alreay use");
|
|
||||||
return ;
|
|
||||||
}
|
|
||||||
$this->_decItems(array(
|
|
||||||
array(
|
|
||||||
'item_id' => $itemMeta['id'],
|
|
||||||
'item_num' => 1
|
|
||||||
)
|
|
||||||
));
|
|
||||||
LuckySymbol::add();
|
|
||||||
$this->propertyChgService->addBagChg();
|
|
||||||
$this->_rspData(array(
|
|
||||||
'award' => $this->awardService->toDto(),
|
|
||||||
'property_chg' => $this->propertyChgService->toDto(),
|
|
||||||
));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
require_once('services/AddItemsService.php');
|
require_once('services/AddItemsService.php');
|
||||||
require_once('services/LogService.php');
|
require_once('services/LogService.php');
|
||||||
require_once('services/TimingPropService.php');
|
require_once('services/TimingPropService.php');
|
||||||
require_once('services/StakingVipService.php');
|
|
||||||
require_once('mt/Item.php');
|
require_once('mt/Item.php');
|
||||||
|
|
||||||
require_once('models/Bag.php');
|
require_once('models/Bag.php');
|
||||||
@ -938,8 +937,7 @@ class BaseAuthedController extends BaseController {
|
|||||||
|
|
||||||
public function _getVipRightsVal($type)
|
public function _getVipRightsVal($type)
|
||||||
{
|
{
|
||||||
$details = \services\StakingVipService::getDetails(myself()->_getAddress());
|
$vip = User::getVipLv(myself()->_getAddress());
|
||||||
$vip = $details['lv'];
|
|
||||||
return myself()->_callMtStatic('StakingVip', 'getValByLv', $vip, $type);
|
return myself()->_callMtStatic('StakingVip', 'getValByLv', $vip, $type);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -479,17 +479,4 @@ class BaseController {
|
|||||||
}
|
}
|
||||||
return $finalItems;
|
return $finalItems;
|
||||||
}
|
}
|
||||||
|
|
||||||
function arraySort($arr, $keys, $type = 'asc') {
|
|
||||||
$keys_value = $new_array = array();
|
|
||||||
foreach ($arr as $k => $v){
|
|
||||||
$keys_value[$k] = $v[$keys];
|
|
||||||
}
|
|
||||||
$type == 'asc' ? asort($keys_value) : arsort($keys_value);
|
|
||||||
reset($keys_value);
|
|
||||||
foreach ($keys_value as $k => $v) {
|
|
||||||
$new_array[$k] = $arr[$k];
|
|
||||||
}
|
|
||||||
return $new_array;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -966,8 +966,16 @@ class BattleController extends BaseAuthedController {
|
|||||||
$info['match_mode'] = 1;
|
$info['match_mode'] = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (count($member['battle_items']) > 0) {
|
{
|
||||||
$this->getBattleItems($r, $roomUuid, $info, $member);
|
$info['items'] = array();
|
||||||
|
array_push($info['items'], array(
|
||||||
|
'item_id' => 900007,
|
||||||
|
'item_num' => 10,
|
||||||
|
));
|
||||||
|
array_push($info['items'], array(
|
||||||
|
'item_id' => 902101,
|
||||||
|
'item_num' => 10,
|
||||||
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
array_push($teamInfo['members'], $info);
|
array_push($teamInfo['members'], $info);
|
||||||
@ -982,58 +990,6 @@ class BattleController extends BaseAuthedController {
|
|||||||
myself()->_rspData($data);
|
myself()->_rspData($data);
|
||||||
}
|
}
|
||||||
|
|
||||||
private function getBattleItems($r, $roomUuid, &$info, $member)
|
|
||||||
{
|
|
||||||
$data = array();
|
|
||||||
foreach ($member['battle_items'] as $item) {
|
|
||||||
$itemMeta = mt\Item::get($item['item_id']);
|
|
||||||
if ($itemMeta['type'] == mt\Item::FUNC_TYPE &&
|
|
||||||
$itemMeta['sub_type'] == mt\Item::LUCKY_SYMBOL_SUBTYPE) {
|
|
||||||
$luckyRecord = myself()->_callModelStatic('LuckySymbolRecord', 'find', $roomUuid);
|
|
||||||
if (empty($luckyRecord)) {
|
|
||||||
if (myself()->_callModelStatic('LuckySymbol', 'hasLuckySymbol')) {
|
|
||||||
myself()->_callModelStatic('LuckySymbol', 'dec');
|
|
||||||
myself()->_callModelStatic('LuckySymbolRecord', 'add', $roomUuid);
|
|
||||||
array_push($data, array(
|
|
||||||
'item_id' => $item['item_id'],
|
|
||||||
'item_num' => 1,
|
|
||||||
));
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
array_push($data, array(
|
|
||||||
'item_id' => $item['item_id'],
|
|
||||||
'item_num' => 1,
|
|
||||||
));
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
$itemCount = Bag::getItemCount($item['item_id']);
|
|
||||||
array_push($data, array(
|
|
||||||
'item_id' => $item['item_id'],
|
|
||||||
'item_num' => $item['item_num'],
|
|
||||||
));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$info['items'] = $data;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function useBattleItem()
|
|
||||||
{
|
|
||||||
$itemId = getReqVal('item_id', 0);
|
|
||||||
$itemMeta = mt\Item::get($itemId);
|
|
||||||
if (!$itemMeta) {
|
|
||||||
$this->_rspErr(2, 'config error');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
$itemCount = Bag::getItemCount($itemId);
|
|
||||||
if ($itemCount > 0) {
|
|
||||||
Bag::decItem($itemId, 1);
|
|
||||||
}
|
|
||||||
myself()->_rspData(array(
|
|
||||||
'item_id' => $itemId,
|
|
||||||
'item_num' => max(0, $itemCount - 1),
|
|
||||||
));
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getMobaBattleData()
|
public function getMobaBattleData()
|
||||||
{
|
{
|
||||||
$sign = '';
|
$sign = '';
|
||||||
@ -1422,7 +1378,7 @@ class BattleController extends BaseAuthedController {
|
|||||||
'return_time' => myself()->_getNowTime(),
|
'return_time' => myself()->_getNowTime(),
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
services\BattleBoxService::incAlreadyAllocNum($row['phase'],
|
services\BattleBoxService::incAlreadyAllocBoxNum($row['phase'],
|
||||||
$row['createtime'],
|
$row['createtime'],
|
||||||
-max(0, $allocBoxNum - $usedNum));
|
-max(0, $allocBoxNum - $usedNum));
|
||||||
myself()->_rspOk();
|
myself()->_rspOk();
|
||||||
|
@ -3,25 +3,19 @@
|
|||||||
require_once('mt/Parameter.php');
|
require_once('mt/Parameter.php');
|
||||||
require_once('mt/CircuitTime.php');
|
require_once('mt/CircuitTime.php');
|
||||||
require_once('mt/CircuitReward.php');
|
require_once('mt/CircuitReward.php');
|
||||||
require_once('mt/CircuitTask.php');
|
|
||||||
require_once('models/Circuit.php');
|
require_once('models/Circuit.php');
|
||||||
require_once('models/User.php');
|
require_once('models/User.php');
|
||||||
require_once('models/Hero.php');
|
require_once('models/Hero.php');
|
||||||
require_once('models/HeroSkin.php');
|
require_once('models/HeroSkin.php');
|
||||||
require_once('models/CircuitTask.php');
|
|
||||||
require_once('models/UserInvitationCode.php');
|
|
||||||
|
|
||||||
|
|
||||||
use models\Circuit;
|
use models\Circuit;
|
||||||
use models\User;
|
use models\User;
|
||||||
use models\Hero;
|
use models\Hero;
|
||||||
use models\HeroSkin;
|
use models\HeroSkin;
|
||||||
use models\CircuitTask;
|
|
||||||
use models\UserInvitationCode;
|
|
||||||
use phpcommon\SqlHelper;
|
use phpcommon\SqlHelper;
|
||||||
class CircuitController extends BaseAuthedController {
|
class CircuitController extends BaseAuthedController {
|
||||||
private $redis_key_circuit_ranking = 'circuit_ranking';
|
private $redis_key_circuit_ranking = 'circuit_ranking';
|
||||||
private $redis_key_circuit_phase_ranking = 'circuit_phase_ranking';
|
|
||||||
|
|
||||||
public function _handlePre()
|
public function _handlePre()
|
||||||
{
|
{
|
||||||
@ -36,28 +30,6 @@ class CircuitController extends BaseAuthedController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function CircuitTaskList(){
|
|
||||||
$circuitCircuitMeta = mt\CircuitTime::getCurrentCircuit();
|
|
||||||
$nextCircuitMeta = mt\CircuitTime::getNextCircuit();
|
|
||||||
$taskList = array();
|
|
||||||
if (!$circuitCircuitMeta &&
|
|
||||||
$nextCircuitMeta &&
|
|
||||||
myself()->_getNowTime() > strtotime($nextCircuitMeta['task_open_time'])
|
|
||||||
){
|
|
||||||
$metas = \mt\CircuitTask::getListBySeason($nextCircuitMeta['circuit_season']);
|
|
||||||
if (count($metas) > 0){
|
|
||||||
foreach ($metas as $meta){
|
|
||||||
array_push($taskList, array(
|
|
||||||
'task_id' => $meta['id'],
|
|
||||||
'current' => CircuitTask::getCurrentVal($nextCircuitMeta['circuit_season'],$meta['type']),
|
|
||||||
'target' => $meta['target'],
|
|
||||||
));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$this->_rspData(array('list' => $taskList));
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getCurrentStage(){
|
public function getCurrentStage(){
|
||||||
$circuitStageMeta = mt\CircuitTime::getCurrentStage();
|
$circuitStageMeta = mt\CircuitTime::getCurrentStage();
|
||||||
if (!$circuitStageMeta){
|
if (!$circuitStageMeta){
|
||||||
@ -83,9 +55,8 @@ class CircuitController extends BaseAuthedController {
|
|||||||
|
|
||||||
$redis = $this->_getRedis($this->redis_key_circuit_ranking);
|
$redis = $this->_getRedis($this->redis_key_circuit_ranking);
|
||||||
if (! $redis->exists(CIRCUIT_RANKING_KEY.$this->redis_key_circuit_ranking)){
|
if (! $redis->exists(CIRCUIT_RANKING_KEY.$this->redis_key_circuit_ranking)){
|
||||||
$rows = Circuit::getCircuitList($currentCircuitMeta['circuit_season']);
|
$rows = Circuit::getRankingList($currentCircuitMeta['circuit_season']);
|
||||||
$sortRows = myself()->arraySort($rows, 'cumulative_score', 'desc');
|
$list = $this->_extractRankingInfo($rows);
|
||||||
$list = $this->_extractRankingInfo($sortRows);
|
|
||||||
$redis->set(CIRCUIT_RANKING_KEY.$this->redis_key_circuit_ranking , json_encode($list));
|
$redis->set(CIRCUIT_RANKING_KEY.$this->redis_key_circuit_ranking , json_encode($list));
|
||||||
$redis->pexpire(CIRCUIT_RANKING_KEY.$this->redis_key_circuit_ranking , 10*60*1000);
|
$redis->pexpire(CIRCUIT_RANKING_KEY.$this->redis_key_circuit_ranking , 10*60*1000);
|
||||||
}else{
|
}else{
|
||||||
@ -98,44 +69,16 @@ class CircuitController extends BaseAuthedController {
|
|||||||
'my_rank' => $myRankedInfo,
|
'my_rank' => $myRankedInfo,
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
public function getCircuitPhaseRanking(){
|
|
||||||
$currentCircuitMeta = mt\CircuitTime::getCurrentCircuit();
|
|
||||||
if (!$currentCircuitMeta){
|
|
||||||
$this->_rspErr(1, 'current stage Have not yet started');
|
|
||||||
return ;
|
|
||||||
}
|
|
||||||
$currentStageMeta = mt\CircuitTime::getCurrentStage();
|
|
||||||
if (!$currentStageMeta){
|
|
||||||
$currentStageMeta = mt\CircuitTime::getPrevStage();
|
|
||||||
}
|
|
||||||
$redis = $this->_getRedis($this->redis_key_circuit_phase_ranking);
|
|
||||||
if (! $redis->exists(CIRCUIT_RANKING_KEY.$this->redis_key_circuit_phase_ranking)){
|
|
||||||
$rows = Circuit::getCircuitPhaseList($currentStageMeta['circuit_season'],$currentStageMeta['circuit_phase']);
|
|
||||||
$sortRows = myself()->arraySort($rows, 'cumulative_score', 'desc');
|
|
||||||
$list = $this->_extractRankingInfo($sortRows);
|
|
||||||
$redis->set(CIRCUIT_RANKING_KEY.$this->redis_key_circuit_phase_ranking , json_encode($list));
|
|
||||||
$redis->pexpire(CIRCUIT_RANKING_KEY.$this->redis_key_circuit_phase_ranking , 10*60*1000);
|
|
||||||
}else{
|
|
||||||
$listStr = $redis->get(CIRCUIT_RANKING_KEY.$this->redis_key_circuit_phase_ranking);
|
|
||||||
$list = emptyReplace(json_decode($listStr, true), array());
|
|
||||||
}
|
|
||||||
$myRankedInfo = $this->_celMyRankingInfo($list);
|
|
||||||
$this->_rspData(array(
|
|
||||||
'rank_list' => $list,
|
|
||||||
'my_rank' => $myRankedInfo,
|
|
||||||
));
|
|
||||||
}
|
|
||||||
|
|
||||||
private function _extractRankingInfo($data){
|
private function _extractRankingInfo($data){
|
||||||
$rankingList = array();
|
$rankingList = array();
|
||||||
$ranking = 0;
|
|
||||||
foreach ($data as $k=>$row){
|
foreach ($data as $k=>$row){
|
||||||
++$ranking;
|
|
||||||
$userDb = User::find($row['account_id']);
|
$userDb = User::find($row['account_id']);
|
||||||
$heroDb = Hero::findByAccountId($userDb['account_id'],$userDb['hero_id']);
|
$heroDb = Hero::findByAccountId($userDb['account_id'],$userDb['hero_id']);
|
||||||
$skinDb = HeroSkin::find($heroDb['skin_id']);
|
$skinDb = HeroSkin::find($heroDb['skin_id']);
|
||||||
$heroId = $heroDb ? $heroDb['hero_id']:0;
|
$heroId = $heroDb ? $heroDb['hero_id']:0;
|
||||||
$skinId = $skinDb ? $skinDb['skin_id']:0;
|
$skinId = $skinDb ? $skinDb['skin_id']:0;
|
||||||
|
$ranking = $k+1;
|
||||||
$rewardWeight = \mt\CircuitReward::getRewardWeight($ranking);
|
$rewardWeight = \mt\CircuitReward::getRewardWeight($ranking);
|
||||||
if ($userDb){
|
if ($userDb){
|
||||||
$info = array(
|
$info = array(
|
||||||
@ -148,7 +91,6 @@ class CircuitController extends BaseAuthedController {
|
|||||||
'ranking' => $ranking,
|
'ranking' => $ranking,
|
||||||
'weight' => $rewardWeight,
|
'weight' => $rewardWeight,
|
||||||
'score' => $row['cumulative_score'],
|
'score' => $row['cumulative_score'],
|
||||||
'score_boost' => $row['score_boost'],
|
|
||||||
);
|
);
|
||||||
array_push($rankingList,$info);
|
array_push($rankingList,$info);
|
||||||
}
|
}
|
||||||
@ -158,20 +100,14 @@ class CircuitController extends BaseAuthedController {
|
|||||||
|
|
||||||
private function _celMyRankingInfo($list){
|
private function _celMyRankingInfo($list){
|
||||||
$currentCircuitMeta = mt\CircuitTime::getCurrentCircuit();
|
$currentCircuitMeta = mt\CircuitTime::getCurrentCircuit();
|
||||||
$score = Circuit::getMyScore($currentCircuitMeta['circuit_season']);
|
|
||||||
$userDb = User::find(myself()->_getAccountId());
|
$userDb = User::find(myself()->_getAccountId());
|
||||||
$codeDb = UserInvitationCode::findMyCode();
|
|
||||||
$count = UserInvitationCode::getMyCodeBindCount($codeDb['invitation_code']);
|
|
||||||
$boost = min($count * 3 / 100,60 / 100);
|
|
||||||
$boostScore = $score * $boost;
|
|
||||||
$myRankedInfo = array(
|
$myRankedInfo = array(
|
||||||
'ranking' => 0,
|
'ranking' => 0,
|
||||||
'account_id' => $userDb['account_id'],
|
'account_id' => $userDb['account_id'],
|
||||||
'name' => $userDb['name'],
|
'name' => $userDb['name'],
|
||||||
'head_id' => $userDb['head_id'],
|
'head_id' => $userDb['head_id'],
|
||||||
'head_frame' => $userDb['head_frame'],
|
'head_frame' => $userDb['head_frame'],
|
||||||
'score' => $score + $boostScore,
|
'score' => Circuit::getMyScore($currentCircuitMeta['circuit_season']),
|
||||||
'score_boost' => $boostScore,
|
|
||||||
'cec' => 0,
|
'cec' => 0,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -6,7 +6,6 @@ require_once('mt/AchievementsPower.php');
|
|||||||
require_once('mt/AchievementsCycle.php');
|
require_once('mt/AchievementsCycle.php');
|
||||||
require_once('mt/Parameter.php');
|
require_once('mt/Parameter.php');
|
||||||
require_once('mt/RookieTask.php');
|
require_once('mt/RookieTask.php');
|
||||||
require_once('mt/CircuitTask.php');
|
|
||||||
require_once('models/HashRate.php');
|
require_once('models/HashRate.php');
|
||||||
|
|
||||||
use models\HashRate;
|
use models\HashRate;
|
||||||
@ -140,7 +139,6 @@ class HashRateController extends BaseAuthedController
|
|||||||
myself()->_callModelStatic('RookieTask','incTaskVal',mt\RookieTask::HASH_RATE_DRAW_REWARD_TIMES_COND,1);
|
myself()->_callModelStatic('RookieTask','incTaskVal',mt\RookieTask::HASH_RATE_DRAW_REWARD_TIMES_COND,1);
|
||||||
}else{
|
}else{
|
||||||
myself()->_callModelStatic('RookieTask','incTaskVal',mt\RookieTask::HASH_TASK_COMMIT_TIMES_COND,1);
|
myself()->_callModelStatic('RookieTask','incTaskVal',mt\RookieTask::HASH_TASK_COMMIT_TIMES_COND,1);
|
||||||
myself()->_callModelStatic('CircuitTask','incTaskVal',mt\CircuitTask::COMPLETE_HASH_TASK_END,1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
myself()->_callModelStatic('RookieTask','incTaskVal',mt\RookieTask::TOTAL_HASH_RATE_VALUE_COND,$rewardNum);
|
myself()->_callModelStatic('RookieTask','incTaskVal',mt\RookieTask::TOTAL_HASH_RATE_VALUE_COND,$rewardNum);
|
||||||
|
@ -28,9 +28,7 @@ require_once('models/Hero.php');
|
|||||||
require_once('models/HeroSkin.php');
|
require_once('models/HeroSkin.php');
|
||||||
require_once('models/Chip.php');
|
require_once('models/Chip.php');
|
||||||
require_once('models/Bag.php');
|
require_once('models/Bag.php');
|
||||||
require_once('models/CircuitTask.php');
|
|
||||||
|
|
||||||
use models\CircuitTask;
|
|
||||||
use models\SignLog;
|
use models\SignLog;
|
||||||
use phpcommon\SqlHelper;
|
use phpcommon\SqlHelper;
|
||||||
use models\RankingSetRecord;
|
use models\RankingSetRecord;
|
||||||
@ -53,7 +51,6 @@ class OtherController extends BaseAuthedController {
|
|||||||
const HERO_SKIN = 6;
|
const HERO_SKIN = 6;
|
||||||
const ROOKIE_TASK = 7;
|
const ROOKIE_TASK = 7;
|
||||||
const DAILY_TASK = 8;
|
const DAILY_TASK = 8;
|
||||||
const INVITE_NEW_TASK = 9;
|
|
||||||
|
|
||||||
public function tag()
|
public function tag()
|
||||||
{
|
{
|
||||||
@ -163,7 +160,7 @@ class OtherController extends BaseAuthedController {
|
|||||||
$missionService = new services\MissionService();
|
$missionService = new services\MissionService();
|
||||||
$userInfo = $this->_safeGetOrmUserInfo();
|
$userInfo = $this->_safeGetOrmUserInfo();
|
||||||
$missionService->init($userInfo, null);
|
$missionService->init($userInfo, null);
|
||||||
if ($missionService->_isHaveRedTag(0)){
|
if ($missionService->_isHaveRedTag()){
|
||||||
$state = 1;
|
$state = 1;
|
||||||
}
|
}
|
||||||
array_push($list,array(
|
array_push($list,array(
|
||||||
@ -171,17 +168,6 @@ class OtherController extends BaseAuthedController {
|
|||||||
'state' => $state,
|
'state' => $state,
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
case self::INVITE_NEW_TASK :{
|
|
||||||
$missionService = new services\MissionService();
|
|
||||||
if ($missionService->_isHaveRedTag(1)){
|
|
||||||
$state = 1;
|
|
||||||
}
|
|
||||||
array_push($list,array(
|
|
||||||
'type' => self::INVITE_NEW_TASK,
|
|
||||||
'state' => $state,
|
|
||||||
));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -428,15 +414,6 @@ class OtherController extends BaseAuthedController {
|
|||||||
$temp['next_star_time'] = strtotime($nextStageMeta['start_time']);
|
$temp['next_star_time'] = strtotime($nextStageMeta['start_time']);
|
||||||
$temp['next_end_time'] = strtotime($nextStageMeta['end_time']);
|
$temp['next_end_time'] = strtotime($nextStageMeta['end_time']);
|
||||||
}
|
}
|
||||||
if (myself()->_switchIsOpen('circuitTask')){
|
|
||||||
if (CircuitTask::_verifyCondition($circuitTimeMeta['circuit_season'])){
|
|
||||||
$temp['task_state'] = 1;
|
|
||||||
}else{
|
|
||||||
$temp['task_state'] = 0;
|
|
||||||
}
|
|
||||||
}else{
|
|
||||||
$temp['task_state'] = 1;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -10,113 +10,12 @@ require_once('mt/CircuitReward.php');
|
|||||||
require_once('models/CircuitReward.php');
|
require_once('models/CircuitReward.php');
|
||||||
require_once('models/Circuit.php');
|
require_once('models/Circuit.php');
|
||||||
require_once('models/User.php');
|
require_once('models/User.php');
|
||||||
require_once('models/Hero.php');
|
|
||||||
require_once('models/HeroSkin.php');
|
|
||||||
|
|
||||||
use services\ServerSwitchService;
|
use services\ServerSwitchService;
|
||||||
use models\CircuitReward;
|
use models\CircuitReward;
|
||||||
use models\Circuit;
|
use models\Circuit;
|
||||||
use models\User;
|
use models\User;
|
||||||
use models\Hero;
|
|
||||||
use models\HeroSkin;
|
|
||||||
class OutAppCircuitController extends BaseController {
|
class OutAppCircuitController extends BaseController {
|
||||||
private $redis_key_circuit_ranking = 'circuit_ranking';
|
|
||||||
private $redis_key_circuit_phase_ranking = 'circuit_phase_ranking';
|
|
||||||
|
|
||||||
public function getCircuitRanking(){
|
|
||||||
$currentCircuitMeta = mt\CircuitTime::getCurrentCircuit();
|
|
||||||
if (!$currentCircuitMeta){
|
|
||||||
$this->_rspErr(1, 'current stage Have not yet started');
|
|
||||||
return ;
|
|
||||||
}
|
|
||||||
$address = getReqVal('address', '');
|
|
||||||
if (empty($address)){
|
|
||||||
if (SERVER_ENV == _ONLINE) {
|
|
||||||
myself()->_rspErr(1, 'param error');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$user = User::findByAddress($address);
|
|
||||||
if (SERVER_ENV != _ONLINE) {
|
|
||||||
$user = User::find('2_2006_I75DCdyQRllgGRYvT0wcGtPR9gbDUZws');
|
|
||||||
}
|
|
||||||
if (!$user){
|
|
||||||
myself()->_rspErr(1, 'user not found');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
$redis = $this->_getRedis($this->redis_key_circuit_ranking);
|
|
||||||
if (! $redis->exists(CIRCUIT_RANKING_KEY.$this->redis_key_circuit_ranking)){
|
|
||||||
$rows = Circuit::getCircuitList($currentCircuitMeta['circuit_season']);
|
|
||||||
$sortRows = myself()->arraySort($rows, 'cumulative_score', 'desc');
|
|
||||||
$list = $this->_extractRankingInfo($sortRows);
|
|
||||||
$redis->set(CIRCUIT_RANKING_KEY.$this->redis_key_circuit_ranking , json_encode($list));
|
|
||||||
$redis->pexpire(CIRCUIT_RANKING_KEY.$this->redis_key_circuit_ranking , 10*60*1000);
|
|
||||||
}else{
|
|
||||||
$listStr = $redis->get(CIRCUIT_RANKING_KEY.$this->redis_key_circuit_ranking);
|
|
||||||
$list = emptyReplace(json_decode($listStr, true), array());
|
|
||||||
}
|
|
||||||
$myInfo = $this->_celMyRankingInfo($list,$user['account_id']);
|
|
||||||
$info = array(
|
|
||||||
'star_time' => strtotime($currentCircuitMeta['start_time']),
|
|
||||||
'end_time' => strtotime($currentCircuitMeta['end_time']),
|
|
||||||
'ranking' => $myInfo['ranking'],
|
|
||||||
'score' => $myInfo['score'],
|
|
||||||
);
|
|
||||||
$this->_rspData(array(
|
|
||||||
'rank_list' => $list,
|
|
||||||
'info' => $info,
|
|
||||||
));
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getCircuitPhaseRanking(){
|
|
||||||
$currentCircuitMeta = mt\CircuitTime::getCurrentCircuit();
|
|
||||||
if (!$currentCircuitMeta){
|
|
||||||
$this->_rspErr(1, 'current stage Have not yet started');
|
|
||||||
return ;
|
|
||||||
}
|
|
||||||
$address = getReqVal('address', '');
|
|
||||||
if (empty($address)){
|
|
||||||
if (SERVER_ENV == _ONLINE) {
|
|
||||||
myself()->_rspErr(1, 'param error');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$user = User::findByAddress($address);
|
|
||||||
if (SERVER_ENV != _ONLINE) {
|
|
||||||
$user = User::find('2_2006_I75DCdyQRllgGRYvT0wcGtPR9gbDUZws');
|
|
||||||
}
|
|
||||||
if (!$user){
|
|
||||||
myself()->_rspErr(1, 'user not found');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
$currentStageMeta = mt\CircuitTime::getCurrentStage();
|
|
||||||
if (!$currentStageMeta){
|
|
||||||
$currentStageMeta = mt\CircuitTime::getPrevStage();
|
|
||||||
}
|
|
||||||
$redis = $this->_getRedis($this->redis_key_circuit_phase_ranking);
|
|
||||||
if (! $redis->exists(CIRCUIT_RANKING_KEY.$this->redis_key_circuit_phase_ranking)){
|
|
||||||
$rows = Circuit::getCircuitPhaseList($currentStageMeta['circuit_season'],$currentStageMeta['circuit_phase']);
|
|
||||||
$sortRows = myself()->arraySort($rows, 'cumulative_score', 'desc');
|
|
||||||
$list = $this->_extractRankingInfo($sortRows);
|
|
||||||
$redis->set(CIRCUIT_RANKING_KEY.$this->redis_key_circuit_phase_ranking , json_encode($list));
|
|
||||||
$redis->pexpire(CIRCUIT_RANKING_KEY.$this->redis_key_circuit_phase_ranking , 10*60*1000);
|
|
||||||
}else{
|
|
||||||
$listStr = $redis->get(CIRCUIT_RANKING_KEY.$this->redis_key_circuit_phase_ranking);
|
|
||||||
$list = emptyReplace(json_decode($listStr, true), array());
|
|
||||||
}
|
|
||||||
$myInfo = $this->_celMyRankingInfo($list,$user['account_id']);
|
|
||||||
$info = array(
|
|
||||||
'star_time' => strtotime($currentStageMeta['start_time']),
|
|
||||||
'end_time' => strtotime($currentStageMeta['end_time']),
|
|
||||||
'ranking' => $myInfo['ranking'],
|
|
||||||
'score' => $myInfo['score'],
|
|
||||||
);
|
|
||||||
$this->_rspData(array(
|
|
||||||
'rank_list' => $list,
|
|
||||||
'info' => $info,
|
|
||||||
));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public function getCircuitRewardHistory(){
|
public function getCircuitRewardHistory(){
|
||||||
$address = getReqVal('address', '');
|
$address = getReqVal('address', '');
|
||||||
@ -154,17 +53,13 @@ class OutAppCircuitController extends BaseController {
|
|||||||
$currentStageMeta = \mt\CircuitTime::getCurrentStage();
|
$currentStageMeta = \mt\CircuitTime::getCurrentStage();
|
||||||
$prevStageMeta = \mt\CircuitTime::getPrevStage();
|
$prevStageMeta = \mt\CircuitTime::getPrevStage();
|
||||||
|
|
||||||
if (!$currentStageMeta &&
|
if (!$currentStageMeta && $prevStageMeta && !CircuitReward::_verifySettlement($prevStageMeta['circuit_season'],$prevStageMeta['circuit_phase'])){
|
||||||
$prevStageMeta &&
|
$rows = Circuit::getRankingList($prevStageMeta['circuit_season']);
|
||||||
$prevStageMeta['is_reward'] > 0 &&
|
if (count($rows) > 0){
|
||||||
!CircuitReward::_verifySettlement($prevStageMeta['circuit_season'],$prevStageMeta['circuit_phase'])){
|
|
||||||
$rows = Circuit::getCircuitList($prevStageMeta['circuit_season']);
|
|
||||||
$sortRows = myself()->arraySort($rows, 'cumulative_score', 'desc');
|
|
||||||
if (count($sortRows) > 0){
|
|
||||||
$totalWeight = 0;
|
$totalWeight = 0;
|
||||||
$rate = \mt\Parameter::getVal('circuit_reward_rate','');
|
$rate = \mt\Parameter::getVal('circuit_reward_rate','');
|
||||||
$count = floor(count($sortRows) * $rate) ;
|
$count = floor(count($rows) * $rate) ;
|
||||||
foreach ($sortRows as $k=>$value){
|
foreach ($rows as $k=>$value){
|
||||||
$ranking = $k+1;
|
$ranking = $k+1;
|
||||||
$rewardWeight = \mt\CircuitReward::getRewardWeight($ranking);
|
$rewardWeight = \mt\CircuitReward::getRewardWeight($ranking);
|
||||||
if ($ranking <= $count){
|
if ($ranking <= $count){
|
||||||
@ -172,7 +67,7 @@ class OutAppCircuitController extends BaseController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
$cecPool = $prevStageMeta['cec_pool'];
|
$cecPool = $prevStageMeta['cec_pool'];
|
||||||
foreach ($sortRows as $k=>$value){
|
foreach ($rows as $k=>$value){
|
||||||
$cec = 0;
|
$cec = 0;
|
||||||
$ranking = $k+1;
|
$ranking = $k+1;
|
||||||
$rewardWeight = \mt\CircuitReward::getRewardWeight($ranking);
|
$rewardWeight = \mt\CircuitReward::getRewardWeight($ranking);
|
||||||
@ -196,50 +91,4 @@ class OutAppCircuitController extends BaseController {
|
|||||||
$this->_rspErr(1,'未满足结算条件');
|
$this->_rspErr(1,'未满足结算条件');
|
||||||
}
|
}
|
||||||
|
|
||||||
private function _extractRankingInfo($data){
|
|
||||||
$rankingList = array();
|
|
||||||
$ranking = 0;
|
|
||||||
foreach ($data as $k=>$row){
|
|
||||||
++$ranking;
|
|
||||||
$userDb = User::find($row['account_id']);
|
|
||||||
$heroDb = Hero::findByAccountId($userDb['account_id'],$userDb['hero_id']);
|
|
||||||
$skinDb = HeroSkin::findByAccountId($heroDb['skin_id'], $userDb['account_id']);
|
|
||||||
$heroId = $heroDb ? $heroDb['hero_id']:0;
|
|
||||||
$skinId = $skinDb ? $skinDb['skin_id']:0;
|
|
||||||
$rewardWeight = \mt\CircuitReward::getRewardWeight($ranking);
|
|
||||||
if ($userDb){
|
|
||||||
$info = array(
|
|
||||||
'account_id' => $userDb['account_id'],
|
|
||||||
'name' => utf8_encode($userDb['name']),
|
|
||||||
'head_id' => $userDb['head_id'],
|
|
||||||
'head_frame' => $userDb['head_frame'],
|
|
||||||
'hero_id' => $heroId,
|
|
||||||
'skin_id' => $skinId,
|
|
||||||
'ranking' => $ranking,
|
|
||||||
'weight' => $rewardWeight,
|
|
||||||
'score' => $row['cumulative_score'],
|
|
||||||
'score_boost' => number_format($row['score_boost'], 2, '.', ''),
|
|
||||||
);
|
|
||||||
array_push($rankingList,$info);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return $rankingList;
|
|
||||||
}
|
|
||||||
|
|
||||||
private function _celMyRankingInfo($list,$account){
|
|
||||||
$myRankedInfo = array(
|
|
||||||
'ranking' => 0,
|
|
||||||
'score' => 0,
|
|
||||||
);
|
|
||||||
if (count($list) > 0){
|
|
||||||
foreach ($list as $value){
|
|
||||||
if ($value['account_id'] == $account){
|
|
||||||
$myRankedInfo['ranking'] = $value['ranking'];
|
|
||||||
$myRankedInfo['score'] = $value['score'];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return $myRankedInfo;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,6 @@ require_once('models/SignLog.php');
|
|||||||
require_once('models/UserHonor.php');
|
require_once('models/UserHonor.php');
|
||||||
require_once('models/GlobalData.php');
|
require_once('models/GlobalData.php');
|
||||||
require_once('models/HeroPreset.php');
|
require_once('models/HeroPreset.php');
|
||||||
require_once('models/CircuitTask.php');
|
|
||||||
|
|
||||||
|
|
||||||
require_once('mt/Parameter.php');
|
require_once('mt/Parameter.php');
|
||||||
@ -20,7 +19,6 @@ require_once('mt/Item.php');
|
|||||||
require_once('mt/Map.php');
|
require_once('mt/Map.php');
|
||||||
require_once('mt/MapMode.php');
|
require_once('mt/MapMode.php');
|
||||||
require_once('mt/EconomyAttribute.php');
|
require_once('mt/EconomyAttribute.php');
|
||||||
require_once('mt/CircuitTask.php');
|
|
||||||
|
|
||||||
require_once('services/AwardService.php');
|
require_once('services/AwardService.php');
|
||||||
require_once('services/PropertyChgService.php');
|
require_once('services/PropertyChgService.php');
|
||||||
@ -29,7 +27,6 @@ require_once('services/NameService.php');
|
|||||||
require_once('services/ChipPageService.php');
|
require_once('services/ChipPageService.php');
|
||||||
require_once('services/LogService.php');
|
require_once('services/LogService.php');
|
||||||
require_once('services/NftService.php');
|
require_once('services/NftService.php');
|
||||||
require_once('services/StakingVipService.php');
|
|
||||||
|
|
||||||
use phpcommon\SqlHelper;
|
use phpcommon\SqlHelper;
|
||||||
use models\User;
|
use models\User;
|
||||||
@ -39,7 +36,6 @@ use models\SignLog;
|
|||||||
use models\UserHonor;
|
use models\UserHonor;
|
||||||
use models\GlobalData;
|
use models\GlobalData;
|
||||||
use models\HeroPreset;
|
use models\HeroPreset;
|
||||||
use models\CircuitTask;
|
|
||||||
use services\LogService;
|
use services\LogService;
|
||||||
|
|
||||||
class UserController extends BaseAuthedController {
|
class UserController extends BaseAuthedController {
|
||||||
@ -377,7 +373,11 @@ class UserController extends BaseAuthedController {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$userInfo = User::Info($userDb);
|
$userInfo = User::Info($userDb);
|
||||||
$this->fillBattleUserInfo($userInfo);
|
{
|
||||||
|
$userInfo['total_lucky'] = Hero::getAccountLuckyTemp();
|
||||||
|
$userInfo['admission_item_num'] = myself()->_getItemCount(900006, $userInfo);
|
||||||
|
$userInfo['circuit_score'] = myself()->_callModelStatic('Circuit', 'getCurrentMyScore');
|
||||||
|
}
|
||||||
$heroDb = Hero::findByAccountId(myself()->_getAccountId(), $userInfo['hero_uniid']);
|
$heroDb = Hero::findByAccountId(myself()->_getAccountId(), $userInfo['hero_uniid']);
|
||||||
if (!$heroDb) {
|
if (!$heroDb) {
|
||||||
$this->_rspErr(1, 'Hero does not exist');
|
$this->_rspErr(1, 'Hero does not exist');
|
||||||
@ -412,7 +412,11 @@ class UserController extends BaseAuthedController {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$userInfo = User::Info($userDb);
|
$userInfo = User::Info($userDb);
|
||||||
$this->fillBattleUserInfo($userInfo);
|
{
|
||||||
|
$userInfo['total_lucky'] = Hero::getAccountLuckyTemp();
|
||||||
|
$userInfo['admission_item_num'] = myself()->_getItemCount(900006, $userInfo);
|
||||||
|
$userInfo['circuit_score'] = myself()->_callModelStatic('Circuit', 'getCurrentMyScore');
|
||||||
|
}
|
||||||
$heroDb = Hero::findByAccountId(myself()->_getAccountId(), $userInfo['hero_uniid']);
|
$heroDb = Hero::findByAccountId(myself()->_getAccountId(), $userInfo['hero_uniid']);
|
||||||
if (!$heroDb) {
|
if (!$heroDb) {
|
||||||
$this->_rspErr(1, 'Hero does not exist');
|
$this->_rspErr(1, 'Hero does not exist');
|
||||||
@ -448,7 +452,11 @@ class UserController extends BaseAuthedController {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$userInfo = User::Info($userDb);
|
$userInfo = User::Info($userDb);
|
||||||
$this->fillBattleUserInfo($userInfo);
|
{
|
||||||
|
$userInfo['total_lucky'] = Hero::getAccountLuckyTemp();
|
||||||
|
$userInfo['admission_item_num'] = myself()->_getItemCount(900006, $userInfo);
|
||||||
|
$userInfo['circuit_score'] = myself()->_callModelStatic('Circuit', 'getCurrentMyScore');
|
||||||
|
}
|
||||||
$heroDb = Hero::findByAccountId(myself()->_getAccountId(), $heroUniId);
|
$heroDb = Hero::findByAccountId(myself()->_getAccountId(), $heroUniId);
|
||||||
if (!$heroDb) {
|
if (!$heroDb) {
|
||||||
$this->_rspErr(1, 'Hero does not exist');
|
$this->_rspErr(1, 'Hero does not exist');
|
||||||
@ -487,26 +495,11 @@ class UserController extends BaseAuthedController {
|
|||||||
)
|
)
|
||||||
)) {
|
)) {
|
||||||
$itemNum = myself()->_callModelStatic('Bag', 'getItemCount', $itemId);
|
$itemNum = myself()->_callModelStatic('Bag', 'getItemCount', $itemId);
|
||||||
$hasLuckySymbol = myself()->_callModelStatic('LuckySymbol', 'hasLuckySymbol');
|
|
||||||
if ($itemMeta['type'] == mt\Item::FUNC_TYPE &&
|
|
||||||
$itemMeta['sub_type'] == mt\Item::LUCKY_SYMBOL_SUBTYPE &&
|
|
||||||
!$hasLuckySymbol) {
|
|
||||||
$this->_decItems(array(
|
|
||||||
array(
|
|
||||||
'item_id' => $itemMeta['id'],
|
|
||||||
'item_num' => 1
|
|
||||||
)
|
|
||||||
));
|
|
||||||
myself()->_callModelStatic('LuckySymbol', 'add');
|
|
||||||
$hasLuckySymbol = 1;
|
|
||||||
}
|
|
||||||
myself()->_rspData(array(
|
myself()->_rspData(array(
|
||||||
'item_id' => $itemId,
|
'item_id' => $itemId,
|
||||||
'item_num' => $itemNum,
|
'item_num' => $itemNum,
|
||||||
'item_type' => $itemMeta['type'],
|
'item_type' => $itemMeta['type'],
|
||||||
'item_sub_type' => $itemMeta['sub_type'],
|
'item_sub_type' => $itemMeta['sub_type']
|
||||||
'has_lucky_symbol' => $hasLuckySymbol,
|
|
||||||
'total_lucky' => Hero::getAccountLuckyTemp(),
|
|
||||||
));
|
));
|
||||||
} else {
|
} else {
|
||||||
myself()->_rspErr(1, 'item_id not found');
|
myself()->_rspErr(1, 'item_id not found');
|
||||||
@ -1126,9 +1119,6 @@ class UserController extends BaseAuthedController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private function _sign(){
|
private function _sign(){
|
||||||
if (CircuitTask::_verifyLoginToday()){
|
|
||||||
myself()->_callModelStatic('CircuitTask','incTaskVal',mt\CircuitTask::LOGIN_TIMES_END,1);
|
|
||||||
}
|
|
||||||
//用户是否有签到记录
|
//用户是否有签到记录
|
||||||
if (SignLog::isSignRecord()){
|
if (SignLog::isSignRecord()){
|
||||||
//有签到记录
|
//有签到记录
|
||||||
@ -1162,35 +1152,7 @@ class UserController extends BaseAuthedController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getUserVip(){
|
public function getMyVip(){
|
||||||
|
|
||||||
$details = \services\StakingVipService::getDetails(myself()->_getAddress());
|
|
||||||
$this->_rspData(
|
|
||||||
array(
|
|
||||||
'vip' => $details['lv'],
|
|
||||||
'exp' => $details['cur'],
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
private function fillBattleUserInfo(&$userInfo)
|
|
||||||
{
|
|
||||||
$userInfo['total_lucky'] = Hero::getAccountLuckyTemp();
|
|
||||||
$userInfo['admission_item_num'] = myself()->_getItemCount(900006, $userInfo);
|
|
||||||
$userInfo['circuit_score'] = myself()->_callModelStatic('Circuit', 'getCurrentMyScore');
|
|
||||||
$userInfo['has_lucky_symbol'] = myself()->_callModelStatic('LuckySymbol', 'hasLuckySymbol');
|
|
||||||
$userInfo['has_vip_lucky'] = myself()->_getVipRightsVal(
|
|
||||||
myself()->_getMtConstant('StakingVip', 'ACCOUNT_LUCKY_INC')
|
|
||||||
);
|
|
||||||
{
|
|
||||||
$userInfo['vip_lv'] = 0;
|
|
||||||
$userInfo['vip_exp'] = 0;
|
|
||||||
$vipInfo = myself()->_callServiceStatic('StakingVipService', 'getDetails', $userInfo['address']);
|
|
||||||
if ($vipInfo) {
|
|
||||||
$userInfo['vip_lv'] = $vipInfo['lv'];
|
|
||||||
$userInfo['vip_exp'] = $vipInfo['cur'];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
@ -3,12 +3,8 @@
|
|||||||
|
|
||||||
namespace models;
|
namespace models;
|
||||||
|
|
||||||
require_once('models/UserInvitationCode.php');
|
|
||||||
|
|
||||||
use mt;
|
use mt;
|
||||||
use phpcommon\SqlHelper;
|
use phpcommon\SqlHelper;
|
||||||
use models\UserInvitationCode;
|
|
||||||
|
|
||||||
class Circuit extends BaseModel
|
class Circuit extends BaseModel
|
||||||
{
|
{
|
||||||
public static function updateScore($season,$score){
|
public static function updateScore($season,$score){
|
||||||
@ -33,30 +29,6 @@ class Circuit extends BaseModel
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function updatePhaseScore($season,$phase,$score){
|
|
||||||
SqlHelper::upsert(
|
|
||||||
myself()->_getSelfMysql(),
|
|
||||||
't_circuit_battle_phase',
|
|
||||||
array(
|
|
||||||
'account_id' => myself()->_getAccountId(),
|
|
||||||
'season' => $season,
|
|
||||||
'phase' => $phase,
|
|
||||||
),
|
|
||||||
array(
|
|
||||||
'cumulative_score' => $score,
|
|
||||||
'modifytime' => myself()->_getNowTime()
|
|
||||||
),
|
|
||||||
array(
|
|
||||||
'account_id' => myself()->_getAccountId(),
|
|
||||||
'season' => $season,
|
|
||||||
'phase' => $phase,
|
|
||||||
'cumulative_score' => $score,
|
|
||||||
'createtime' => myself()->_getNowTime(),
|
|
||||||
'modifytime' => myself()->_getNowTime()
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function getMyScore($season){
|
public static function getMyScore($season){
|
||||||
$row = SqlHelper::ormSelectOne(
|
$row = SqlHelper::ormSelectOne(
|
||||||
myself()->_getSelfMysql(),
|
myself()->_getSelfMysql(),
|
||||||
@ -69,24 +41,11 @@ class Circuit extends BaseModel
|
|||||||
return $row ? $row['cumulative_score'] : 0;
|
return $row ? $row['cumulative_score'] : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getMyPhaseScore($season,$phase){
|
|
||||||
$row = SqlHelper::ormSelectOne(
|
|
||||||
myself()->_getSelfMysql(),
|
|
||||||
't_circuit_battle_phase',
|
|
||||||
array(
|
|
||||||
'account_id' => myself()->_getAccountId(),
|
|
||||||
'season' => $season,
|
|
||||||
'phase' => $phase,
|
|
||||||
)
|
|
||||||
);
|
|
||||||
return $row ? $row['cumulative_score'] : 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public static function getRankingList($season){
|
public static function getRankingList($season){
|
||||||
$sql = "select * from t_circuit_battle where season=:season order by cumulative_score desc,modifytime asc";
|
$sql = "select * from t_circuit_battle where season=:season order by cumulative_score desc,modifytime asc";
|
||||||
$whereKv = array(
|
$whereKv = array(
|
||||||
":season" => $season,
|
"season" => $season,
|
||||||
);
|
);
|
||||||
$rows = myself()->_getMysql('')->execQuery($sql,$whereKv);
|
$rows = myself()->_getMysql('')->execQuery($sql,$whereKv);
|
||||||
if (!$rows){
|
if (!$rows){
|
||||||
@ -95,58 +54,6 @@ class Circuit extends BaseModel
|
|||||||
return $rows;
|
return $rows;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getCircuitList($season){
|
|
||||||
$rows = SqlHelper::ormSelect(
|
|
||||||
myself()->_getMysql(''),
|
|
||||||
't_circuit_battle',
|
|
||||||
array(
|
|
||||||
'season' => $season
|
|
||||||
)
|
|
||||||
);
|
|
||||||
foreach ($rows as &$row){
|
|
||||||
$codeDb = UserInvitationCode::findCodeByAccount($row['account_id']);
|
|
||||||
$count = UserInvitationCode::getMyCodeBindCount($codeDb['invitation_code']);
|
|
||||||
$boost = min($count * 3 / 100,60 / 100);
|
|
||||||
$boostScore = $row['cumulative_score'] * $boost;
|
|
||||||
$row['score_boost'] = $boostScore;
|
|
||||||
$row['cumulative_score'] += $boostScore;
|
|
||||||
}
|
|
||||||
return $rows;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function getPhaseRankingList($season,$phase){
|
|
||||||
$sql = "select * from t_circuit_battle_phase where season=:season and phase=:phase order by cumulative_score desc,modifytime asc";
|
|
||||||
$whereKv = array(
|
|
||||||
":season" => $season,
|
|
||||||
":phase" => $phase,
|
|
||||||
);
|
|
||||||
$rows = myself()->_getMysql('')->execQuery($sql,$whereKv);
|
|
||||||
if (!$rows){
|
|
||||||
$rows = array();
|
|
||||||
}
|
|
||||||
return $rows;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function getCircuitPhaseList($season,$phase){
|
|
||||||
$rows = SqlHelper::ormSelect(
|
|
||||||
myself()->_getMysql(''),
|
|
||||||
't_circuit_battle_phase',
|
|
||||||
array(
|
|
||||||
'season' => $season,
|
|
||||||
'phase' => $phase,
|
|
||||||
)
|
|
||||||
);
|
|
||||||
foreach ($rows as &$row){
|
|
||||||
$codeDb = UserInvitationCode::findCodeByAccount($row['account_id']);
|
|
||||||
$count = UserInvitationCode::getMyCodeBindCount($codeDb['invitation_code']);
|
|
||||||
$boost = min($count * 3 / 100,60 / 100);
|
|
||||||
$boostScore = $row['cumulative_score'] * $boost;
|
|
||||||
$row['score_boost'] = $boostScore;
|
|
||||||
$row['cumulative_score'] += $boostScore;
|
|
||||||
}
|
|
||||||
return $rows;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public static function getCurrentMyScore(){
|
public static function getCurrentMyScore(){
|
||||||
$circuitMeta = myself()->_callMtStatic('CircuitTime', 'getCurrentCircuit');
|
$circuitMeta = myself()->_callMtStatic('CircuitTime', 'getCurrentCircuit');
|
||||||
|
@ -1,100 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
|
|
||||||
namespace models;
|
|
||||||
require_once('mt/CircuitTime.php');
|
|
||||||
|
|
||||||
use mt;
|
|
||||||
use phpcommon\SqlHelper;
|
|
||||||
class CircuitTask extends BaseModel
|
|
||||||
{
|
|
||||||
|
|
||||||
public static function _verifyCondition($season){
|
|
||||||
$metas = mt\CircuitTask::getListBySeason($season);
|
|
||||||
foreach ($metas as $meta){
|
|
||||||
$current = self::getCurrentVal($season,$meta['type']);
|
|
||||||
if ($current < $meta['target']){
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function _verifyLoginToday(){
|
|
||||||
$circuitCircuitMeta = mt\CircuitTime::getCurrentCircuit();
|
|
||||||
$nextCircuitMeta = mt\CircuitTime::getNextCircuit();
|
|
||||||
if ($circuitCircuitMeta || !$nextCircuitMeta){
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (myself()->_getNowTime() < strtotime($nextCircuitMeta['task_open_time'])){
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
$season = $nextCircuitMeta['circuit_season'];
|
|
||||||
$row = SqlHelper::ormSelectOne(
|
|
||||||
myself()->_getSelfMysql(),
|
|
||||||
't_circuit_task_value',
|
|
||||||
array(
|
|
||||||
'account_id' => myself()->_getAccountId(),
|
|
||||||
'circuit_season' => $season,
|
|
||||||
'task_type' => mt\CircuitTask::LOGIN_TIMES_END,
|
|
||||||
)
|
|
||||||
);
|
|
||||||
if ($row){
|
|
||||||
if (myself()->_getDaySeconds($row['modifytime']) >= myself()->_getNowDaySeconds()){
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function incTaskVal($taskType,$value){
|
|
||||||
|
|
||||||
$circuitCircuitMeta = mt\CircuitTime::getCurrentCircuit();
|
|
||||||
$nextCircuitMeta = mt\CircuitTime::getNextCircuit();
|
|
||||||
if ($circuitCircuitMeta || !$nextCircuitMeta){
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (myself()->_getNowTime() < strtotime($nextCircuitMeta['task_open_time'])){
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
$season = $nextCircuitMeta['circuit_season'];
|
|
||||||
SqlHelper::upsert(
|
|
||||||
myself()->_getSelfMysql(),
|
|
||||||
't_circuit_task_value',
|
|
||||||
array(
|
|
||||||
'account_id' => myself()->_getAccountId(),
|
|
||||||
'circuit_season' => $season,
|
|
||||||
'task_type' => $taskType,
|
|
||||||
),
|
|
||||||
array(
|
|
||||||
'value' => function () use ($value){
|
|
||||||
return "value + ${value}";
|
|
||||||
},
|
|
||||||
'modifytime' => myself()->_getNowTime(),
|
|
||||||
),
|
|
||||||
array(
|
|
||||||
'account_id' => myself()->_getAccountId(),
|
|
||||||
'circuit_season' => $season,
|
|
||||||
'task_type' => $taskType,
|
|
||||||
'value' => $value,
|
|
||||||
'createtime' => myself()->_getNowTime(),
|
|
||||||
'modifytime' => myself()->_getNowTime(),
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function getCurrentVal($season,$taskType){
|
|
||||||
$row = SqlHelper::ormSelectOne(
|
|
||||||
myself()->_getSelfMysql(),
|
|
||||||
't_circuit_task_value',
|
|
||||||
array(
|
|
||||||
'account_id' => myself()->_getAccountId(),
|
|
||||||
'circuit_season' => $season,
|
|
||||||
'task_type' => $taskType,
|
|
||||||
)
|
|
||||||
);
|
|
||||||
return $row ? $row['value'] : 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
@ -1040,7 +1040,6 @@ class Hero extends BaseModel {
|
|||||||
if ($rightVal > 0){
|
if ($rightVal > 0){
|
||||||
$lucky += $rightVal;
|
$lucky += $rightVal;
|
||||||
}
|
}
|
||||||
$lucky += myself()->_callModelStatic('LuckySymbol', 'getLuckyInc');
|
|
||||||
return $lucky;
|
return $lucky;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -48,7 +48,7 @@ class HeroSkin extends BaseModel {
|
|||||||
public static function find($uniid)
|
public static function find($uniid)
|
||||||
{
|
{
|
||||||
$row = SqlHelper::ormSelectOne(
|
$row = SqlHelper::ormSelectOne(
|
||||||
myself()->_getMysql(''),
|
myself()->_getSelfMysql(),
|
||||||
't_hero_skin',
|
't_hero_skin',
|
||||||
array(
|
array(
|
||||||
'idx' => $uniid,
|
'idx' => $uniid,
|
||||||
@ -75,7 +75,7 @@ class HeroSkin extends BaseModel {
|
|||||||
public static function findByAccountId($accountId, $uniid)
|
public static function findByAccountId($accountId, $uniid)
|
||||||
{
|
{
|
||||||
$row = SqlHelper::ormSelectOne(
|
$row = SqlHelper::ormSelectOne(
|
||||||
myself()->_getMysql(''),
|
myself()->_getSelfMysql(),
|
||||||
't_hero_skin',
|
't_hero_skin',
|
||||||
array(
|
array(
|
||||||
'idx' => $uniid,
|
'idx' => $uniid,
|
||||||
|
@ -1,82 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace models;
|
|
||||||
|
|
||||||
use mt;
|
|
||||||
use phpcommon\SqlHelper;
|
|
||||||
|
|
||||||
class LuckySymbol extends BaseModel {
|
|
||||||
|
|
||||||
public static function hasLuckySymbol()
|
|
||||||
{
|
|
||||||
$row = SqlHelper::ormSelectOne(
|
|
||||||
myself()->_getSelfMysql(),
|
|
||||||
't_lucky_symbol',
|
|
||||||
array(
|
|
||||||
'account_id' => myself()->_getAccountId(),
|
|
||||||
)
|
|
||||||
);
|
|
||||||
$has = empty($row) ? false : $row['in_use_num'] > 0;
|
|
||||||
return $has ? 1 : 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function dec()
|
|
||||||
{
|
|
||||||
SqlHelper::update
|
|
||||||
(myself()->_getSelfMysql(),
|
|
||||||
't_lucky_symbol',
|
|
||||||
array(
|
|
||||||
'account_id' => myself()->_getAccountId(),
|
|
||||||
),
|
|
||||||
array(
|
|
||||||
'in_use_num' => 0,
|
|
||||||
'modifytime' => myself()->_getNowTime(),
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function add()
|
|
||||||
{
|
|
||||||
SqlHelper::upsert
|
|
||||||
(myself()->_getSelfMysql(),
|
|
||||||
't_lucky_symbol',
|
|
||||||
array(
|
|
||||||
'account_id' => myself()->_getAccountId(),
|
|
||||||
),
|
|
||||||
array(
|
|
||||||
'in_use_num' => function () { return "in_use_num + 1";},
|
|
||||||
'modifytime' => myself()->_getNowTime(),
|
|
||||||
),
|
|
||||||
array(
|
|
||||||
'account_id' => myself()->_getAccountId(),
|
|
||||||
'in_use_num' => 1,
|
|
||||||
'createtime' => myself()->_getNowTime(),
|
|
||||||
'modifytime' => myself()->_getNowTime(),
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function getLuckyInc()
|
|
||||||
{
|
|
||||||
$val = 0;
|
|
||||||
if (self::hasLuckySymbol()) {
|
|
||||||
$itemMeta = myself()->_callMtStatic('Item', 'getLuckySymbolMeta');
|
|
||||||
if ($itemMeta) {
|
|
||||||
$potionMeta = myself()->_callMtStatic('BattlePotion', 'find', $itemMeta['id']);
|
|
||||||
if ($potionMeta) {
|
|
||||||
$effectStrs = explode('|', $potionMeta['effect']);
|
|
||||||
if (count($effectStrs) > 0) {
|
|
||||||
$effectStrs2 = explode(':', $effectStrs[0]);
|
|
||||||
if (count($effectStrs2) >= 2) {
|
|
||||||
if ($effectStrs2[0] == 54) {
|
|
||||||
$val += $effectStrs2[1];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return $val;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@ -1,43 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace models;
|
|
||||||
|
|
||||||
use mt;
|
|
||||||
use phpcommon\SqlHelper;
|
|
||||||
|
|
||||||
class LuckySymbolRecord extends BaseModel {
|
|
||||||
|
|
||||||
public static function find($roomUuid)
|
|
||||||
{
|
|
||||||
$row = SqlHelper::ormSelectOne(
|
|
||||||
myself()->_getSelfMysql(),
|
|
||||||
't_lucky_symbol_record',
|
|
||||||
array(
|
|
||||||
'account_id' => myself()->_getAccountId(),
|
|
||||||
'room_uuid' => $roomUuid,
|
|
||||||
)
|
|
||||||
);
|
|
||||||
return $row;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function add($roomUuid)
|
|
||||||
{
|
|
||||||
SqlHelper::upsert
|
|
||||||
(myself()->_getSelfMysql(),
|
|
||||||
't_lucky_symbol_record',
|
|
||||||
array(
|
|
||||||
'account_id' => myself()->_getAccountId(),
|
|
||||||
'room_uuid' => $roomUuid,
|
|
||||||
),
|
|
||||||
array(
|
|
||||||
),
|
|
||||||
array(
|
|
||||||
'account_id' => myself()->_getAccountId(),
|
|
||||||
'room_uuid' => $roomUuid,
|
|
||||||
'createtime' => myself()->_getNowTime(),
|
|
||||||
'modifytime' => myself()->_getNowTime(),
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@ -71,6 +71,16 @@ class User extends BaseModel {
|
|||||||
return $rows ? $rows : null;
|
return $rows ? $rows : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function getVipLv($address){
|
||||||
|
$row = SqlHelper::ormSelectOne(
|
||||||
|
myself()->_getMarketMysql(''),
|
||||||
|
't_staking_cec',
|
||||||
|
array(
|
||||||
|
'account_address' => $address
|
||||||
|
)
|
||||||
|
);
|
||||||
|
return $row ? $row['vip_lv'] : 0;
|
||||||
|
}
|
||||||
|
|
||||||
public static function show($row)
|
public static function show($row)
|
||||||
{
|
{
|
||||||
@ -131,6 +141,7 @@ class User extends BaseModel {
|
|||||||
'honor_info' => $honorInfo,
|
'honor_info' => $honorInfo,
|
||||||
'account_lucky' => $lucky,
|
'account_lucky' => $lucky,
|
||||||
'chest_rate' => $rate,
|
'chest_rate' => $rate,
|
||||||
|
'vip_lv' => self::getVipLv($row['address']),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -196,6 +207,7 @@ class User extends BaseModel {
|
|||||||
'last_login_time' => $row['last_login_time'],
|
'last_login_time' => $row['last_login_time'],
|
||||||
'account_lucky' => $lucky,
|
'account_lucky' => $lucky,
|
||||||
'chest_rate' => $rate,
|
'chest_rate' => $rate,
|
||||||
|
'vip_lv' => self::getVipLv($row['address']),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -18,21 +18,9 @@ class UserInvitationCode extends BaseModel
|
|||||||
return $row;
|
return $row;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function findCodeByAccount($account){
|
|
||||||
$row = SqlHelper::ormSelectOne(
|
|
||||||
myself()->_getMysql(''),
|
|
||||||
't_user_invitation_code',
|
|
||||||
array(
|
|
||||||
'account_id' => $account,
|
|
||||||
)
|
|
||||||
);
|
|
||||||
return $row;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function generateCode(){
|
public static function generateCode(){
|
||||||
$user = myself()->_getOrmUserInfo();
|
|
||||||
SqlHelper::upsert(
|
SqlHelper::upsert(
|
||||||
myself()->_getMysql(''),
|
myself()->_getSelfMysql(),
|
||||||
't_user_invitation_code',
|
't_user_invitation_code',
|
||||||
array(
|
array(
|
||||||
'account_id' => myself()->_getAccountId(),
|
'account_id' => myself()->_getAccountId(),
|
||||||
@ -42,7 +30,7 @@ class UserInvitationCode extends BaseModel
|
|||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
'account_id' => myself()->_getAccountId(),
|
'account_id' => myself()->_getAccountId(),
|
||||||
'invitation_code' =>$user['idx'],
|
'invitation_code' =>rand(100000,999999),
|
||||||
'createtime' =>myself()->_getNowTime(),
|
'createtime' =>myself()->_getNowTime(),
|
||||||
'modifytime' =>myself()->_getNowTime(),
|
'modifytime' =>myself()->_getNowTime(),
|
||||||
)
|
)
|
||||||
@ -51,7 +39,7 @@ class UserInvitationCode extends BaseModel
|
|||||||
|
|
||||||
public static function getMyCodeBindCount($code){
|
public static function getMyCodeBindCount($code){
|
||||||
$rows = SqlHelper::ormSelect(
|
$rows = SqlHelper::ormSelect(
|
||||||
myself()->_getMysql(''),
|
myself()->_getSelfMysql(),
|
||||||
't_user_invitation_code_bind',
|
't_user_invitation_code_bind',
|
||||||
array(
|
array(
|
||||||
'invitation_code' => $code,
|
'invitation_code' => $code,
|
||||||
|
@ -1,30 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
|
|
||||||
namespace mt;
|
|
||||||
|
|
||||||
|
|
||||||
class BattlePotion
|
|
||||||
{
|
|
||||||
public static function find($id){
|
|
||||||
foreach (self::getMetaList() as $meta){
|
|
||||||
if ($meta['potionId'] == $id){
|
|
||||||
return $meta;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return array();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
protected static function getMetaList()
|
|
||||||
{
|
|
||||||
if (!self::$metaList) {
|
|
||||||
self::$metaList = getMetaTable('battlePotion@battlePotion.php');
|
|
||||||
}
|
|
||||||
return self::$metaList;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected static $metaList;
|
|
||||||
|
|
||||||
}
|
|
@ -1,33 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace mt;
|
|
||||||
|
|
||||||
use phpcommon;
|
|
||||||
|
|
||||||
class CircuitTask {
|
|
||||||
|
|
||||||
const BATTLE_TIMES_END = 1;
|
|
||||||
const COMPLETE_HASH_TASK_END = 2;
|
|
||||||
const LOGIN_TIMES_END = 3;
|
|
||||||
|
|
||||||
public static function getListBySeason($season){
|
|
||||||
$metas = array();
|
|
||||||
foreach (self::getMetaList() as $meta){
|
|
||||||
if ($meta['season'] == $season){
|
|
||||||
array_push($metas,$meta);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return $metas;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected static function getMetaList()
|
|
||||||
{
|
|
||||||
if (!self::$metaList) {
|
|
||||||
self::$metaList = getMetaTable('circuitTask@circuitTask.php');
|
|
||||||
}
|
|
||||||
return self::$metaList;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected static $metaList;
|
|
||||||
|
|
||||||
}
|
|
@ -18,17 +18,6 @@ class CircuitTime {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getNextCircuit(){
|
|
||||||
$next = array();
|
|
||||||
foreach (self::getCircuitAll(self::WHOLE_SEASON__TYPE) as $meta){
|
|
||||||
if (myself()->_getNowTime() < strtotime($meta['start_time'])){
|
|
||||||
$next = $meta;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return $next;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function getPrevStage(){
|
public static function getPrevStage(){
|
||||||
$prev = array();
|
$prev = array();
|
||||||
foreach (self::getCircuitAll(self::STAGE_SEASON_TYPE) as $meta){
|
foreach (self::getCircuitAll(self::STAGE_SEASON_TYPE) as $meta){
|
||||||
|
@ -139,8 +139,6 @@ class Item {
|
|||||||
const LUCKY_SYMBOL_SUBTYPE = 8;
|
const LUCKY_SYMBOL_SUBTYPE = 8;
|
||||||
const BATTLE_POTION_SUBTYPE = 9;
|
const BATTLE_POTION_SUBTYPE = 9;
|
||||||
|
|
||||||
const LUCKY_SYMBOL_ITEM_ID = 900007;
|
|
||||||
|
|
||||||
public static function get($id)
|
public static function get($id)
|
||||||
{
|
{
|
||||||
return getXVal(self::getMetaList(), $id, null);
|
return getXVal(self::getMetaList(), $id, null);
|
||||||
@ -360,11 +358,6 @@ class Item {
|
|||||||
$guns = array_unique($guns);
|
$guns = array_unique($guns);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getLuckySymbolMeta()
|
|
||||||
{
|
|
||||||
return self::get(self::LUCKY_SYMBOL_ITEM_ID);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected static function getMetaList()
|
protected static function getMetaList()
|
||||||
{
|
{
|
||||||
if (!self::$metaList) {
|
if (!self::$metaList) {
|
||||||
|
@ -128,20 +128,18 @@ class MapMode
|
|||||||
self::traverseMeta(function ($meta)
|
self::traverseMeta(function ($meta)
|
||||||
use (&$mapModeMeta, &$phase, &$startTime, &$endTime) {
|
use (&$mapModeMeta, &$phase, &$startTime, &$endTime) {
|
||||||
if ($meta['mapMode'] == self::TREASURE_BOX_MODE) {
|
if ($meta['mapMode'] == self::TREASURE_BOX_MODE) {
|
||||||
if (self::configedDailyTimeLimit1($meta) &&
|
if (self::configedDailyTimeLimit1($meta)) {
|
||||||
myself()->_inTimeRangeStr($meta['daily_open_time'], $meta['daily_end_time'])) {
|
|
||||||
$mapModeMeta = $meta;
|
$mapModeMeta = $meta;
|
||||||
$phase = 1;
|
$phase = 1;
|
||||||
$startTime = myself()->_getDaySecondsOffset(strtotime("2024-6-22 ". $meta['daily_open_time']));
|
$startTime = myself()->_getDaySecondsOffset(strtotime("2024-6-22 ". $meta['daily_open_time']));
|
||||||
$endTime = myself()->_getDaySecondsOffset(strtotime("2024-6-22 ". $meta['daily_end_time']));
|
$endTime = myself()->_getDaySecondsOffset(strtotime("2024-6-22 ". $meta['daily_end_time']));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (self::configedDailyTimeLimit2($meta) &&
|
if (self::configedDailyTimeLimit2($meta)) {
|
||||||
myself()->_inTimeRangeStr($meta['daily_open_time_2'], $meta['daily_end_time_2'])) {
|
|
||||||
$mapModeMeta = $meta;
|
$mapModeMeta = $meta;
|
||||||
$phase = 2;
|
$phase = 2;
|
||||||
$startTime = myself()->_getDaySecondsOffset(strtotime("2024-6-22 ". $meta['daily_open_time_2']));
|
$startTime = myself()->_getDaySecondsOffset(strtotime("2024-6-22 ". $meta['daily_open_time2']));
|
||||||
$endTime = myself()->_getDaySecondsOffset(strtotime("2024-6-22 ". $meta['daily_end_time_2']));
|
$endTime = myself()->_getDaySecondsOffset(strtotime("2024-6-22 ". $meta['daily_end_time2']));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -24,9 +24,6 @@ class RookieTask {
|
|||||||
const AND_FRIENDS_BATTLE_COND = 17; //和好友完成x场战斗
|
const AND_FRIENDS_BATTLE_COND = 17; //和好友完成x场战斗
|
||||||
const UP_HERO_TIMES_COND = 18; //进阶x次英雄
|
const UP_HERO_TIMES_COND = 18; //进阶x次英雄
|
||||||
const SYN_HERO_TIMES_COND = 19; //合成x次英雄
|
const SYN_HERO_TIMES_COND = 19; //合成x次英雄
|
||||||
const USE_BATTLE_MIXTURES_COND = 20; //使用一次战斗药剂
|
|
||||||
const USE_LUCKY_CHARM_COND = 21; //使用一次幸运符
|
|
||||||
|
|
||||||
const TOTAL_COMMIT_TASK_TIMES_COND = 101; //累积任务积分达到X
|
const TOTAL_COMMIT_TASK_TIMES_COND = 101; //累积任务积分达到X
|
||||||
|
|
||||||
public static function getCustomDayMetaList($day=0){
|
public static function getCustomDayMetaList($day=0){
|
||||||
|
@ -48,26 +48,6 @@ class ShopGoods
|
|||||||
return getXVal($shopData['goodsHash'], $goodsId, null);
|
return getXVal($shopData['goodsHash'], $goodsId, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getRandDailyHeroGoodsIds($shopId, $num)
|
|
||||||
{
|
|
||||||
$goodsMetaList = self::getGoodsList($shopId);
|
|
||||||
$goodsIds = array();
|
|
||||||
foreach ($goodsMetaList as $goodsMeta) {
|
|
||||||
if ($goodsMeta['is_close']) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
array_push($goodsIds, $goodsMeta['goods_id']);
|
|
||||||
}
|
|
||||||
shuffle($goodsIds);
|
|
||||||
$result = array();
|
|
||||||
for ($i = 0; $i < $num; ++$i) {
|
|
||||||
if ($i < count($goodsIds)) {
|
|
||||||
array_push($result, $goodsIds[$i]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return $result;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected static function mustBeShopGoodsHash()
|
protected static function mustBeShopGoodsHash()
|
||||||
{
|
{
|
||||||
if (!self::$shopGoodsHash) {
|
if (!self::$shopGoodsHash) {
|
||||||
|
@ -49,8 +49,8 @@ class BattleBoxService {
|
|||||||
if ($currPhase < 1 || $currPhase > 2) {
|
if ($currPhase < 1 || $currPhase > 2) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
$minNum = $maxLst0[$currPhase - 1];
|
$minNum = $maxLst0[$currPhase];
|
||||||
$maxNum = $maxLst1[$currPhase - 1];
|
$maxNum = $maxLst0[$currPhase];
|
||||||
|
|
||||||
error_log(json_encode(array(
|
error_log(json_encode(array(
|
||||||
'mapNodeMeta' => $mapModeMeta,
|
'mapNodeMeta' => $mapModeMeta,
|
||||||
@ -68,15 +68,6 @@ class BattleBoxService {
|
|||||||
$yesterDayDropLastTime = self::getDailyPhaseDropLastTime($currPhase, $yesterDayTime);
|
$yesterDayDropLastTime = self::getDailyPhaseDropLastTime($currPhase, $yesterDayTime);
|
||||||
$yesterDayDropTotal = self::getDailyPhaseDropTotalNum($currPhase, $yesterDayTime);
|
$yesterDayDropTotal = self::getDailyPhaseDropTotalNum($currPhase, $yesterDayTime);
|
||||||
$yesterDayAllocNum = self::getDailyPhaseAllocNum($currPhase, $yesterDayTime);
|
$yesterDayAllocNum = self::getDailyPhaseAllocNum($currPhase, $yesterDayTime);
|
||||||
$yesterDayAlreadyAllocNum = self::getDailyPhaseAlreadyAllocNum($currPhase, $yesterDayTime);
|
|
||||||
error_log(json_encode(array(
|
|
||||||
'yesterDayDropLastTime' => $yesterDayDropLastTime,
|
|
||||||
'yesterDayDropTotal' => $yesterDayDropTotal,
|
|
||||||
'yesterDayAllocNum' => $yesterDayAllocNum,
|
|
||||||
'yesterDayAlreadyAllocNum' => $yesterDayAlreadyAllocNum,
|
|
||||||
'maxNum' => $maxNum,
|
|
||||||
)));
|
|
||||||
$yesterDayDropTotal = max($yesterDayDropTotal, $yesterDayAlreadyAllocNum);
|
|
||||||
if ($yesterDayAllocNum <= 0) {
|
if ($yesterDayAllocNum <= 0) {
|
||||||
$allocableNum = $maxNum;
|
$allocableNum = $maxNum;
|
||||||
} else {
|
} else {
|
||||||
@ -100,19 +91,11 @@ class BattleBoxService {
|
|||||||
$completionDegree = $yesterDayDropTotal / $yesterDayAllocNum;
|
$completionDegree = $yesterDayDropTotal / $yesterDayAllocNum;
|
||||||
}
|
}
|
||||||
$allocableNum = min($maxNumLimit, $yesterDayAllocNum * $completionDegree);
|
$allocableNum = min($maxNumLimit, $yesterDayAllocNum * $completionDegree);
|
||||||
$allocableNum = max(300, $allocableNum);
|
|
||||||
if ($allocableNum <= 0) {
|
|
||||||
$allocableNum = $yesterDayAllocNum;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if ($allocableNum > 0) {
|
if ($allocableNum > 0) {
|
||||||
self::setDailyPhaseAllocNum($currPhase, myself()->_getNowDaySeconds(), $allocableNum);
|
self::setDailyPhaseAllocNum($currPhase, myself()->_getNowDaySeconds(), $allocableNum);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
error_log(json_encode(array(
|
|
||||||
'allocableNum' => $allocableNum,
|
|
||||||
'alreadyAllocNum' => $alreadyAllocNum,
|
|
||||||
)));
|
|
||||||
$allocableNum = max(0, $allocableNum - $alreadyAllocNum);
|
$allocableNum = max(0, $allocableNum - $alreadyAllocNum);
|
||||||
}
|
}
|
||||||
if ($allocableNum > 0) {
|
if ($allocableNum > 0) {
|
||||||
@ -208,7 +191,7 @@ class BattleBoxService {
|
|||||||
|
|
||||||
private static function setDailyPhaseDropLastTime($phase, $time, $val)
|
private static function setDailyPhaseDropLastTime($phase, $time, $val)
|
||||||
{
|
{
|
||||||
$key = self::DAILY_PHASE_DROP_LAST_TIME_KEY . $phase . ':' . myself()->_getDaySeconds($time);
|
$key = self::DAILY_PHASE_DROP_LAST_TIME_KEY . $phase . ':' . $time;
|
||||||
$r = myself()->_getRedis($key);
|
$r = myself()->_getRedis($key);
|
||||||
$r->setPx($key, $val, 1000 * 3600 * 24 * 7);
|
$r->setPx($key, $val, 1000 * 3600 * 24 * 7);
|
||||||
}
|
}
|
||||||
@ -256,7 +239,7 @@ class BattleBoxService {
|
|||||||
|
|
||||||
public static function incDropTotalNum($phase, $time, $val)
|
public static function incDropTotalNum($phase, $time, $val)
|
||||||
{
|
{
|
||||||
$key = self::DAILY_PHASE_DROP_TOTAL_KEY . $phase . ':' . myself()->_getDaySeconds($time);
|
$key = self::DAILY_PHASE_DROP_TOTAL_KEY . $phase . ':' . $time;
|
||||||
$r = myself()->_getRedis($key);
|
$r = myself()->_getRedis($key);
|
||||||
$num = intval($r->get($key));
|
$num = intval($r->get($key));
|
||||||
if (empty($num)) {
|
if (empty($num)) {
|
||||||
@ -264,7 +247,6 @@ class BattleBoxService {
|
|||||||
} else {
|
} else {
|
||||||
$r->setPx($key, $num + $val, 1000 * 3600 * 24 * 7);
|
$r->setPx($key, $num + $val, 1000 * 3600 * 24 * 7);
|
||||||
}
|
}
|
||||||
self::setDailyPhaseDropLastTime($phase, $time, $time);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -527,11 +527,9 @@ class MissionService extends BaseService {
|
|||||||
{
|
{
|
||||||
//邀请新人并绑定邀请码(邀请新人数)
|
//邀请新人并绑定邀请码(邀请新人数)
|
||||||
$myCodeDb = UserInvitationCode::findMyCode();
|
$myCodeDb = UserInvitationCode::findMyCode();
|
||||||
if ($myCodeDb){
|
|
||||||
$count = UserInvitationCode::getMyCodeBindCount($myCodeDb['invitation_code']);
|
$count = UserInvitationCode::getMyCodeBindCount($myCodeDb['invitation_code']);
|
||||||
$missionDto['current'] = $count;
|
$missionDto['current'] = $count;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case mt\Task::OFFER_REWARD_COND:
|
case mt\Task::OFFER_REWARD_COND:
|
||||||
{
|
{
|
||||||
@ -1496,19 +1494,10 @@ class MissionService extends BaseService {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function _isHaveRedTag($type){
|
public function _isHaveRedTag(){
|
||||||
if ($type == 0){
|
|
||||||
$missionMetaList = array();
|
|
||||||
foreach ($this->dailyMission['missions'] as $mission) {
|
foreach ($this->dailyMission['missions'] as $mission) {
|
||||||
$missionMeta = mt\Task::get($mission['mission_id']);
|
$missionMeta = mt\Task::get($mission['mission_id']);
|
||||||
array_push($missionMetaList,$missionMeta);
|
$missionDb = Mission::find($mission['mission_id']);
|
||||||
}
|
|
||||||
}else{
|
|
||||||
$missionMetaList = mt\Task::getCustomTypeMetaList(\mt\Task::NEW_USER_MISSON_TYPE, $this);
|
|
||||||
}
|
|
||||||
foreach ($missionMetaList as $missionMeta) {
|
|
||||||
|
|
||||||
$missionDb = Mission::find($missionMeta['id']);
|
|
||||||
$missionDto = $this->getMissionDto($this->userInfo,'',$missionDb,$missionMeta);
|
$missionDto = $this->getMissionDto($this->userInfo,'',$missionDb,$missionMeta);
|
||||||
if ($missionDto['state'] == Mission::RECEIVEABLE_STATE) {
|
if ($missionDto['state'] == Mission::RECEIVEABLE_STATE) {
|
||||||
return true;
|
return true;
|
||||||
|
@ -14,8 +14,6 @@ require_once('mt/RankSeason.php');
|
|||||||
require_once('mt/EconomyAttribute.php');
|
require_once('mt/EconomyAttribute.php');
|
||||||
require_once('mt/CircuitTime.php');
|
require_once('mt/CircuitTime.php');
|
||||||
require_once('mt/StakingVip.php');
|
require_once('mt/StakingVip.php');
|
||||||
require_once('mt/BattlePotion.php');
|
|
||||||
require_once('mt/Item.php');
|
|
||||||
|
|
||||||
require_once('services/AwardService.php');
|
require_once('services/AwardService.php');
|
||||||
require_once('services/PropertyChgService.php');
|
require_once('services/PropertyChgService.php');
|
||||||
@ -133,25 +131,21 @@ class RoomBattleDataService extends BaseService {
|
|||||||
//巡回模式排位分计算
|
//巡回模式排位分计算
|
||||||
if ($this->mapMode == mt\MapMode::CIRCUIT_MODE){
|
if ($this->mapMode == mt\MapMode::CIRCUIT_MODE){
|
||||||
$circuitMeta = mt\CircuitTime::getCurrentCircuit();
|
$circuitMeta = mt\CircuitTime::getCurrentCircuit();
|
||||||
$circuitStageMeta = mt\CircuitTime::getCurrentStage();
|
if ($circuitMeta){
|
||||||
if ($circuitMeta && $circuitStageMeta){
|
|
||||||
$minScore = mt\Parameter::getVal('circuit_rank_score_min',0);
|
$minScore = mt\Parameter::getVal('circuit_rank_score_min',0);
|
||||||
$multConstant = mt\Parameter::getVal('circuit_score_mult_constant',1);
|
$multConstant = mt\Parameter::getVal('circuit_score_mult_constant',1);
|
||||||
$shiftConstant = mt\Parameter::getVal('circuit_score_shift_constant',1);
|
$shiftConstant = mt\Parameter::getVal('circuit_score_shift_constant',1);
|
||||||
$circuitScore = $battleScore * $multConstant + $shiftConstant;
|
$circuitScore = $battleScore * $multConstant + $shiftConstant;
|
||||||
$myScore = Circuit::getMyScore($circuitMeta['circuit_season']);
|
$myScore = Circuit::getMyScore($circuitMeta['circuit_season']);
|
||||||
$myPhaseScore = Circuit::getMyPhaseScore($circuitStageMeta['circuit_season'],$circuitStageMeta['circuit_phase']);
|
$finalScore = max($minScore, $myScore+$circuitScore);
|
||||||
$finalScore = floor(max($minScore, $myScore+$circuitScore)) ;
|
|
||||||
$finalPhaseScore = floor(max($minScore, $myPhaseScore+$circuitScore));
|
|
||||||
Circuit::updateScore($circuitMeta['circuit_season'],$finalScore);
|
Circuit::updateScore($circuitMeta['circuit_season'],$finalScore);
|
||||||
Circuit::updatePhaseScore($circuitStageMeta['circuit_season'],$circuitStageMeta['circuit_phase'],$finalPhaseScore);
|
|
||||||
$member['new_circuit_score'] = $finalScore;
|
$member['new_circuit_score'] = $finalScore;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$battleSingleDb = BattleSettlement::findSingle($this->battleSettlementDb['battle_uuid']);
|
$battleSingleDb = BattleSettlement::findSingle($this->battleSettlementDb['battle_uuid']);
|
||||||
if ($this->mapMode == mt\MapMode::TREASURE_BOX_MODE && $member['move_distance'] <= 2000 ){
|
if ($this->mapMode == mt\MapMode::TREASURE_BOX_MODE && $member['move_distance'] <= 2000 ){
|
||||||
error_log("宝箱模式:消极战斗");
|
error_log("金币模式:消极战斗");
|
||||||
}else{
|
}else{
|
||||||
$this->_getBattleRewards($battleSingleDb, $userDb,$heroDb,$battleScore,$myTeamScoreAvg,$myTeamScore,$member['reward'], $member);
|
$this->_getBattleRewards($battleSingleDb, $userDb,$heroDb,$battleScore,$myTeamScoreAvg,$myTeamScore,$member['reward'], $member);
|
||||||
myself()->_addItems($member['reward'], $awardService,$propertyChgService);
|
myself()->_addItems($member['reward'], $awardService,$propertyChgService);
|
||||||
@ -190,23 +184,8 @@ class RoomBattleDataService extends BaseService {
|
|||||||
$teamRank = getXVal($this->teamData,'pvp_team_rank', 0);
|
$teamRank = getXVal($this->teamData,'pvp_team_rank', 0);
|
||||||
if ($mapModeMeta){
|
if ($mapModeMeta){
|
||||||
$accountLucky = Hero::getAccountLuckyTemp();
|
$accountLucky = Hero::getAccountLuckyTemp();
|
||||||
$battleItems = getXVal($member,'battle_items', 0);
|
|
||||||
if (count($battleItems) > 0){
|
|
||||||
foreach ($battleItems as $item){
|
|
||||||
$itemMeta = mt\Item::get($item['item_id']);
|
|
||||||
if ($itemMeta['type'] == mt\Item::FUNC_TYPE && $itemMeta['sub_type'] == mt\Item::LUCKY_SYMBOL_SUBTYPE){
|
|
||||||
$potionMeta = mt\BattlePotion::find($item['item_id']);
|
|
||||||
if ($potionMeta){
|
|
||||||
$effect = explode(':',$potionMeta['effect']);
|
|
||||||
$accountLucky += $effect[1];
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$rewardMeta = mt\BattleReward::find($mapModeMeta['rewardMode'],$accountLucky);
|
$rewardMeta = mt\BattleReward::find($mapModeMeta['rewardMode'],$accountLucky);
|
||||||
if (!$rewardMeta){
|
if (!$rewardMeta){
|
||||||
error_log('ERROR:'.$this->mapMode.' settlementReward,user have lucky '.$accountLucky);
|
|
||||||
return ;
|
return ;
|
||||||
}
|
}
|
||||||
$hashRateValue = 0;
|
$hashRateValue = 0;
|
||||||
@ -312,7 +291,7 @@ class RoomBattleDataService extends BaseService {
|
|||||||
}
|
}
|
||||||
$gold = 0;
|
$gold = 0;
|
||||||
if ($heroDb['quality'] > 1){
|
if ($heroDb['quality'] > 1){
|
||||||
if (Hero::verifyValid($heroDb) && $heroTimes < $heroTimesMax && $goldModeTimes < $rewardsMaxTimes){
|
if (!Hero::verifyValid($heroDb) && $heroTimes < $heroTimesMax && $goldModeTimes < $rewardsMaxTimes){
|
||||||
$items = LootService::dropOutItem($rewardMeta['goldLoot']);
|
$items = LootService::dropOutItem($rewardMeta['goldLoot']);
|
||||||
foreach ($items as $item){
|
foreach ($items as $item){
|
||||||
if ($item['item_id'] = V_ITEM_GOLD){
|
if ($item['item_id'] = V_ITEM_GOLD){
|
||||||
@ -356,15 +335,6 @@ class RoomBattleDataService extends BaseService {
|
|||||||
//宝箱掉落
|
//宝箱掉落
|
||||||
$chestLootProbArr = explode(";",$rewardMeta['chestLootProb']);
|
$chestLootProbArr = explode(";",$rewardMeta['chestLootProb']);
|
||||||
$rate = isset($chestLootProbArr[$teamRank-1]) ? $chestLootProbArr[$teamRank-1] : 0;
|
$rate = isset($chestLootProbArr[$teamRank-1]) ? $chestLootProbArr[$teamRank-1] : 0;
|
||||||
if ($member['account_id'] == "2_2006_QmoeZ5t2ecIq6dVNyi9jQj5CzTUB0bGC"){
|
|
||||||
error_log("BoxMap:".json_encode(
|
|
||||||
array(
|
|
||||||
'rate' => $rate,
|
|
||||||
'box_num' => $member['box_num'],
|
|
||||||
'switch' => myself()->_switchIsOpen('bigEventBoxDrop'),
|
|
||||||
)
|
|
||||||
));
|
|
||||||
}
|
|
||||||
if ($rate > 0 && !empty($member['box_num']) && myself()->_switchIsOpen('bigEventBoxDrop')){
|
if ($rate > 0 && !empty($member['box_num']) && myself()->_switchIsOpen('bigEventBoxDrop')){
|
||||||
$rewardBox = array();
|
$rewardBox = array();
|
||||||
$realBoxNum = 0;
|
$realBoxNum = 0;
|
||||||
|
@ -20,8 +20,6 @@ use models\GunSkin;
|
|||||||
|
|
||||||
class ShopService {
|
class ShopService {
|
||||||
|
|
||||||
private static $dailHeroHash = array();
|
|
||||||
|
|
||||||
public static function getGoodsList($shopId)
|
public static function getGoodsList($shopId)
|
||||||
{
|
{
|
||||||
if ($shopId == 0) {
|
if ($shopId == 0) {
|
||||||
@ -38,10 +36,6 @@ class ShopService {
|
|||||||
if ($goodsMeta['is_close']) {
|
if ($goodsMeta['is_close']) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if ($goodsMeta['shop_id'] == mt\Shop::DAILY_HERO_SHOP &&
|
|
||||||
!self::inDailyHeroList($goodsMeta)) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
$goodsDto = array(
|
$goodsDto = array(
|
||||||
'goods_id' => $goodsMeta['goods_id'],
|
'goods_id' => $goodsMeta['goods_id'],
|
||||||
'goods_meta' => self::goodsMetaToInfo($goodsMeta),
|
'goods_meta' => self::goodsMetaToInfo($goodsMeta),
|
||||||
@ -159,29 +153,6 @@ class ShopService {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static function getDailyHeroList()
|
|
||||||
{
|
|
||||||
if (isset(self::$dailyHeroHash[myself()->_getAccountId()])) {
|
|
||||||
return self::$dailyHeroHash[myself()->_getAccountId()];
|
|
||||||
}
|
|
||||||
$r = myself()->_getSelfRedis();
|
|
||||||
$key = 'shop.daily.shop:' . myself()->_getAccountId();
|
|
||||||
$data = $r->get($key);
|
|
||||||
if (empty($data)) {
|
|
||||||
$num = myself()->_callMtStatic('Parameter', 'getByName', 'SHOP_TYPE2_SLOT')['param_value'];
|
|
||||||
$data = mt\ShopGoods::getRandDailyHeroGoodsIds(mt\Shop::DAILY_HERO_SHOP, min(50, $num));
|
|
||||||
$r->setPx($key, json_encode($data), 1000 * 3600 * 24);
|
|
||||||
} else {
|
|
||||||
$data = json_decode($data, true);
|
|
||||||
}
|
|
||||||
return $data;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static function inDailyHeroList($goodsMeta)
|
|
||||||
{
|
|
||||||
return in_array($goodsMeta['goods_id'], self::getDailyHeroList());
|
|
||||||
}
|
|
||||||
|
|
||||||
// public static function canBuy($itemMeta, &$errCode, &$errMsg)
|
// public static function canBuy($itemMeta, &$errCode, &$errMsg)
|
||||||
// {
|
// {
|
||||||
// $errCode = 0;
|
// $errCode = 0;
|
||||||
|
@ -12,15 +12,15 @@ class StakingVipService extends BaseService
|
|||||||
{
|
{
|
||||||
public static function getDetails($accountAddr)
|
public static function getDetails($accountAddr)
|
||||||
{
|
{
|
||||||
// if (empty($accountAddr) || !is_string($accountAddr)) {
|
if (empty($accountAddr) || !is_string($accountAddr)) {
|
||||||
// return;
|
return;
|
||||||
// }
|
}
|
||||||
|
|
||||||
$row = phpcommon\SqlHelper::ormSelectOne(
|
$row = phpcommon\SqlHelper::ormSelectOne(
|
||||||
myself()->_getMarketMysql(),
|
myself()->_getMarketMysql(),
|
||||||
't_vip_user',
|
't_vip_user',
|
||||||
array(
|
array(
|
||||||
'account_address' => strtolower($accountAddr),
|
'account_address' => $accountAddr,
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -17,7 +17,6 @@ require_once('mt/MapMode.php');
|
|||||||
require_once('mt/BattleReward.php');
|
require_once('mt/BattleReward.php');
|
||||||
require_once('mt/CircuitTime.php');
|
require_once('mt/CircuitTime.php');
|
||||||
require_once('mt/RookieTask.php');
|
require_once('mt/RookieTask.php');
|
||||||
require_once('mt/CircuitTask.php');
|
|
||||||
|
|
||||||
require_once('models/Season.php');
|
require_once('models/Season.php');
|
||||||
require_once('models/Battle.php');
|
require_once('models/Battle.php');
|
||||||
@ -106,8 +105,8 @@ class TameBattleDataService extends BaseService {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
myself()->_fireEvent('Battle','onSettlement',$this->battleInfo);
|
myself()->_fireEvent('Battle','onSettlement',$this->battleInfo);
|
||||||
myself()->_callModelStatic('CircuitTask','incTaskVal',mt\CircuitTask::BATTLE_TIMES_END,1);
|
myself()->_callModelStatic('RookieTask','incTaskVal',mt\RookieTask::BATTLE_TIMES_COND,1);
|
||||||
$this->incRookieTaskValue();
|
$this->isMyFriend();
|
||||||
//记录战斗有效行为
|
//记录战斗有效行为
|
||||||
// $this->_updateBattleData();
|
// $this->_updateBattleData();
|
||||||
//记录战斗数据的排行榜
|
//记录战斗数据的排行榜
|
||||||
@ -166,30 +165,17 @@ class TameBattleDataService extends BaseService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private function incRookieTaskValue(){
|
private function isMyFriend(){
|
||||||
myself()->_callModelStatic('RookieTask','incTaskVal',mt\RookieTask::BATTLE_TIMES_COND,1);
|
|
||||||
$battleItems = getXVal($this->battleInfo,'battle_items', 0);
|
|
||||||
if (count($battleItems) > 0){
|
|
||||||
foreach ($battleItems as $item){
|
|
||||||
$itemMeta = mt\Item::get($item['item_id']);
|
|
||||||
if ($itemMeta['type'] == mt\Item::FUNC_TYPE && $itemMeta['sub_type'] == mt\Item::LUCKY_SYMBOL_SUBTYPE){
|
|
||||||
myself()->_callModelStatic('RookieTask','incTaskVal',mt\RookieTask::USE_LUCKY_CHARM_COND,$item['use_num']);
|
|
||||||
}
|
|
||||||
if ($itemMeta['type'] == mt\Item::FUNC_TYPE && $itemMeta['sub_type'] == mt\Item::BATTLE_POTION_SUBTYPE){
|
|
||||||
myself()->_callModelStatic('RookieTask','incTaskVal',mt\RookieTask::USE_BATTLE_MIXTURES_COND,$item['use_num']);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$myAccount = getXVal($this->userInfo,'account_id', 0);
|
$myAccount = getXVal($this->userInfo,'account_id', 0);
|
||||||
foreach ($this->teamInfo as $member){
|
foreach ($this->teamInfo as $member){
|
||||||
$account = getXVal($member,'account_id', 0);
|
$account = getXVal($member,'account_id', 0);
|
||||||
$row = SqlHelper::ormSelectOne(
|
$row = SqlHelper::ormSelectOne(
|
||||||
myself()->_getFriendDbMysql(),
|
myself()->_getFriendDbMysql(),
|
||||||
't_friend_relationship',
|
't_friend_ships',
|
||||||
array(
|
array(
|
||||||
'account_id1' => $myAccount,
|
'account1_id' => $myAccount,
|
||||||
'account_id2' => $account,
|
'account2_id' => $account,
|
||||||
'deleted' => 0,
|
'is_friendship' => 1,
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
if ($row){
|
if ($row){
|
||||||
@ -198,11 +184,11 @@ class TameBattleDataService extends BaseService {
|
|||||||
}
|
}
|
||||||
$row = SqlHelper::ormSelectOne(
|
$row = SqlHelper::ormSelectOne(
|
||||||
myself()->_getFriendDbMysql(),
|
myself()->_getFriendDbMysql(),
|
||||||
't_friend_relationship',
|
't_friend_ships',
|
||||||
array(
|
array(
|
||||||
'account_id1' => $account,
|
'account1_id' => $account,
|
||||||
'account_id2' => $myAccount,
|
'account2_id' => $myAccount,
|
||||||
'deleted' => 0,
|
'is_friendship' => 1,
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
if ($row){
|
if ($row){
|
||||||
@ -587,10 +573,7 @@ class TameBattleDataService extends BaseService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
$circuitMeta = mt\CircuitTime::getCurrentCircuit();
|
$circuitMeta = mt\CircuitTime::getCurrentCircuit();
|
||||||
$circuitScore= 0;
|
|
||||||
if ($circuitMeta){
|
|
||||||
$circuitScore = Circuit::getMyScore($circuitMeta['circuit_season']);
|
$circuitScore = Circuit::getMyScore($circuitMeta['circuit_season']);
|
||||||
}
|
|
||||||
$data = array(
|
$data = array(
|
||||||
"battle_uuid" => $battleUuid,
|
"battle_uuid" => $battleUuid,
|
||||||
"map_mode_id" => getXVal($this->allInfo,'map_mode_id', 0),
|
"map_mode_id" => getXVal($this->allInfo,'map_mode_id', 0),
|
||||||
@ -672,10 +655,7 @@ class TameBattleDataService extends BaseService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
$circuitMeta = mt\CircuitTime::getCurrentCircuit();
|
$circuitMeta = mt\CircuitTime::getCurrentCircuit();
|
||||||
$circuitScore= 0;
|
|
||||||
if ($circuitMeta){
|
|
||||||
$circuitScore = Circuit::getMyScore($circuitMeta['circuit_season']);
|
$circuitScore = Circuit::getMyScore($circuitMeta['circuit_season']);
|
||||||
}
|
|
||||||
$data = array(
|
$data = array(
|
||||||
'version'=> getXVal($this->allInfo,'version', 0),
|
'version'=> getXVal($this->allInfo,'version', 0),
|
||||||
'team_id'=> getXVal($this->allInfo,'team_id', 0),
|
'team_id'=> getXVal($this->allInfo,'team_id', 0),
|
||||||
@ -790,7 +770,6 @@ class TameBattleDataService extends BaseService {
|
|||||||
'reward' => $rewards,
|
'reward' => $rewards,
|
||||||
'winningPro' => $winningPro,
|
'winningPro' => $winningPro,
|
||||||
'match_room_uuid' => getXVal($info,'match_room_uuid', 0),
|
'match_room_uuid' => getXVal($info,'match_room_uuid', 0),
|
||||||
'battle_items' => getXVal($info,'battle_items', array()),
|
|
||||||
);
|
);
|
||||||
array_push($data['members'],$temp);
|
array_push($data['members'],$temp);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user