| 1234567891011121314151617181920212223242526272829303132333435363738394041 | <?phpnamespace app\common\model;use think\Model;//use app\common\library\Easemob;/** * 系统消息模型 */class Message extends Model{    // 开启自动写入时间戳字段    protected $autoWriteTimestamp = 'int';    // 定义时间戳字段名    protected $createTime = 'createtime';    /**     * 添加系统消息     */    public static function addMessage($dt_id,$dt_user_id,$to_user_id,$user_id,$title,$content,$infotype = '',$infotype_id = 0) {        if(!$to_user_id || !$user_id || !$title || !$content) {            return false;        }        //入库        $data = [];        $data["dt_id"] = $dt_id;        $data["dt_user_id"] = $dt_user_id;        $data["to_user_id"] = $to_user_id;        $data["user_id"] = $user_id;        $data["title"] = $title;        $data["content"] = $content;        $data["createtime"] = time();        $data["status"] = 0;        $data["infotype"] = $infotype;        $data["infotype_id"] = $infotype_id;        return self::insertGetId($data);    }}
 |