本文整理汇总了PHP中User_Model::get方法的典型用法代码示例。如果您正苦于以下问题:PHP User_Model::get方法的具体用法?PHP User_Model::get怎么用?PHP User_Model::get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类User_Model
的用法示例。
在下文中一共展示了User_Model::get方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
function __construct()
{
$this->conf = array('path' => 'admin/schedules');
parent::__construct(User_model::LEVEL_MANAGER);
/* check how many locations do we have */
$lm = new Location_Model();
$location_count = $lm->count();
$this->data['location_count'] = $location_count;
/* check how many staff do we have */
$um = new User_Model();
$staff_count = $um->count_staff();
$this->data['staff_count'] = $staff_count;
$um = new User_Model();
$staffs = $um->get()->all;
$this->data['staffs'] = array();
foreach ($staffs as $sta) {
$this->data['staffs'][$sta->id] = $sta;
}
/* also get all shift templates */
$shift_template_titles = array();
$stm = new Shift_Template_Model();
$stm->get();
foreach ($stm->get() as $st) {
// $shift_template_titles[ $st->start . '-' . $st->end ] = $st->name;
}
$this->data['shift_template_titles'] = $shift_template_titles;
}
示例2: day
function day($date, $location_id = array())
{
$this->data['display'] = 'all';
$sm = new Shift_Model();
/* load shifts if needed */
if (!isset($this->data['shifts'])) {
$this->_load_shifts($date, 0, $location_id);
}
/* filter all shifts */
$this->data['my_shifts'] = array();
foreach ($this->data['shifts'] as $sh) {
if ($sh->date > $date) {
break;
}
if ($sh->date < $date) {
continue;
}
$this->data['my_shifts'][] = $sh;
}
$um = new User_Model();
$staffs = $um->get()->all;
$this->data['staffs'] = array();
foreach ($staffs as $sta) {
$this->data['staffs'][$sta->id] = $sta;
}
$this->data['date'] = $date;
$this->set_include('day');
$this->load->view($this->template, $this->data);
}