<?php
class ModelEredeLogsView extends Model {

    public function getLog($idLog)
	{
        $sql = 'SELECT DISTINCT '.DB_PREFIX.'rede_orders.id,
                                '.DB_PREFIX.'rede_orders.*, 
                                '.DB_PREFIX.'rede_orders_log.*
                FROM '.DB_PREFIX.'rede_orders_log
                LEFT JOIN '.DB_PREFIX.'rede_orders 
                    ON ('.DB_PREFIX.'rede_orders.order_id = '.DB_PREFIX.'rede_orders_log.order_id)
                WHERE '.DB_PREFIX.'rede_orders_log.id_rede_orders_log = "'.$idLog.'"';
		$query = $this->db->query($sql);

		if ($query->num_rows > 0) {
		    return $query->rows[0];
		}
		else
			return array();
	}
}
?>