<?php

namespace App\Models;

use Illuminate\Support\Facades\DB;

class Message extends BaseModel
{

    protected $table = "message";
    public $timestamps = false;

    public function add($title, $content, $from, $to, $type = 1, $addStatus = 2)
    {
        $data = ['title' => $title,
            'content' => $content,
            'formname' => $from,
            'toname' => $to,
            'add_time' => date ('Y-m-d H:i:s'),
            'type' => $type,
            'add_status' => $addStatus
        ];
        return self::insert ($data);
    }
}
