You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
569 B
PHTML
29 lines
569 B
PHTML
|
10 years ago
|
<?php
|
||
|
|
|
||
|
|
|
||
|
|
namespace App\Models;
|
||
|
|
|
||
|
|
use App\Utils\Tools;
|
||
|
|
|
||
|
|
class UnblockIp extends Model
|
||
|
|
{
|
||
|
|
protected $connection = "default";
|
||
|
|
protected $table = "unblockip";
|
||
|
|
|
||
|
|
public function user()
|
||
|
|
{
|
||
|
|
$user = User::where("id", $this->attributes['userid'])->first();
|
||
|
|
if ($user == null) {
|
||
|
|
UnblockIp::where('id', '=', $this->attributes['id'])->delete();
|
||
|
|
return null;
|
||
|
|
} else {
|
||
|
|
return $user;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
public function time()
|
||
|
|
{
|
||
|
|
return date("Y-m-d H:i:s", $this->attributes['datetime']);
|
||
|
|
}
|
||
|
|
}
|