<?php

namespace app\admin\model;

use app\BaseModel;
class Complaint extends BaseModel
{
    
    protected $autoWriteTimestamp = true;
    protected $createTime = 'created_at';
    protected $updateTime = 'updated_at';
    public function user()
    {
        return $this->hasOne(User::class, 'user_id', 'user_id')->field(['user_id','realname','account','avatar']);
    }

    public function complaintItem()
    {
        return $this->hasOne(ComplaintItem::class, 'id', 'complaint_item_id')->field(['id','level','name']);
    }

    public function operation()
    {
        return $this->hasOne(Admin::class, 'id', 'operation_id')->field(['id','nickname']);
    }

}
