Skip to content

Commit

Permalink
Удалил миграции полей ip
Browse files Browse the repository at this point in the history
  • Loading branch information
visavi committed Nov 23, 2020
1 parent 81520bd commit 9fd0ba0
Show file tree
Hide file tree
Showing 24 changed files with 91 additions and 550 deletions.
41 changes: 21 additions & 20 deletions app/Models/Advert.php
Expand Up @@ -41,34 +41,35 @@ class Advert extends BaseModel
*/
public static function statAdverts(): array
{
if (setting('rekusershow')) {
return Cache::remember('adverts', 1800, static function () {
if (! setting('rekusershow')) {
return [];
}

$data = self::query()->where('deleted_at', '>', SITETIME)->get();
return Cache::remember('adverts', 1800, static function () {
$data = self::query()->where('deleted_at', '>', SITETIME)->get();

$links = [];
if ($data->isNotEmpty()) {
foreach ($data as $val) {
$name = check($val->name);
if ($data->isEmpty()) {
return [];
}

if ($val->color) {
$name = '<span style="color:' . $val->color . '">' . $name . '</span>';
}
$links = [];
foreach ($data as $val) {
$name = check($val->name);

$link = '<a href="' . $val->site . '" target="_blank" rel="nofollow">' . $name . '</a>';
if ($val->color) {
$name = '<span style="color:' . $val->color . '">' . $name . '</span>';
}

if ($val->bold) {
$link = '<b>' . $link . '</b>';
}
$link = '<a href="' . $val->site . '" target="_blank" rel="nofollow">' . $name . '</a>';

$links[] = $link;
}
if ($val->bold) {
$link = '<b>' . $link . '</b>';
}

return $links;
});
}
$links[] = $link;
}

return [];
return $links;
});
}
}
24 changes: 1 addition & 23 deletions app/Models/BaseModel.php
Expand Up @@ -66,34 +66,12 @@ public function user(): BelongsTo
/**
* Возвращает логин пользователя
*
* @param string $value
* @param string|null $value
*
* @return string
*/
public function getLoginAttribute($value): string
{
return $value ?? setting('deleted_user');
}

/**
* Get packed IP
*
* @param string $value
*
* @return string|false
*/
/* public function getIpAttribute($value)
{
return inet_ntop($value);
}*/

/**
* Set packed IP
*
* @param string $value
*/
/* public function setIpAttribute($value): void
{
$this->attributes['ip'] = inet_pton($value);
}*/
}

0 comments on commit 9fd0ba0

Please sign in to comment.