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


PHP CI_Model::get_info方法代码示例

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


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

示例1:

	function get_info_customer($customer_id)
	{
		$this->db->from('employees');	
		$this->db->join('people', 'people.person_id = employees.person_id');
		// $this->db->join('app_files', 'people.image_id = app_files.file_id');
		$this->db->where('employees.person_id',$customer_id);
		$query = $this->db->get();
		
		if($query->num_rows()==1)
		{
			return $query->row();
		}
		else
		{
			//Get empty base parent object, as $customer_id is NOT an customer
			$person_obj=parent::get_info(-1);
			
			//Get all the fields from customer table
			$fields = $this->db->list_fields('employees');
			
			//append those fields to base parent object, we we have a complete empty object
			foreach ($fields as $field)
			{
				$person_obj->$field='';
			}
			
			return $person_obj;
		}
	}
开发者ID:phansaorin,项目名称:loan,代码行数:29,代码来源:schedule.php

示例2: foreach

 function get_info($user_id)
 {
     $this->db->from('user');
     $this->db->where('user_id', $user_id);
     $query = $this->db->get();
     if ($query->num_rows() == 1) {
         return $query->row();
     } else {
         //Get empty base parent object, as $employee_id is NOT an employee
         $person_obj = parent::get_info(-1);
         //Get all the fields from employee table
         $fields = $this->db->list_fields('user_name');
         //append those fields to base parent object, we we have a complete empty object
         foreach ($fields as $field) {
             $person_obj->{$field} = '';
         }
         return $person_obj;
     }
 }
开发者ID:neoza,项目名称:testdashboard,代码行数:19,代码来源:login_model.php

示例3: foreach

 function get_info($supplier_id)
 {
     $this->db->from('suppliers');
     $this->db->join('people', 'people.person_id = suppliers.person_id');
     $this->db->where('suppliers.person_id', $supplier_id);
     $query = $this->db->get();
     if ($query->num_rows() == 1) {
         return $query->row();
     } else {
         //Get empty base parent object, as $supplier_id is NOT an supplier
         $person_obj = parent::get_info(-1);
         //Get all the fields from supplier table
         $fields = $this->db->list_fields('suppliers');
         //append those fields to base parent object, we we have a complete empty object
         foreach ($fields as $field) {
             $person_obj->{$field} = '';
         }
         return $person_obj;
     }
 }
开发者ID:SofyanHadiA,项目名称:rinjani-framework,代码行数:20,代码来源:supplier.php


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