<?php

namespace App\Form\Models;

use App\Models\BaseModel;

class FormInfoModel extends BaseModel
{
    protected $table = 'form_info';


    /**
     * 检查 名称是否唯一
     * */
    public function checkNameUnique($name,$id=0){
        $where=[];
        if(!empty($id)){
            $where[]=['id', '<>', $id];
        }
        $where[]=['status', '<', 2];
        $where[]=['name', '=', trim($name)];
        return $this->checkFieldUnique('name',$where);
    }


}
