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


PHP User_Model::get方法代码示例

本文整理汇总了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;
 }
开发者ID:RVRKC,项目名称:Hackathon_2015,代码行数:27,代码来源:schedules.php

示例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);
 }
开发者ID:RVRKC,项目名称:Hackathon_2015,代码行数:29,代码来源:wall.php


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