2023-11-17 01:44:01 -05:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Models;
|
|
|
|
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
|
|
|
|
class Ticket extends Model
|
|
|
|
{
|
|
|
|
protected $table = 'v2_ticket';
|
|
|
|
protected $dateFormat = 'U';
|
|
|
|
protected $guarded = ['id'];
|
|
|
|
protected $casts = [
|
|
|
|
'created_at' => 'timestamp',
|
|
|
|
'updated_at' => 'timestamp'
|
|
|
|
];
|
2023-12-11 17:22:18 -05:00
|
|
|
|
2024-04-09 12:51:03 -04:00
|
|
|
const STATUS_OPENING = 0;
|
|
|
|
const STATUS_CLOSED = 1;
|
|
|
|
public static $statusMap = [
|
|
|
|
self::STATUS_OPENING => '开启',
|
|
|
|
self::STATUS_CLOSED => '关闭'
|
|
|
|
];
|
2023-12-11 17:22:18 -05:00
|
|
|
|
|
|
|
public function message()
|
|
|
|
{
|
|
|
|
return $this->hasMany(TicketMessage::class, 'ticket_id', 'id');
|
|
|
|
}
|
2023-11-17 01:44:01 -05:00
|
|
|
}
|