當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。