admin/app/common/model/supplier/Category.php
@@ -2,6 +2,7 @@
namespace app\common\model\supplier;
use app\common\enum\supplier\SupplierType;
use app\common\model\BaseModel;
/**
@@ -11,6 +12,7 @@
{
    protected $name = 'supplier_category';
    protected $pk = 'category_id';
    protected $append = ['type_text'];
    /**
     * 所有分类
@@ -19,12 +21,21 @@
     * @throws \think\db\exception\DbException
     * @throws \think\db\exception\ModelNotFoundException
     */
    public static function getALL()
    public static function getALL($params = [])
    {
        $model = new static;
        !empty($params['category_type']) && $model=$model->where('category_type','=',$params['category_type']);
        return $model->order(['sort' => 'asc', 'create_time' => 'asc'])->select();
    }
    /**
     * 分类类型文本
     */
    public function getTypeTextAttr($value, $data)
    {
        return (new SupplierType())::getName($data['category_type']);
    }
    /**
     * 详情
     */
    public static function detail($category_id)