From a1d3be86f7e85622067b74b0c5d7ca2cb00281bb Mon Sep 17 00:00:00 2001 From: Sarjuuk Date: Sat, 9 May 2020 16:46:11 +0200 Subject: [PATCH] Profiler/Talents * fixed column reference changed in https://github.com/TrinityCore/TrinityCore/commit/f8230a59a9e878a6f54f421d6621f1595bd93861 --- includes/profiler.class.php | 8 ++++---- includes/types/item.class.php | 2 +- includes/types/profile.class.php | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/includes/profiler.class.php b/includes/profiler.class.php index e27feb4e..aec7039f 100644 --- a/includes/profiler.class.php +++ b/includes/profiler.class.php @@ -413,14 +413,14 @@ class Profiler /* talents + glyphs */ /********************/ - $t = DB::Characters($realmId)->selectCol('SELECT spec AS ARRAY_KEY, spell AS ARRAY_KEY2, spell FROM character_talent WHERE guid = ?d', $char['guid']); - $g = DB::Characters($realmId)->select('SELECT spec AS ARRAY_KEY, glyph1 AS g1, glyph2 AS g4, glyph3 AS g5, glyph4 AS g2, glyph5 AS g3, glyph6 AS g6 FROM character_glyphs WHERE guid = ?d', $char['guid']); + $t = DB::Characters($realmId)->selectCol('SELECT talentGroup AS ARRAY_KEY, spell AS ARRAY_KEY2, spell FROM character_talent WHERE guid = ?d', $char['guid']); + $g = DB::Characters($realmId)->select('SELECT talentGroup AS ARRAY_KEY, glyph1 AS g1, glyph2 AS g4, glyph3 AS g5, glyph4 AS g2, glyph5 AS g3, glyph6 AS g6 FROM character_glyphs WHERE guid = ?d', $char['guid']); for ($i = 0; $i < 2; $i++) { // talents for ($j = 0; $j < 3; $j++) { - $_ = DB::Aowow()->selectCol('SELECT spell AS ARRAY_KEY, MAX(IF(spell in (?a), rank, 0)) FROM ?_talents WHERE class = ?d AND tab = ?d GROUP BY id ORDER BY row, col ASC', !empty($t[$i]) ? $t[$i] : [0], $char['class'], $j); + $_ = DB::Aowow()->selectCol('SELECT spell AS ARRAY_KEY, MAX(IF(spell IN (?a), rank, 0)) FROM ?_talents WHERE class = ?d AND tab = ?d GROUP BY id ORDER BY row, col ASC', !empty($t[$i]) ? $t[$i] : [0], $char['class'], $j); $data['talentbuild'.($i + 1)] .= implode('', $_); if ($char['activespec'] == $i) $data['talenttree'.($j + 1)] = array_sum($_); @@ -496,7 +496,7 @@ class Profiler $morePet = DB::Aowow()->selectRow('SELECT p.`type`, c.family FROM ?_pet p JOIN ?_creature c ON c.family = p.id WHERE c.id = ?d', $petData['entry']); $petSpells = DB::Characters($realmId)->selectCol('SELECT spell FROM pet_spell WHERE guid = ?d', $petGuid); - $_ = DB::Aowow()->selectCol('SELECT spell AS ARRAY_KEY, MAX(IF(spell in (?a), rank, 0)) FROM ?_talents WHERE class = 0 AND petTypeMask = ?d GROUP BY id ORDER BY row, col ASC', $petSpells ?: [0], 1 << $morePet['type']); + $_ = DB::Aowow()->selectCol('SELECT spell AS ARRAY_KEY, MAX(IF(spell IN (?a), rank, 0)) FROM ?_talents WHERE class = 0 AND petTypeMask = ?d GROUP BY id ORDER BY row, col ASC', $petSpells ?: [0], 1 << $morePet['type']); $pet = array( 'id' => $petGuid, 'owner' => $profileId, diff --git a/includes/types/item.class.php b/includes/types/item.class.php index 2cfa3b6a..d19f6e35 100644 --- a/includes/types/item.class.php +++ b/includes/types/item.class.php @@ -2363,7 +2363,7 @@ class ItemListFilter extends Filter { // todo: do something sensible.. // // todo (med): get the avgbuyout into the listview - // if ($_ = DB::Characters()->select('SELECT ii.itemEntry AS ARRAY_KEY, AVG(ah.buyoutprice / ii.count) AS buyout FROM auctionhouse ah JOIN item_instance ii ON ah.itemguid = ii.guid GROUP BY ii.itemEntry HAVING avgbuyout '.$cr[1].' ?f', $c[1])) + // if ($_ = DB::Characters()->select('SELECT ii.itemEntry AS ARRAY_KEY, AVG(ah.buyoutprice / ii.count) AS buyout FROM auctionhouse ah JOIN item_instance ii ON ah.itemguid = ii.guid GROUP BY ii.itemEntry HAVING buyout '.$cr[1].' ?f', $c[1])) // return ['i.id', array_keys($_)]; // else // return [0]; diff --git a/includes/types/profile.class.php b/includes/types/profile.class.php index ec777362..0582600d 100644 --- a/includes/types/profile.class.php +++ b/includes/types/profile.class.php @@ -614,7 +614,7 @@ class RemoteProfileList extends ProfileList } foreach ($talentLookup as $realm => $chars) - $talentLookup[$realm] = DB::Characters($realm)->selectCol('SELECT guid AS ARRAY_KEY, spell AS ARRAY_KEY2, spec FROM character_talent ct WHERE guid IN (?a)', array_keys($chars)); + $talentLookup[$realm] = DB::Characters($realm)->selectCol('SELECT guid AS ARRAY_KEY, spell AS ARRAY_KEY2, talentGroup FROM character_talent ct WHERE guid IN (?a)', array_keys($chars)); $talentSpells = DB::Aowow()->select('SELECT spell AS ARRAY_KEY, tab, rank FROM ?_talents WHERE class IN (?a)', array_unique($talentSpells));