芝麻web文件管理V1.00
编辑当前文件:/home/qrafawbu/joolsmen.com/application/models/Booking.php
table = 'book_service'; } /* * Fetch records from the database * @param array filter data based on the passed parameters */ function getRows($params = array()){ $this->db->select("b.*,s.service_title,s.service_image,s.service_amount,s.rating,s.service_image,c.category_name,sc.subcategory_name,p.profile_img,p.mobileno,p.country_code"); $this->db->from('book_service b'); $this->db->join('services s', 'b.service_id = s.id', 'LEFT'); $this->db->join('categories c', 'c.id = s.category', 'LEFT'); $this->db->join('subcategories sc', 'sc.id = s.subcategory', 'LEFT'); $this->db->join('providers p', 'b.provider_id = p.id', 'LEFT'); $this->db->where("b.provider_id",$this->session->userdata('id')); if(array_key_exists("where", $params)){ foreach($params['where'] as $key => $val){ $this->db->where($key, $val); } } if(array_key_exists("returnType",$params) && $params['returnType'] == 'count'){ $result = $this->db->count_all_results(); }else{ if(array_key_exists("id", $params) || (array_key_exists("returnType", $params) && $params['returnType'] == 'single')){ if(!empty($params['id'])){ $this->db->where('id', $params['id']); } $query = $this->db->get(); $result = $query->row_array(); }else{ $this->db->order_by('id', 'desc'); if(array_key_exists("start",$params) && array_key_exists("limit",$params)){ $this->db->limit($params['limit'],$params['start']); }elseif(!array_key_exists("start",$params) && array_key_exists("limit",$params)){ $this->db->limit($params['limit']); } $query = $this->db->get(); $result = ($query->num_rows() > 0)?$query->result_array():FALSE; } } // Return fetched data return $result; } }