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.
ss-panel-v3-mod_Uim2/app/Models/Ticket.php

29 lines
539 B
PHP

<?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 User()
{
$user = User::where('id', $this->attributes['userid'])->first();
if ($user == null) {
self::where('id', '=', $this->attributes['id'])->delete();
return null;
}
return $user;
}
}