1
This commit is contained in:
parent
5a5cfa57ee
commit
385dc0dfd9
@ -268,6 +268,7 @@ class BattleController extends BaseAuthedController {
|
||||
}
|
||||
}
|
||||
}
|
||||
$accountIdPair = array();
|
||||
foreach ($realPlayerHash as $accountId) {
|
||||
foreach ($realPlayerHashCopy as $accountIdCopy) {
|
||||
if ($accountId != $accountIdCopy) {
|
||||
@ -277,9 +278,36 @@ class BattleController extends BaseAuthedController {
|
||||
$accountId1 = $accountIdCopy;
|
||||
$accountId2 = $accountId;
|
||||
}
|
||||
$key = $accountId . '|' . $accountId2;
|
||||
if (!array_key_exists($key, $accountIdPair)) {
|
||||
$accountIdPair[$key] = array($accountId1, $accountId2);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
$nowTime = myself()->_getNowTime();
|
||||
foreach ($accountIdPair as $pair) {
|
||||
$accountId1 = $pair[0];
|
||||
$accountId2 = $pair[1];
|
||||
SqlHelper::Upsert(
|
||||
myself()->__getRelationDbMysql(),
|
||||
't_recent_battle',
|
||||
array(
|
||||
'account_id1' => $accountId1,
|
||||
'account_id2' => $accountId2,
|
||||
),
|
||||
array(
|
||||
'last_battle_time' => $nowTime,
|
||||
),
|
||||
array(
|
||||
'account_id1' => $accountId1,
|
||||
'account_id2' => $accountId2,
|
||||
'last_battle_time' => $nowTime,
|
||||
'createtime' => $nowTime,
|
||||
'modifytime' => $nowTime,
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
x
Reference in New Issue
Block a user