'timestamp', 'updated_at' => 'timestamp' ]; const STATUS_OPENING = 0; const STATUS_CLOSED = 1; public static $statusMap = [ self::STATUS_OPENING => '开启', self::STATUS_CLOSED => '关闭' ]; public function user() { return $this->belongsTo(User::class, 'user_id', 'id'); } public function messages() { return $this->hasMany(TicketMessage::class, 'ticket_id', 'id'); } // 即将删除 public function message() { return $this->hasMany(TicketMessage::class, 'ticket_id', 'id'); } }