switch ($type) {
case "dept" :
$model = M("Dept");
$dept = tree_to_list(list_to_tree(M("Dept")->where('is_del=0')->select(), $id));
$dept = rotate($dept);
$dept = implode(",", $dept['id']) . ",$id";
case "emp" :
// $model = M("Dept");
$dept = tree_to_list(list_to_tree(M("Dept")->where('is_del=0')->select(), $id));
$dept = rotate($dept);
$dept = implode(",", $dept['id']) . ",$id";
$model = D("UserView");
$where['dept_id'] = array('in', $dept);
$where['is_del'] = array('eq', 0);
$where['User.area_id'] = getAreaId();
$data = $model->where($where)->select();
break;
case "rank" :
$model = D("UserView");
$where['rank_id'] = array('eq', $id);
$where['is_del'] = array('eq', 0);
$data = $model->where($where)->select();
\Think\Log::record(__line__);
break;
case "dept" have no break, so when $type equal "dept", case "dept" and case "emp" will be executed.