<?php

namespace app\extra\service\blue;

use app\extra\basic\Service;
use app\model\blue\BlueExpertLevel;

class ExpertLevelService extends Service
{

    /**
     * 列表
     * @param array $param
     */
    public function getList(array $param = [])
    {
        $this->mode = new BlueExpertLevel();
        return $this->searchVal($param,$this->searchFilter($param))->paginate([
            "list_rows" => $param['pageSize'],
            "page"      => $param['page']
        ]);
    }


    /**
     *
     * @param array $param
     * @return array
     */
    public function searchFilter(array $param = []): array
    {
        $filter = [];
        !empty($param['type']) && $filter[] = ["type", '=', $param['type']];
        !empty($param['status']) && $filter[] = ["status", '=', $param['status']];
        !empty($param['name']) && $filter[] = ["name", 'like', "%{$param['name']}%"];
        return $filter;
    }

}