<?php
class ModelCatalogAffiliate extends Model 
{
	public function getNewsStory($news_id) 
	{
		$query = $this->db->query("SELECT DISTINCT * FROM news n LEFT JOIN news_description nd ON (n.news_id = nd.news_id) WHERE n.news_id = '" . (int)$news_id . "' AND nd.language_id = '" . (int)$this->language->getId() . "' AND n.status = '1'");
		return $query->row;
	}

	public function getNews() 
	{
		$query = $this->db->query("SELECT * FROM news n LEFT JOIN news_description nd ON (n.news_id = nd.news_id) WHERE nd.language_id = '" . (int)$this->language->getId() . "' AND n.status = '1' ORDER BY n.date_added DESC");
		return $query->rows;
	}
}
?>
