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.
|
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Models;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Ticket Model
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
class Ticket extends Model
|
|
|
|
|
{
|
|
|
|
|
protected $connection = "default";
|
|
|
|
|
protected $table = "ticket";
|
|
|
|
|
|
|
|
|
|
public function datetime()
|
|
|
|
|
{
|
|
|
|
|
return date("Y-m-d H:i:s", $this->attributes['datetime']);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function datetimeTimestamp(): int
|
|
|
|
|
{
|
|
|
|
|
return max(0, (int) ($this->attributes['datetime'] ?? 0));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function lastActivity()
|
|
|
|
|
{
|
|
|
|
|
$timestamp = $this->attributes['last_activity_at'] ?? $this->attributes['datetime'];
|
|
|
|
|
return date("Y-m-d H:i:s", (int) $timestamp);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function lastActivityTimestamp(): int
|
|
|
|
|
{
|
|
|
|
|
return max(0, (int) ($this->attributes['last_activity_at']
|
|
|
|
|
?? $this->attributes['datetime'] ?? 0));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|