<?php
/**
 * Created by PhpStorm.
 * User: fengcaiyiyi
 * Date: 2016/9/27
 * Time: 20:08
 */

namespace Admin\Model;
use Think\Model;

class AuthModel extends Model {

    public function sel_nav($parent_id=0) {
        $where['parent_id']=$parent_id;
        $where['is_del']=0;

        $result = $this->where($where)->order('sort asc')->select();
        $arr = array();
        if($result) {
            foreach($result as $k=>$v) {
                $v['list'] = $this->sel_nav($v['id']);
                $arr[] = $v;
            }
            return $arr;
        }
    }



}

