<?php
declare (strict_types = 1);

namespace app\index\model;

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

/**
 * 产品分类推荐模型
 * @mixin \think\Model
 */
class ProductCategoryRecommendModel extends ProductCategoryRecommendBaseModel
{
    // 启用软件删除
    use SoftDelete;
    // 软件删除时间字段
    protected $deleteTime = 'deleted_at';

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

    public function scopeDisabled($query, $disabled = true)
    {
        $query->where($this->getTable() . '.disabled', '=', (int)$disabled);
    }
}
