Exemplo n.º 1
0
 public function get_depts()
 {
     $depts = $this->select();
     $tree = new \Admin\Lib\Org\Util\Tree($depts);
     $depts = $tree->leaf();
     return $depts;
 }
Exemplo n.º 2
0
 public function index()
 {
     $categories = D('Category')->order('sort')->get_all();
     $tree = new \Admin\Lib\Org\Util\Tree($categories);
     $categories = $tree->leaf();
     $cid = (int) $_GET['cid'];
     $where = array();
     $params = '';
     if ($cid != '') {
         $where['cid'] = $cid;
         $params = '&cid=' . $cid;
     }
     $page = (int) $_GET['page'];
     $page = !empty($page) ? $page : 1;
     $limit = 10;
     $offset = ($page - 1) * $limit;
     $total = $this->appeal->get_total($where);
     $page_num = ceil($total / $limit);
     $appeal = $this->appeal->get_appeals($limit, $offset, $where);
     foreach ($appeal as $key => $value) {
         foreach ($categories as $category) {
             if ($value['cid'] == $category['id']) {
                 $appeal[$key]['c_name'] = $category['name'];
             }
         }
     }
     $this->assign('page', $page);
     $this->assign('total', $total);
     $this->assign('page_num', $page_num);
     $this->assign('appeal', $appeal);
     $this->assign('categories', $categories);
     $this->display();
 }
Exemplo n.º 3
0
 public function index()
 {
     $categories = $this->category->order('sort')->get_all();
     $tree = new \Admin\Lib\Org\Util\Tree($categories);
     $categories = $tree->leaf();
     $this->assign('categories', $categories);
     $this->assign('method', 1);
     $this->display();
 }