<?php
/**
 * Created by PhpStorm.
 * User: tandunzhao
 * Date: 2017/11/17
 * Time: 下午4:44
 */

namespace App\Modules\Notice\Models;

use Illuminate\Database\Eloquent\Model;

/**
 * Class NoticeType 公告类型
 * @package App\Modules\Notice\Models
 */
class NoticeType extends Model
{
    protected $table = 'notice_types';

    protected $fillable = ['name'];

    static function isNameExist($name) {
        $num = self::where('name', '=', $name)
            ->select('id')
            ->count();

        if($num > 0) {
            return true;
        } else {
            return false;
        }
    }
}