FIX - мелкая ошибка при сохранении ссылки на исходную фотку
This commit is contained in:
parent
2607750376
commit
6ba76ab818
|
|
@ -17,9 +17,13 @@ class PhotoLinks extends Model
|
||||||
static function addLink($photo, $url)
|
static function addLink($photo, $url)
|
||||||
{
|
{
|
||||||
$parsedUrl = parse_url($url);
|
$parsedUrl = parse_url($url);
|
||||||
|
$host = isset($parsedUrl['host']) ? $parsedUrl['host'] : '';
|
||||||
$photoDetails = explode('_', $photo);
|
$photoDetails = explode('_', $photo);
|
||||||
$pointId = (int) $photoDetails[0];
|
$pointId = isset($photoDetails[0]) ? (int) $photoDetails[0] : 0;
|
||||||
App::DB()->query('INSERT INTO photoLinks VALUES ("' . $photo . '", "' . $pointId . '","' . $url . '","' . $parsedUrl['host'] . '") ON DUPLICATE KEY UPDATE url=url;');
|
|
||||||
|
if ($pointId) {
|
||||||
|
App::DB()->query('INSERT INTO photoLinks VALUES ("' . $photo . '", "' . $pointId . '","' . $url . '","' . $host . '") ON DUPLICATE KEY UPDATE url=url;');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static function getCaption($photo)
|
static function getCaption($photo)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue