This commit is contained in:
aozhiwei 2024-04-16 11:52:53 +08:00
parent a60044fb90
commit c47ad75762

View File

@ -268,9 +268,10 @@ class BattleController extends BaseAuthedController {
} }
} }
} }
error_log(json_encode($realPlayerHash));
$accountIdPair = array(); $accountIdPair = array();
foreach ($realPlayerHash as $accountId) { foreach ($realPlayerHash as $accountId => $val) {
foreach ($realPlayerHashCopy as $accountIdCopy) { foreach ($realPlayerHashCopy as $accountIdCopy => $valCopy) {
if ($accountId != $accountIdCopy) { if ($accountId != $accountIdCopy) {
$accountId1 = $accountId; $accountId1 = $accountId;
$accountId2 = $accountIdCopy; $accountId2 = $accountIdCopy;
@ -285,12 +286,13 @@ class BattleController extends BaseAuthedController {
} }
} }
} }
error_log(json_encode($accountIdPair));
$nowTime = myself()->_getNowTime(); $nowTime = myself()->_getNowTime();
foreach ($accountIdPair as $pair) { foreach ($accountIdPair as $pair) {
$accountId1 = $pair[0]; $accountId1 = $pair[0];
$accountId2 = $pair[1]; $accountId2 = $pair[1];
SqlHelper::Upsert( SqlHelper::Upsert(
myself()->__getRelationDbMysql(), myself()->_getRelationDbMysql(),
't_recent_battle', 't_recent_battle',
array( array(
'account_id1' => $accountId1, 'account_id1' => $accountId1,