Сохранение ID точки в источниках картинок

This commit is contained in:
Krivchikov Dmitry 2015-05-31 16:00:15 +03:00
parent ec8ffbd82a
commit 4eae03462f
1 changed files with 3 additions and 1 deletions

View File

@ -16,7 +16,9 @@ class PhotoLinks extends Model
static function addLink($photo, $url)
{
$parsedUrl = parse_url($url);
App::DB()->query('INSERT INTO photoLinks VALUES ("'.$photo.'","'.$url.'","'.$parsedUrl['host'].'") ON DUPLICATE KEY UPDATE url=url;');
$photoDetails = explode('_', $photo);
$pointId = (int)$photoDetails[0];
App::DB()->query('INSERT INTO photoLinks VALUES ("'.$photo.'", "'.$pointId.'","'.$url.'","'.$parsedUrl['host'].'") ON DUPLICATE KEY UPDATE url=url;');
}
static function getCaption($photo)