mirror of
https://github.com/Sarjuuk/aowow.git
synced 2025-11-29 15:58:16 +08:00
Setup/Titles
* fixed title sources, where one title has multiple sources
This commit is contained in:
@@ -1181,14 +1181,19 @@ function source(array $ids = [])
|
|||||||
# 12: Achievement
|
# 12: Achievement
|
||||||
CLISetup::log(' * #12 Achievement');
|
CLISetup::log(' * #12 Achievement');
|
||||||
$sets = DB::World()->select('
|
$sets = DB::World()->select('
|
||||||
SELECT ?d, IF (title_A <> 0, title_A, title_H) AS title, 1, ?d, entry FROM achievement_reward WHERE title_A <> 0 OR title_H <> 0 GROUP BY title
|
SELECT titleId AS ARRAY_KEY, MIN(entry) AS srcId, NULLIF(MAX(entry), MIN(entry)) AS altSrcId FROM (
|
||||||
|
SELECT title_A as `titleId`, entry FROM achievement_reward WHERE title_A <> 0
|
||||||
UNION
|
UNION
|
||||||
SELECT ?d, title_H AS title, 1, ?d, entry FROM achievement_reward WHERE title_A <> title_H AND title_A <> 0 AND title_H <> 0',
|
SELECT title_H as `titleId`, entry FROM achievement_reward WHERE title_H <> 0
|
||||||
TYPE_TITLE, TYPE_ACHIEVEMENT,
|
) AS x GROUP BY titleId'
|
||||||
TYPE_TITLE, TYPE_ACHIEVEMENT
|
|
||||||
);
|
);
|
||||||
if ($sets)
|
foreach ($sets as $tId => $set)
|
||||||
DB::Aowow()->query(queryfy('[V]', $sets, $insMore), 12, 12, 12);
|
{
|
||||||
|
DB::Aowow()->query(queryfy('[V]', [[TYPE_TITLE, $tId, 1, TYPE_ACHIEVEMENT, $set['srcId']]], $insMore), 12, 12, 12);
|
||||||
|
|
||||||
|
if ($set['altSrcId'])
|
||||||
|
DB::Aowow()->query('UPDATE ?_titles SET src12Ext = ?d WHERE id = ?d', $set['altSrcId'], $tId);
|
||||||
|
}
|
||||||
|
|
||||||
# 13: Source-String
|
# 13: Source-String
|
||||||
CLISetup::log(' * #13 cuStrings');
|
CLISetup::log(' * #13 cuStrings');
|
||||||
|
|||||||
@@ -97,11 +97,6 @@ function titles()
|
|||||||
DB::Aowow()->query('UPDATE ?_titles SET side = 2 WHERE id <= 28 OR id IN (118, 119, 116, 117, 110, 127)');
|
DB::Aowow()->query('UPDATE ?_titles SET side = 2 WHERE id <= 28 OR id IN (118, 119, 116, 117, 110, 127)');
|
||||||
DB::Aowow()->query('UPDATE ?_titles SET side = 1 WHERE id <= 14 OR id IN (111, 115, 112, 114, 126)');
|
DB::Aowow()->query('UPDATE ?_titles SET side = 1 WHERE id <= 14 OR id IN (111, 115, 112, 114, 126)');
|
||||||
|
|
||||||
// ! src12Ext pendant in source-script !
|
|
||||||
$doubles = DB::World()->selectCol('SELECT IF(title_A, title_A, title_H) AS ARRAY_KEY, GROUP_CONCAT(entry SEPARATOR " "), count(1) FROM achievement_reward WHERE title_A <> 0 OR title_H <> 0 GROUP BY ARRAY_KEY HAVING count(1) > 1');
|
|
||||||
foreach ($doubles as $tId => $acvIds)
|
|
||||||
DB::Aowow()->query('UPDATE ?_titles SET src12Ext = ?d WHERE id = ?d', explode(' ', $acvIds)[1], $tId);
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user