本文整理汇总了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);
}
示例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));
}