mirror of
https://github.com/brian8544/turtle-wow.git
synced 2025-01-05 14:24:34 +00:00
31 lines
687 B
PHP
31 lines
687 B
PHP
<?php
|
|
|
|
namespace App\Models\auth;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class Uptime extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
protected $connection = 'mysql2';
|
|
|
|
protected $table = 'uptime';
|
|
|
|
public function getUptime()
|
|
{
|
|
$days = floor($this->uptime / (60 * 60 * 24));
|
|
$hours = floor(($this->uptime % (60 * 60 * 24)) / (60 * 60));
|
|
$minutes = floor(($this->uptime % (60 * 60)) / 60);
|
|
$seconds = $this->uptime % 60;
|
|
|
|
return array(
|
|
'days' => $days,
|
|
'hours' => $hours,
|
|
'minutes' => $minutes,
|
|
'seconds' => $seconds
|
|
);
|
|
}
|
|
}
|