<?php

namespace app\admin\api;

use app\admin\model\Depart;

/**
 * Description of RoleApi
 *
 * @author sgq
 */
class DeptApi {

    public static function getOne($id) {
        return Depart::findOrEmpty($id);
    }

    public static function getList($params) {
        $where = [];
        if (isset($params["condition"])) {
            $where[] = [["simplename", "like", "%" . $params["condition"] . "%"]];
            $where[] = [["fullname", "like", "%" . $params["condition"] . "%"]];
        }
        $list = Depart::whereOr($where)->select()->toArray();
        return $list;
    }

}
