當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Family::count方法代碼示例

本文整理匯總了PHP中Family::count方法的典型用法代碼示例。如果您正苦於以下問題:PHP Family::count方法的具體用法?PHP Family::count怎麽用?PHP Family::count使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Family的用法示例。


在下文中一共展示了Family::count方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: index

 public function index($offset = 0)
 {
     $this->breadcrumb->append_crumb('Home', base_url());
     $this->breadcrumb->append_crumb('Staff Detail', base_url() . 'index.php/staffs/show/' . $this->staff_id);
     $this->breadcrumb->append_crumb('Families', base_url() . '');
     $family = new Family();
     switch ($this->input->get('c')) {
         case "1":
             $data['col'] = "staff_fam_order";
             break;
         case "2":
             $data['col'] = "staff_fam_name";
             break;
         case "3":
             $data['col'] = "staff_fam_birthdate";
             break;
         case "4":
             $data['col'] = "staff_fam_birthplace";
             break;
         case "5":
             $data['col'] = "staff_fam_sex";
             break;
         case "6":
             $data['col'] = "staff_fam_relation";
             break;
         case "7":
             $data['col'] = "staff_fam_id";
             break;
         default:
             $data['col'] = "staff_fam_id";
     }
     if ($this->input->get('d') == "1") {
         $data['dir'] = "DESC";
     } else {
         $data['dir'] = "ASC";
     }
     $data['staff_id'] = $this->staff_id;
     $family->where('staff_fam_staff_id', $this->staff_id)->order_by($data['col'], $data['dir']);
     $total_rows = $family->count();
     $data['title'] = "Family";
     $data['btn_add'] = anchor('staffs/' . $this->staff_id . '/families/add', 'Add New', array('class' => 'btn btn-primary'));
     $data['btn_home'] = anchor('staffs', 'Home');
     $offset = $this->uri->segment($this->uri_segment);
     $data['families'] = $family->where('staff_fam_staff_id', $this->staff_id)->order_by($data['col'], $data['dir'])->get($this->limit, $offset)->all;
     $config['base_url'] = site_url('staffs/' . $this->staff_id . '/families/index');
     $config['total_rows'] = $total_rows;
     $config['per_page'] = $this->limit;
     $config['uri_segment'] = $this->uri_segment;
     $this->pagination->initialize($config);
     $data['pagination'] = $this->pagination->create_links();
     $data['breadcrumb'] = $this->breadcrumb->output();
     $this->load->view('staff_family/index', $data);
 }
開發者ID:anggadjava,項目名稱:payroll,代碼行數:53,代碼來源:families.php

示例2: actionIndex

 /**
  * 首頁
  *
  */
 public function actionIndex()
 {
     parent::_acl();
     $model = new Family();
     $criteria = new CDbCriteria();
     $criteria->condition = $condition;
     $criteria->order = 't.id DESC';
     //$criteria->with = array ( 'catalog' );
     $count = $model->count($criteria);
     $pages = new CPagination($count);
     $pages->pageSize = 13;
     //$pageParams = XUtils::buildCondition( $_GET, array ( 'title' , 'catalogId','titleAlias' ) );
     //$pages->params = is_array( $pageParams ) ? $pageParams : array ();
     $criteria->limit = $pages->pageSize;
     $criteria->offset = $pages->currentPage * $pages->pageSize;
     $result = $model->findAll($criteria);
     $this->render('family_index', array('datalist' => $result, 'pagebar' => $pages));
 }
開發者ID:tecshuttle,項目名稱:51qsk,代碼行數:22,代碼來源:FamilyController.php


注:本文中的Family::count方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。