<?php
declare (strict_types = 1);

namespace app\index\model;

use app\common\model\VideoCategoryBaseModel;
use think\model\concern\SoftDelete;

/**
 * 视频分类模型
 * @mixin \think\Model
 */
class VideoCategoryModel extends VideoCategoryBaseModel
{
    // 启用软删除
    use SoftDelete;
    // 软删除字段
    protected $deleteTime = 'deleted_at';

    // 所属语言范围查询
    public function scopeLanguage($query, $language)
    {
        $query->where('language_id', '=', $language);
    }

    // 是否显示状态范围查询
    public function scopeIsShow($query, bool $is_show)
    {
        $query->where('is_show', '=', (int)$is_show);
    }
}
