mirror of
https://github.com/Shadowss/TravianZ.git
synced 2026-07-24 13:36:32 +00:00
refactor: SQL optimizations
This commit is contained in:
@@ -5298,7 +5298,7 @@ $wallimg = "<img src=\"".GP_LOCATE."img/g/g3".$targettribe."Icon.gif\" height=\"
|
||||
private function artefactOfTheFool() {
|
||||
global $database;
|
||||
$time = time();
|
||||
$q = "SELECT * FROM " . TB_PREFIX . "artefacts where type = 8 and active = 1 and $time - lastupdate >= 86400";
|
||||
$q = "SELECT * FROM " . TB_PREFIX . "artefacts where type = 8 and active = 1 and lastupdate <= ".($time - 86400);
|
||||
$array = $database->query_return($q);
|
||||
foreach($array as $artefact) {
|
||||
$kind = rand(1,7);
|
||||
|
||||
@@ -3977,7 +3977,7 @@ class MYSQLi_DB {
|
||||
function getFoolArtefactInfo($type,$vid,$uid) {
|
||||
list($type,$vid,$uid) = $this->escape_input((int) $type,(int) $vid,(int) $uid);
|
||||
|
||||
$q = "SELECT * FROM " . TB_PREFIX . "artefacts WHERE vref = $vid AND type = 8 AND kind = $type OR owner = $uid AND size > 1 AND active = 1 AND type = 8 AND kind = $type";
|
||||
$q = "SELECT * FROM " . TB_PREFIX . "artefacts WHERE vref = $vid AND ((type = 8 AND kind = $type) OR (owner = $uid AND size > 1 AND active = 1 AND type = 8 AND kind = $type))";
|
||||
$result = mysqli_query($this->dblink,$q);
|
||||
return $this->mysqli_fetch_all($result);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user