* further optimize search
   - use achievement 4496 as shortcut for everything based around total achievement points
   - get talent distribution separately
   - get total profiler-items found separately
   - opt to not sort found results
 * fixed Profiles with zero Achievement Points
 * added cache key genrator i forgot :<
 * fixed typos
This commit is contained in:
Sarjuuk
2018-03-28 20:34:18 +02:00
parent 431e984f03
commit bf42973c00
49 changed files with 117 additions and 86 deletions

View File

@@ -257,12 +257,24 @@ abstract class BaseType
// execute query (finally)
$mtch = 0;
$rows = [];
// this is purely because of multiple realms per server
foreach ($this->dbNames as $dbIdx => $n)
{
$query = str_replace('DB_IDX', $dbIdx, $this->queryBase);
if ($rows = DB::{$n}($dbIdx)->SelectPage($mtch, $query))
if (key($this->dbNames) === 0)
{
if ($rows = DB::{$n}($dbIdx)->select($query))
{
$mtchQry = preg_replace('/SELECT .*? FROM/', 'SELECT count(1) FROM', $this->queryBase);
$mtch = DB::{$n}($dbIdx)->selectCell($mtchQry);
}
}
else
$rows = DB::{$n}($dbIdx)->SelectPage($mtch, $query);
if ($rows)
{
$this->matches += $mtch;
foreach ($rows as $id => $row)