From 11a162fc7f8a636ad83345c101dd5ba2dc9e78d2 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Mon, 5 Jun 2023 19:39:36 +0800 Subject: [PATCH 01/10] 1 --- doc/_common.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/_common.py b/doc/_common.py index bfc9177b..2da1295c 100644 --- a/doc/_common.py +++ b/doc/_common.py @@ -121,6 +121,7 @@ class UserInfo(object): ['activated', 0, '是否已激活'], ['rename_count', 0, '改名次数'], ['account_id', '', '账号id'], + ['address', '', '钱包地址(空或者null表示没钱包)'], ['name', '', '用户名字'], ['head_id', 0, '头像id'], ['head_frame', 0, '头像框id'], @@ -1154,4 +1155,4 @@ class BattleReward(object): self.fields = [ ['hero', BattleCegReward(), '英雄奖励'], ['!items', [BattleItemReward()], '碎片奖励'], - ] \ No newline at end of file + ] From 155258c96fb2476b9853fce7623c9b1202aa6650 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Mon, 5 Jun 2023 19:45:52 +0800 Subject: [PATCH 02/10] 1 --- webapp/models/User.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/webapp/models/User.php b/webapp/models/User.php index 9c42d200..7b1b3adf 100644 --- a/webapp/models/User.php +++ b/webapp/models/User.php @@ -66,6 +66,7 @@ class User extends BaseModel { 'activated' => $row['activated'], 'rename_count' => $row['rename_count'], 'account_id' => $row['account_id'], + 'address' => $row['address'], 'name' => $row['name'], 'sex' => $row['sex'], 'head_id' => $row['head_id'], @@ -125,6 +126,7 @@ class User extends BaseModel { 'activated' => $row['activated'], 'rename_count' => $row['rename_count'], 'account_id' => $row['account_id'], + 'address' => $row['address'], 'name' => $row['name'], 'sex' => $row['sex'], 'head_id' => $row['head_id'], @@ -178,7 +180,7 @@ class User extends BaseModel { return array( 'account_id' => $row['account_id'], - 'address' => phpcommon\extractOpenId($row['account_id']), + 'address' => $row['address'], 'name' => $row['name'], 'sex' => $row['sex'], 'head_id' => $row['head_id'], @@ -207,7 +209,7 @@ class User extends BaseModel { $skinDb = HeroSkin::findBx($heroId); return array( 'account_id' => $row['account_id'], - 'address' => phpcommon\extractOpenId($row['account_id']), + 'address' => $row['address'], 'name' => $row['name'], // 'sex' => $row['sex'], // 'head_id' => $row['head_id'], From 6d5ff764345a736678fbe17692bccf074272d1a3 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Mon, 5 Jun 2023 20:04:10 +0800 Subject: [PATCH 03/10] 1 --- webapp/controller/UserController.class.php | 114 +++++++++++---------- 1 file changed, 62 insertions(+), 52 deletions(-) diff --git a/webapp/controller/UserController.class.php b/webapp/controller/UserController.class.php index aa56da74..3779bddf 100644 --- a/webapp/controller/UserController.class.php +++ b/webapp/controller/UserController.class.php @@ -253,6 +253,36 @@ class UserController extends BaseAuthedController { $haveHeadHeroList[rand() % count($haveHeadHeroList)]['hero_head'] : 0; } //Hero::randHero($heroUniId, $heroId); + $fields = array( + 'account_id' => $this->_getAccountId(), + 'channel' => $this->_getChannel(), + 'name' => $userName, + 'sex' => rand() % 2, + #'avatar_url' => $avatar_url, + 'gold' => $gold, + 'diamond' => $diamond, + 'head_frame' => $headFrame, + 'level' => 1, + 'exp' => 0, + 'rank' => $initRankMeta ? $initRankMeta['id'] : 1, + 'history_best_rank' => $initRankMeta ? $initRankMeta['id'] : 1, + 'score' => $initRankMeta ? $initRankMeta['rank_score'] : 0, + 'history_best_score' => $initRankMeta ? $initRankMeta['rank_score'] : 0, + 'head_id' => $headId, + 'hero_id' => $heroId, + 'last_season_id' => $currSeasonMeta ? $currSeasonMeta['id'] : 0, + 'head_list' => json_encode($headList), + 'head_frame_list' => json_encode($headFrameList), + 'score_modifytime' => $this->_getNowTime(), + 'best_rank_modifytime' => $this->_getNowTime(), + 'createtime' => $this->_getNowTime(), + 'modifytime' => $this->_getNowTime(), + 'last_login_time' => $this->_getNowTime(), + ); + if ($this->_getChannel() == BC_CHANNEL) { + $fields['address'] = $this->_getOpenId(); + } + SqlHelper::upsert ($this->_getSelfMysql(), 't_user', @@ -261,32 +291,7 @@ class UserController extends BaseAuthedController { ), array( ), - array( - 'account_id' => $this->_getAccountId(), - 'channel' => $this->_getChannel(), - 'name' => $userName, - 'sex' => rand() % 2, - #'avatar_url' => $avatar_url, - 'gold' => $gold, - 'diamond' => $diamond, - 'head_frame' => $headFrame, - 'level' => 1, - 'exp' => 0, - 'rank' => $initRankMeta ? $initRankMeta['id'] : 1, - 'history_best_rank' => $initRankMeta ? $initRankMeta['id'] : 1, - 'score' => $initRankMeta ? $initRankMeta['rank_score'] : 0, - 'history_best_score' => $initRankMeta ? $initRankMeta['rank_score'] : 0, - 'head_id' => $headId, - 'hero_id' => $heroId, - 'last_season_id' => $currSeasonMeta ? $currSeasonMeta['id'] : 0, - 'head_list' => json_encode($headList), - 'head_frame_list' => json_encode($headFrameList), - 'score_modifytime' => $this->_getNowTime(), - 'best_rank_modifytime' => $this->_getNowTime(), - 'createtime' => $this->_getNowTime(), - 'modifytime' => $this->_getNowTime(), - 'last_login_time' => $this->_getNowTime(), - ) + $fields ); $awardService = new services\AwardService(); $propertyChgService = new services\PropertyChgService(); @@ -821,33 +826,38 @@ class UserController extends BaseAuthedController { private function createNewUserV2($userName){ $currSeasonMeta = mt\RankSeason::getCurrentSeason(); - SqlHelper::upsert - ($this->_getSelfMysql(), - 't_user', - array( - 'account_id' => $this->_getAccountId() - ), - array( - ), - array( - 'account_id' => $this->_getAccountId(), - 'channel' => $this->_getChannel(), - 'name' => $userName, - 'sex' => rand() % 2, - 'gold' => 0, - 'diamond' => 0, - 'level' => 1, - 'rank' => 0, - 'score' => 0, - 'exp' => 0, - 'last_season_id' => $currSeasonMeta ? $currSeasonMeta['id'] : 0, - 'score_modifytime' => $this->_getNowTime(), - 'best_rank_modifytime' => $this->_getNowTime(), - 'createtime' => $this->_getNowTime(), - 'modifytime' => $this->_getNowTime(), - 'last_login_time' => $this->_getNowTime(), - ) + $fields = array( + 'account_id' => $this->_getAccountId(), + 'channel' => $this->_getChannel(), + 'name' => $userName, + 'sex' => rand() % 2, + 'gold' => 0, + 'diamond' => 0, + 'level' => 1, + 'rank' => 0, + 'score' => 0, + 'exp' => 0, + 'last_season_id' => $currSeasonMeta ? $currSeasonMeta['id'] : 0, + 'score_modifytime' => $this->_getNowTime(), + 'best_rank_modifytime' => $this->_getNowTime(), + 'createtime' => $this->_getNowTime(), + 'modifytime' => $this->_getNowTime(), + 'last_login_time' => $this->_getNowTime(), ); + if ($this->_getChannel() == BC_CHANNEL) { + $fields['address'] = $this->_getOpenId(); + } + + SqlHelper::upsert + ($this->_getSelfMysql(), + 't_user', + array( + 'account_id' => $this->_getAccountId() + ), + array( + ), + $fields + ); } private function updateLastSeason($userInfo){ From 4d74ea53975b740fd59651effa7f8d201731164e Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Mon, 5 Jun 2023 20:06:48 +0800 Subject: [PATCH 04/10] 1 --- webapp/controller/UserController.class.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/webapp/controller/UserController.class.php b/webapp/controller/UserController.class.php index 3779bddf..fc2ba4db 100644 --- a/webapp/controller/UserController.class.php +++ b/webapp/controller/UserController.class.php @@ -64,6 +64,14 @@ class UserController extends BaseAuthedController { $this->_updateUserInfo(array( 'last_login_time'=>myself()->_getNowTime(), )); + if ($this->_getChannel() == BC_CHANNEL && + empty($userInfo['address']) + ) { + User::Update(array( + 'address' => $this->_getOpenId() + )); + $userInfo['address'] = $this->_getOpenId(); + } $this->updateLastSeason($userInfo); $this->_rspData(array( 'info' => User::show($userInfo), From 406d2c6db21fe167a5f0d46d6d1ca9e660a95a2c Mon Sep 17 00:00:00 2001 From: songliang Date: Tue, 6 Jun 2023 11:27:45 +0800 Subject: [PATCH 05/10] ... --- doc/FirstTopup.py | 63 ++++++ .../controller/FirstTopupController.class.php | 198 ++++++++++++++++++ webapp/mt/FirstTopup.php | 56 +++++ 3 files changed, 317 insertions(+) create mode 100644 doc/FirstTopup.py create mode 100644 webapp/controller/FirstTopupController.class.php create mode 100644 webapp/mt/FirstTopup.php diff --git a/doc/FirstTopup.py b/doc/FirstTopup.py new file mode 100644 index 00000000..06691804 --- /dev/null +++ b/doc/FirstTopup.py @@ -0,0 +1,63 @@ +# -*- coding: utf-8 -*- + +import _common + +class Reward(object): + + def __init__(self): + self.fields = [ + ['id', 0, 'id'], + ['group', '', 'group'], + ['goods_id', 0, 'goods_id'], + ['goods_num', 0, '堆叠数量'], + ['shop_icon', 0, '商店图标'], + ] + +class FirstTopup(object): + + def __init__(self): + self.apis = [ + { + 'name': 'info', + 'desc': '首充信息', + 'group': 'FirstTopup', + 'url': 'webapp/index.php?c=FirstTopup&a=info', + 'params': [ + _common.ReqHead(), + ], + 'response': [ + _common.RspHead(), + ['complete', 0, '是否已经完成首充 0-未完成 1-已完成'], + ['firstTopupList', [Reward], '奖励信息'], + ['status', [0], '领取状态 0-未领取 1-可领取 2-已领取'], + ] + }, + { + 'name': 'begin', + 'desc': '开始首充', + 'group': 'FirstTopup', + 'url': 'webapp/index.php?c=FirstTopup&a=begin', + 'params': [ + _common.ReqHead(), + ], + 'response': [ + _common.RspHead(), + ] + }, + { + 'name': 'get', + 'desc': '获取首充奖励', + 'group': 'FirstTopup', + 'url': 'webapp/index.php?c=FirstTopup&a=get', + 'params': [ + _common.ReqHead(), + ['group', 0, '奖励组id'], + ], + 'response': [ + _common.RspHead(), + ['group', 0, '奖励组id'], + ['status', [0], '领取状态 0-未领取 1-可领取 2-已领取'], + ['reward', [Reward], '奖励信息'], + ] + }, + ] diff --git a/webapp/controller/FirstTopupController.class.php b/webapp/controller/FirstTopupController.class.php new file mode 100644 index 00000000..e0600cec --- /dev/null +++ b/webapp/controller/FirstTopupController.class.php @@ -0,0 +1,198 @@ +_getMysql(''); + + $status = $this->getStatusFromDB($conn); + + // 检查所有 奖励都 领取完成 + $complete = ($status[0] == 2 && $status[1] == 2 && $status[2] == 2) ? 1 : 0; + + $this->_rspData( + array( + 'complete' => $complete, + 'firstTopupList' => mt\FirstTopup::getGroups(), + 'status' => $status, + ) + ); + } + + public function begin() + { + $conn = myself()->_getMysql(''); + + $exist = SqlHelper::selectOne( + $conn, + 't_first_topup', + array('account_id'), + array('account_id' => myself()->_getAccountId()) + ); + if ($exist) { + $this->_rspErr(1, '首充奖励活动已经开启'); + return; + } + + // 开始首充奖励活动进程 + $chk = SqlHelper::insert( + $conn, + 't_first_topup', + array( + 'account_id' => myself()->_getAccountId(), + 'createtime' => myself()->_getNowTime(), + 'status1' => 0, + 'status2' => 0, + 'status3' => 0, + ) + ); + + if ($chk) { + $this->_rspOk(); + } else { + $this->_rspErr(1, '首充奖励活动开启失败'); + } + } + + public function get() + { + $group = getReqVal('group', 1); + + $conn = myself()->_getMysql(''); + + $status = $this->getStatusFromDB($conn); + + $test = $status[$group - 1]; + + if ($test == 1) { + $status[$group - 1] = 2; + $chk = SqlHelper::update( + $conn, + 't_first_topup', + array( + 'account_id' => myself()->_getAccountId(), + ), + array( + 'status' . $group => 2, + ), + + ); + // 发放奖励 + $reward = mt\FirstTopup::getByGroup($group); + + $propertyChgService = new services\PropertyChgService(); + + for ($i = 0; $i < count($reward); $i++) { + $item = $reward[$i]; + $itemMeta = mt\Item::get($item['goods_id']); + for ($j = 0; $j < $item['goods_num']; $j++) { + $this->internalAddItem($propertyChgService, $itemMeta, 1); + } + } + + $this->_rspData( + array( + 'group' => $group, + 'status' => $status, + 'reward' => $reward, + ) + ); + } else if ($test >= 2) { + $this->_rspErr(2, "already received the reward"); + } else if ($test < 1) { + // 未到领取时间 英文 怎么说 + $this->_rspErr(1, "not yet to receive the reward"); + } + } + + private function getStatus($group, $time) + { + $beginDayTime = myself()->_getDaySeconds($time); + $now = myself()->_getNowTime(); + + $diff = $now - ($beginDayTime + $group * 24 * 3600); + if ($diff >= 0) { + return 1; + } else { + return 0; + } + } + + private function getStatusFromDB($conn) + { + // 从数据库中获取 status + $row = SqlHelper::selectOne( + $conn, + 't_first_topup', + array('createtime', 'status1', 'status2', 'status3'), + array('account_id' => myself()->_getAccountId()) + ); + + // 0 未领取 1 可领取 2 已领取 + $status = [(int)$row['status1'], (int)$row['status2'], (int)$row['status3']]; + $time = $row['createtime']; + + for ($i = 0; $i < 3; $i++) { + if ($status[$i] < 2) { + // 检测是否到了可以领取的时间 + $status[$i] = $this->getStatus($i, $time); + } + } + + return $status; + } + + private function internalAddItem($propertyChgService, $itemMeta, $count) + { + switch ($itemMeta['type']) { + case mt\Item::HERO_TYPE: { + Hero::addHero($itemMeta); + $propertyChgService->addHeroChg(); + $propertyChgService->addUserChg(); + } + break; + case mt\Item::HERO_SKIN_TYPE: { + HeroSkin::addSkin($itemMeta); + $propertyChgService->addHeroSkinChg(); + } + break; + case mt\Item::GUN_TYPE: { + Gun::addGun($itemMeta); + $propertyChgService->addGunChg(); + } + break; + case mt\Item::GUN_SKIN_TYPE: { + GunSkin::addSkin($itemMeta); + $propertyChgService->addGunSkinChg(); + } + break; + case mt\Item::CHIP_TYPE: { + Chip::addChip($itemMeta); + $propertyChgService->addChip(); + } + break; + default: { + Bag::addItem($itemMeta['id'], $count); + $propertyChgService->addBagChg(); + } + break; + } + } +} diff --git a/webapp/mt/FirstTopup.php b/webapp/mt/FirstTopup.php new file mode 100644 index 00000000..2353189b --- /dev/null +++ b/webapp/mt/FirstTopup.php @@ -0,0 +1,56 @@ + Date: Tue, 6 Jun 2023 11:37:27 +0800 Subject: [PATCH 06/10] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=96=87=E6=A1=A3?= =?UTF-8?q?=E6=A0=BC=E5=BC=8F=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- doc/FirstTopup.py | 19 +++------- doc/User.py | 35 +++++++++++++++++-- doc/_common.py | 11 ++++++ .../controller/BaseAuthedController.class.php | 1 + webapp/controller/UserController.class.php | 6 ++++ 5 files changed, 54 insertions(+), 18 deletions(-) diff --git a/doc/FirstTopup.py b/doc/FirstTopup.py index 06691804..712628e0 100644 --- a/doc/FirstTopup.py +++ b/doc/FirstTopup.py @@ -1,17 +1,6 @@ # -*- coding: utf-8 -*- import _common - -class Reward(object): - - def __init__(self): - self.fields = [ - ['id', 0, 'id'], - ['group', '', 'group'], - ['goods_id', 0, 'goods_id'], - ['goods_num', 0, '堆叠数量'], - ['shop_icon', 0, '商店图标'], - ] class FirstTopup(object): @@ -28,8 +17,8 @@ class FirstTopup(object): 'response': [ _common.RspHead(), ['complete', 0, '是否已经完成首充 0-未完成 1-已完成'], - ['firstTopupList', [Reward], '奖励信息'], - ['status', [0], '领取状态 0-未领取 1-可领取 2-已领取'], + ['!firstTopupList', [_common.Reward()], '奖励信息'], + ['!status', [0], '领取状态 0-未领取 1-可领取 2-已领取'], ] }, { @@ -56,8 +45,8 @@ class FirstTopup(object): 'response': [ _common.RspHead(), ['group', 0, '奖励组id'], - ['status', [0], '领取状态 0-未领取 1-可领取 2-已领取'], - ['reward', [Reward], '奖励信息'], + ['!status', [0], '领取状态 0-未领取 1-可领取 2-已领取'], + ['!reward', [_common.Reward()], '奖励信息'], ] }, ] diff --git a/doc/User.py b/doc/User.py index 757ba360..e5e2a325 100644 --- a/doc/User.py +++ b/doc/User.py @@ -139,7 +139,8 @@ class User(object): 'response': [ _common.RspHead(), ] - },{ + }, + { 'name': 'initRank', 'desc': '排位初始化段位', 'group': 'User', @@ -151,7 +152,8 @@ class User(object): _common.RspHead(), ['property_chg', _common.PropertyChg(), '属性变更'], ] - },{ + }, + { 'name': 'selectFreeItem', 'desc': '选择免费英雄和武器', 'group': 'User', @@ -165,7 +167,8 @@ class User(object): _common.RspHead(), ['property_chg', _common.PropertyChg(), '属性变更'], ] - },{ + }, + { 'name': 'getFreeItemList', 'desc': '获取免费英雄和武器列表', 'group': 'User', @@ -178,4 +181,30 @@ class User(object): ['!data', [], '列表'], ] }, + { + 'name': 'getFreeItemList', + 'desc': '获取免费英雄和武器列表', + 'group': 'User', + 'url': 'webapp/index.php?c=User&a=getFreeItemList', + 'params': [ + _common.ReqHead(), + ], + 'response': [ + _common.RspHead(), + ['!data', [], '列表'], + ] + }, + { + 'name': 'updateAddressBind', + 'desc': '更新钱包绑定信息', + 'group': 'User', + 'url': 'webapp/index.php?c=User&a=updateAddressBind', + 'params': [ + _common.ReqHead(), + ['jwt', '', 'jwt数据'], + ], + 'response': [ + _common.RspHead(), + ] + }, ] diff --git a/doc/_common.py b/doc/_common.py index 2da1295c..dbc4f354 100644 --- a/doc/_common.py +++ b/doc/_common.py @@ -1156,3 +1156,14 @@ class BattleReward(object): ['hero', BattleCegReward(), '英雄奖励'], ['!items', [BattleItemReward()], '碎片奖励'], ] + +class Reward(object): + + def __init__(self): + self.fields = [ + ['id', 0, 'id'], + ['group', '', 'group'], + ['goods_id', 0, 'goods_id'], + ['goods_num', 0, '堆叠数量'], + ['shop_icon', 0, '商店图标'], + ] diff --git a/webapp/controller/BaseAuthedController.class.php b/webapp/controller/BaseAuthedController.class.php index 2d8fbf63..e435fd0a 100644 --- a/webapp/controller/BaseAuthedController.class.php +++ b/webapp/controller/BaseAuthedController.class.php @@ -38,6 +38,7 @@ class BaseAuthedController extends BaseController { private $accountId = ''; private $sessionId = ''; private $mysqlConn = null; + private $address = null; private function isWhiteList() { diff --git a/webapp/controller/UserController.class.php b/webapp/controller/UserController.class.php index fc2ba4db..f3aa8410 100644 --- a/webapp/controller/UserController.class.php +++ b/webapp/controller/UserController.class.php @@ -800,6 +800,12 @@ class UserController extends BaseAuthedController { ]); } + public function updateAddressBind() + { + $hero_uniid = getReqVal('jwt', ''); + $this->_rspOk(); + } + private function dampingElo($userInfo){ //每天elo衰减 $time_diff = myself()->_getNowTime()-$userInfo['last_login_time']; From 35a104281d280fd3b2027196818513caccc2fdac Mon Sep 17 00:00:00 2001 From: songliang Date: Tue, 6 Jun 2023 11:53:19 +0800 Subject: [PATCH 07/10] ... --- .../controller/FirstTopupController.class.php | 69 +++++++++---------- 1 file changed, 34 insertions(+), 35 deletions(-) diff --git a/webapp/controller/FirstTopupController.class.php b/webapp/controller/FirstTopupController.class.php index e0600cec..d9999c32 100644 --- a/webapp/controller/FirstTopupController.class.php +++ b/webapp/controller/FirstTopupController.class.php @@ -92,7 +92,6 @@ class FirstTopupController extends BaseAuthedController array( 'status' . $group => 2, ), - ); // 发放奖励 $reward = mt\FirstTopup::getByGroup($group); @@ -161,38 +160,38 @@ class FirstTopupController extends BaseAuthedController private function internalAddItem($propertyChgService, $itemMeta, $count) { - switch ($itemMeta['type']) { - case mt\Item::HERO_TYPE: { - Hero::addHero($itemMeta); - $propertyChgService->addHeroChg(); - $propertyChgService->addUserChg(); - } - break; - case mt\Item::HERO_SKIN_TYPE: { - HeroSkin::addSkin($itemMeta); - $propertyChgService->addHeroSkinChg(); - } - break; - case mt\Item::GUN_TYPE: { - Gun::addGun($itemMeta); - $propertyChgService->addGunChg(); - } - break; - case mt\Item::GUN_SKIN_TYPE: { - GunSkin::addSkin($itemMeta); - $propertyChgService->addGunSkinChg(); - } - break; - case mt\Item::CHIP_TYPE: { - Chip::addChip($itemMeta); - $propertyChgService->addChip(); - } - break; - default: { - Bag::addItem($itemMeta['id'], $count); - $propertyChgService->addBagChg(); - } - break; - } - } + switch ($itemMeta['type']) { + case mt\Item::HERO_TYPE: { + Hero::addHero($itemMeta); + $propertyChgService->addHeroChg(); + $propertyChgService->addUserChg(); + } + break; + case mt\Item::HERO_SKIN_TYPE: { + HeroSkin::addSkin($itemMeta); + $propertyChgService->addHeroSkinChg(); + } + break; + case mt\Item::GUN_TYPE: { + Gun::addGun($itemMeta); + $propertyChgService->addGunChg(); + } + break; + case mt\Item::GUN_SKIN_TYPE: { + GunSkin::addSkin($itemMeta); + $propertyChgService->addGunSkinChg(); + } + break; + case mt\Item::CHIP_TYPE: { + Chip::addChip($itemMeta); + $propertyChgService->addChip(); + } + break; + default: { + Bag::addItem($itemMeta['id'], $count); + $propertyChgService->addBagChg(); + } + break; + } + } } From 14836acdab3206b4d06bb4cea03af92d1207b4c8 Mon Sep 17 00:00:00 2001 From: songliang Date: Tue, 6 Jun 2023 11:59:05 +0800 Subject: [PATCH 08/10] ... --- webapp/controller/FirstTopupController.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webapp/controller/FirstTopupController.class.php b/webapp/controller/FirstTopupController.class.php index d9999c32..c8f05008 100644 --- a/webapp/controller/FirstTopupController.class.php +++ b/webapp/controller/FirstTopupController.class.php @@ -91,7 +91,7 @@ class FirstTopupController extends BaseAuthedController ), array( 'status' . $group => 2, - ), + ) ); // 发放奖励 $reward = mt\FirstTopup::getByGroup($group); From 043cc60076a80d2005ce58884f822461f556b212 Mon Sep 17 00:00:00 2001 From: songliang Date: Tue, 6 Jun 2023 14:11:04 +0800 Subject: [PATCH 09/10] ... --- webapp/bootstrap/constant.php | 2 +- webapp/controller/FirstTopupController.class.php | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/webapp/bootstrap/constant.php b/webapp/bootstrap/constant.php index 749794d3..d00d8e92 100644 --- a/webapp/bootstrap/constant.php +++ b/webapp/bootstrap/constant.php @@ -24,7 +24,7 @@ define('TN_HERO_MAX_LEVEL', 8008); define('TN_LAST_RANKING_TIME', 8009); define('TN_MISSION_STAR_SEASON', 8010); define('TN_RANK_STATUS', 99999); - +define('TN_FIRST_TUPOP_STATUS', 8012); define('TN_DAILY_BEGIN', 9001); define('TN_DAILY_LOGINS', 9001); diff --git a/webapp/controller/FirstTopupController.class.php b/webapp/controller/FirstTopupController.class.php index c8f05008..b1dacdf6 100644 --- a/webapp/controller/FirstTopupController.class.php +++ b/webapp/controller/FirstTopupController.class.php @@ -26,6 +26,9 @@ class FirstTopupController extends BaseAuthedController // 检查所有 奖励都 领取完成 $complete = ($status[0] == 2 && $status[1] == 2 && $status[2] == 2) ? 1 : 0; + if ($complete == 1) { + $this->_setV(TN_FIRST_TUPOP_STATUS, 0, 1); + } $this->_rspData( array( @@ -106,6 +109,11 @@ class FirstTopupController extends BaseAuthedController } } + $complete = ($status[0] == 2 && $status[1] == 2 && $status[2] == 2) ? 1 : 0; + if ($complete == 1) { + $this->_setV(TN_FIRST_TUPOP_STATUS, 0, 1); + } + $this->_rspData( array( 'group' => $group, From 34cbb96dc165aa1748b26e3d8af2173f90d5ab48 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Tue, 6 Jun 2023 14:55:14 +0800 Subject: [PATCH 10/10] =?UTF-8?q?getBattleData=E6=B7=BB=E5=8A=A0rank?= =?UTF-8?q?=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- doc/Battle.py | 1 + webapp/controller/BattleController.class.php | 2 ++ 2 files changed, 3 insertions(+) diff --git a/doc/Battle.py b/doc/Battle.py index 0bf2731a..729c7924 100644 --- a/doc/Battle.py +++ b/doc/Battle.py @@ -125,6 +125,7 @@ class Battle(object): ['session_id','','session_id'], ['battle_uuid','','battle_uuid'], ['match_mode',0,'0:匹配 1:排位 2:pve'], + ['rank', 0, '当前段位'], ['name','','用户名字'], ['level',0,'用户等级'], ['revive_coin',0,'复活币'], diff --git a/webapp/controller/BattleController.class.php b/webapp/controller/BattleController.class.php index ed711803..0a74b2cb 100644 --- a/webapp/controller/BattleController.class.php +++ b/webapp/controller/BattleController.class.php @@ -216,6 +216,7 @@ class BattleController extends BaseAuthedController { 'account_id' => $account_id, 'session_id' => $session_id, 'battle_uuid' => $battle_uuid, + 'rank' => 0, 'name' => '', 'level' =>'', 'hero_uniid' => '', @@ -243,6 +244,7 @@ class BattleController extends BaseAuthedController { $userDb = User::find($account_id); if ($userDb){ $userPresetInfo = User::toPreset($userDb); + $info['rank'] = $userDb['rank']; $info['name'] = $userPresetInfo['name']; $info['level'] = $userPresetInfo['level']; $info['parachute'] = $userPresetInfo['parachute'];