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


PHP MY_Model::find方法代码示例

本文整理汇总了PHP中MY_Model::find方法的典型用法代码示例。如果您正苦于以下问题:PHP MY_Model::find方法的具体用法?PHP MY_Model::find怎么用?PHP MY_Model::find使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MY_Model的用法示例。


在下文中一共展示了MY_Model::find方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: find

 public function find($criteria = array(), $n = NULL, $offset = NULL)
 {
     $where = $this->_get_where($criteria);
     $orderby = parent::_get_orderby($criteria, 'nombre');
     $order = parent::_get_order($criteria, 'ASC');
     return parent::find('personas', $where, $orderby, $order, $n, $offset);
 }
开发者ID:googlecode-mirror,项目名称:boton-producto-cm-sms,代码行数:7,代码来源:personas_model.php

示例2: find

	public function find($id=null) 
	{
		$role = parent::find($id);
		
		if (!$role) { return false; }
		
		// Grab our permissions for the role.
		$permissions = $this->permission_model->find_for_role($id);
		$role->permissions = $permissions[0];
		
		return $role;
	}
开发者ID:ndcisiv,项目名称:Bonfire,代码行数:12,代码来源:role_model.php

示例3: login

 public function login($uname, $str)
 {
     //取出随机数列
     $login_key = $this->session->userdata('key');
     $this->session->unset_userdata('key');
     /*获得用户信息*/
     if (parent::count(array('uname' => $uname)) == 1) {
         //$q=$this->db->get_where('user',array('uname'=>$uname))->row_array();
         $q = end(parent::find(array('uname' => $uname)));
         //检查用户是否已经过期
         if (isset($q['expire_time']) && $q['expire_time'] < time()) {
             //验证待激活用户是否过期,过期则删除,并返回登陆失败
             if (parent::deleteByPk($q['id'])) {
                 return $this->set_err(101, 'Expired User!');
             } else {
                 return FALSE;
             }
         }
         /*检验用户是否已经激活*/
         if (!$q['active']) {
             return $this->set_err(102, 'Please activate the user first');
         }
         /*产生服务器端的hash数据*/
         $ser = sha1($q['pword'] . $login_key);
         /*验证*/
         if ($str == $ser) {
             /*更新最后登陆时间以及登陆状态*/
             /*
             $this->db->where('id',$q['id']);
             $this->db->update('hfi_user',array('latest_login'=>time()));
             */
             parent::updateByPk(array('latest_login' => time()), $q['id']);
             //更新session
             $s_data = array('rsc_login' => TRUE, 'uid' => $q['id']);
             $this->session->set_userdata($s_data);
             //set security session
             $this->session->set_userdata('security', TRUE);
             $this->session->set_userdata('sec_time', time() + 60);
             //设置登陆数据
             $this->uid = $q['id'];
             return TRUE;
             /*登陆成功*/
         } else {
             return $this->set_err(104, 'Wrong user name and password combination.');
         }
     } else {
         return $this->set_err(104, 'Wrong user name and password combination.');
     }
 }
开发者ID:stevenygd,项目名称:ling,代码行数:49,代码来源:user.php

示例4: find

	public function find($id=null) 
	{
		$this->db->join('roles', 'roles.role_id = users.role_id', 'left');
	
		return parent::find($id);
	}
开发者ID:ndcisiv,项目名称:Bonfire,代码行数:6,代码来源:user_model.php

示例5: find

 /**
  * Find posts with linked text and author's profile
  * 
  * @param type $id
  * @param type $limit
  * @param type $from
  * @return type 
  */
 public function find($id = NULL, $limit = NULL, $from = NULL)
 {
     $this->db->select('t.*, u.id AS user_id, u.login, u.email, u.avatar, u.banned, u.role')->join($this->users_table . ' AS u', 't.user_id = u.id', 'LEFT');
     return parent::find($id, $limit, $from);
 }
开发者ID:ak826843,项目名称:bmf,代码行数:13,代码来源:post.php

示例6: is_shared

 /**
  * Check whether the resources is shared with current user
  * @param $rsc_type
  * @param $rsc_id
  * @return boolean whether the information is shared by the current user
  */
 public function is_shared($rsc_type, $rsc_id)
 {
     if ($this->identity->is_researcher()) {
         $uid = $this->identity->get_uid();
     } else {
         return FALSE;
     }
     if (!$this->_check_rsc($rsc_type, $rsc_id)) {
         $this->err_code = 400;
         $this->err_msg = "Wrong Input as Experiment Resource Identifier:[" . $rsc_type . "," . $rsc_id . "]";
         return FALSE;
     }
     // fetch the data
     $record = end(parent::find(array("rsc_type" => $rsc_type, "rsc_id" => $rsc_id)));
     if (!$record) {
         return FALSE;
     }
     //the error codes should be set up already
     switch ($record["share"]) {
         case "private":
             return $this->is_owner($rsc_type, $rsc_id);
             // since we have already checked, and the targeted user is not the owner
             break;
         case "limited":
             // then we need to find the list
             // TODO will the owner be in the list?
             return in_array($uid, $record["share_list"]) || $this->is_owner($rsc_type, $rsc_id);
             break;
         case "protected":
             return $this->identity->is_researcher();
             break;
         case "public":
             return TRUE;
             break;
         default:
             return FALSE;
             //sorry, I just cannot
             break;
     }
 }
开发者ID:stevenygd,项目名称:ling,代码行数:46,代码来源:auth.php

示例7: getPackageByGID

 public function getPackageByGID($gid)
 {
     return end(parent::find(['gid' => $gid]));
 }
开发者ID:stevenygd,项目名称:ling,代码行数:4,代码来源:expr.php


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