refactor: SQL optimizations

This commit is contained in:
Martin Ambrus
2017-10-23 00:33:13 +02:00
parent e19a039d28
commit b8de6338bf
6 changed files with 175 additions and 120 deletions
+1 -1
View File
@@ -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);