This commit is contained in:
aozhiwei 2024-04-16 10:49:26 +08:00
parent da08012e00
commit 5a5cfa57ee

View File

@ -252,9 +252,36 @@ class BattleController extends BaseAuthedController {
}
}
$this->switchAccount(getReqVal('account_id', 0));
$this->updateRecentBattle($input['team_list']);
$this->_rspOk();
}
private function updateRecentBattle($teamList)
{
$realPlayerHash = array();
$realPlayerHashCopy = array();
foreach ($teamList as $team) {
foreach ($team as $member) {
if (!myself()->_isAndroidAccountId($member['account_id'])) {
$realPlayerHash[$member['account_id']] = 1;
$realPlayerHashCopy[$member['account_id']] = 1;
}
}
}
foreach ($realPlayerHash as $accountId) {
foreach ($realPlayerHashCopy as $accountIdCopy) {
if ($accountId != $accountIdCopy) {
$accountId1 = $accountId;
$accountId2 = $accountIdCopy;
if ($accountId > $accountIdCopy) {
$accountId1 = $accountIdCopy;
$accountId2 = $accountId;
}
}
}
}
}
/*
http post
php://input