当前位置: 首页>>代码示例>>PHP>>正文


PHP Branch::count方法代码示例

本文整理汇总了PHP中Branch::count方法的典型用法代码示例。如果您正苦于以下问题:PHP Branch::count方法的具体用法?PHP Branch::count怎么用?PHP Branch::count使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Branch的用法示例。


在下文中一共展示了Branch::count方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: dashboard

 public function dashboard()
 {
     $sucursales = Branch::count();
     $usuarios = User::count();
     $clientes = Client::count();
     $productos = Product::count();
     $informacionCuenta = array('sucursales' => $sucursales, 'usuarios' => $usuarios, 'clientes' => $clientes, 'productos' => $productos);
     // return Response::json($informacionCuenta);
     return View::make('cuentas.dashboard')->with('cuenta', $informacionCuenta);
 }
开发者ID:Vrian7ipx,项目名称:repocas,代码行数:10,代码来源:IpxController.php

示例2: index

 public function index($offset = 0)
 {
     $this->filter_access('Branch', 'roled_select', base_url());
     $branch_list = new Branch();
     switch ($this->input->get('c')) {
         case "1":
             $data['col'] = "branch_name";
             break;
         case "2":
             $data['col'] = "branch_id";
             break;
         default:
             $data['col'] = "branch_id";
     }
     if ($this->input->get('d') == "1") {
         $data['dir'] = "DESC";
     } else {
         $data['dir'] = "ASC";
     }
     $data['title'] = "Branch";
     $data['btn_add'] = anchor('branches/add', 'Add New', "class='btn btn-primary'");
     $data['btn_home'] = anchor(base_url(), 'Home', "class='btn btn-home'");
     $uri_segment = 3;
     $offset = $this->uri->segment($uri_segment);
     if ($this->input->get('search_by')) {
         $total_rows = $branch_list->like($_GET['search_by'], $_GET['q'])->count();
         $branch_list->like($_GET['search_by'], $_GET['q'])->order_by($data['col'], $data['dir']);
     } else {
         $total_rows = $branch_list->count();
         $branch_list->order_by($data['col'], $data['dir']);
     }
     $data['branch_list'] = $branch_list->get($this->limit, $offset)->all;
     $config['base_url'] = site_url("branches/index");
     $config['total_rows'] = $total_rows;
     $config['per_page'] = $this->limit;
     $config['uri_segment'] = $uri_segment;
     $this->pagination->initialize($config);
     $data['pagination'] = $this->pagination->create_links();
     $this->load->view('branches/index', $data);
 }
开发者ID:anggadjava,项目名称:payroll,代码行数:40,代码来源:branches.php


注:本文中的Branch::count方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。