mirror of
https://github.com/Sarjuuk/aowow.git
synced 2025-11-29 15:58:16 +08:00
Setup/Sqlgen
* fixed setup skipping custom data if it was >stepSize away from the last entry
This commit is contained in:
@@ -116,19 +116,22 @@ function items(array $ids = [])
|
||||
spell_group sg ON sg.spell_id = it.spellid_1 AND it.class = 0 AND it.subclass = 2 AND sg.id IN (1, 2)
|
||||
LEFT JOIN
|
||||
game_event ge ON ge.holiday = it.HolidayId AND it.HolidayId > 0
|
||||
{
|
||||
WHERE
|
||||
ct.entry IN (?a)
|
||||
it.entry > ?d
|
||||
{
|
||||
AND it.entry IN (?a)
|
||||
}
|
||||
LIMIT
|
||||
?d, ?d';
|
||||
?d';
|
||||
|
||||
$offset = 0;
|
||||
while ($items = DB::World()->select($baseQuery, $ids ?: DBSIMPLE_SKIP, $offset, SqlGen::$stepSize))
|
||||
$lastMax = 0;
|
||||
while ($items = DB::World()->select($baseQuery, $lastMax, $ids ?: DBSIMPLE_SKIP, $offset, SqlGen::$stepSize))
|
||||
{
|
||||
CLISetup::log(' * sets '.($offset + 1).' - '.($offset + count($items)));
|
||||
$newMax = max(array_column($items, 'entry'));
|
||||
|
||||
$offset += SqlGen::$stepSize;
|
||||
CLISetup::log(' * sets '.($lastMax + 1).' - '.$newMax);
|
||||
|
||||
$lastMax = $newMax;
|
||||
|
||||
foreach ($items as $item)
|
||||
DB::Aowow()->query('REPLACE INTO ?_items VALUES (?a)', array_values($item));
|
||||
|
||||
Reference in New Issue
Block a user