本文整理汇总了PHP中Division::where方法的典型用法代码示例。如果您正苦于以下问题:PHP Division::where方法的具体用法?PHP Division::where怎么用?PHP Division::where使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Division
的用法示例。
在下文中一共展示了Division::where方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: divisions
function divisions($office_id = '')
{
$d = new Division();
$divisions = $d->where('office_id', $office_id)->order_by('order')->get();
$json = array();
foreach ($divisions as $division) {
$json[$division->id] = $division->name;
}
echo json_encode($json);
}
示例2: divisions
function divisions($office_id = '')
{
$o = new Office_m();
$o->get_by_office_id($office_id);
$data['page_name'] = '<b>Divisions of "' . $o->office_name . '"</b>';
$data['msg'] = '';
$this->load->library('pagination');
$divisions = new Division();
$config['base_url'] = base_url() . 'training_manage/course';
$config['total_rows'] = $divisions->count();
$config['per_page'] = '15';
$config['full_tag_open'] = '<p>';
$config['full_tag_close'] = '</p>';
$this->pagination->initialize($config);
// How many related records we want to limit ourselves to
$limit = $config['per_page'];
// Set the offset for our paging
$offset = $this->uri->segment(4);
$divisions->where('office_id', $office_id);
$divisions->order_by('name');
$data['rows'] = $divisions->get($limit, $offset);
$data['office_id'] = $office_id;
$data['page'] = $this->uri->segment(3);
$data['main_content'] = 'divisions';
return View::make('includes/template', $data);
}
示例3: array
/**
* Options for divisions
*
* @param boolean $add_select
* @return array
*/
function division_options($office_id = 1)
{
$options = array();
$d = new Division();
$divisions = $d->where('office_id', $office_id)->order_by('order')->get();
foreach ($divisions as $division) {
$options[$division->id] = $division->name;
}
return $options;
}