|
|
|
@ -143,6 +143,7 @@ class MySQL {
@@ -143,6 +143,7 @@ class MySQL {
|
|
|
|
|
`hostPage`.`metaDescription`, |
|
|
|
|
`hostPage`.`data`, |
|
|
|
|
`hostPage`.`uri`, |
|
|
|
|
`hostPage`.`rank`, |
|
|
|
|
`host`.`scheme`, |
|
|
|
|
`host`.`name`, |
|
|
|
|
`host`.`port` |
|
|
|
@ -204,6 +205,22 @@ class MySQL {
@@ -204,6 +205,22 @@ class MySQL {
|
|
|
|
|
return $query->rowCount(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public function updateHostPageRank(int $hostId, |
|
|
|
|
int $crc32uri, |
|
|
|
|
int $increment) { |
|
|
|
|
|
|
|
|
|
$query = $this->_db->prepare('UPDATE `hostPage` SET `rank` = `rank` + ' . (int) $increment . ' |
|
|
|
|
|
|
|
|
|
WHERE `hostId` = ? |
|
|
|
|
AND `crc32uri` = ? |
|
|
|
|
|
|
|
|
|
LIMIT 1'); |
|
|
|
|
|
|
|
|
|
$query->execute([$hostId, $crc32uri]); |
|
|
|
|
|
|
|
|
|
return $query->rowCount(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public function deleteHostPage(int $hostPageId) { |
|
|
|
|
|
|
|
|
|
$query = $this->_db->prepare('DELETE FROM `hostPage` WHERE `hostPageId` = ? LIMIT 1'); |
|
|
|
|