Subversion Repositories SmartDukaan

Rev

Rev 14930 | Rev 15026 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 14930 Rev 15015
Line 108... Line 108...
108
 * @param string $id
108
 * @param string $id
109
 * @return void
109
 * @return void
110
 */
110
 */
111
	public function view($id = null) {
111
	public function view($id = null) {
112
		$userId = $this->request->query('user_id');
112
		$userId = $this->request->query('user_id');
113
		if(isset($userId) && !empty($userId)){
113
		if(isset($userId) && !empty($userId) && !$this->isAuthorized()){
114
			$this->loadModel('User');
114
			$this->loadModel('User');
115
			$dbuser = $this->User->findById($userId);
115
			$dbuser = $this->User->findById($userId);
116
			$this->Auth->login($dbuser['User']);
116
			$this->Auth->login($dbuser['User']);
117
		}
117
		}
118
		$likedDeals = $disLikedDeals = array();
118
		$likedDeals = $disLikedDeals = array();
Line 123... Line 123...
123
		if(!isset($page)){
123
		if(!isset($page)){
124
			$page = 1;
124
			$page = 1;
125
		}	
125
		}	
126
		$sort = $this->request->query('sort');
126
		$sort = $this->request->query('sort');
127
		$direction = $this->request->query('direction');
127
		$direction = $this->request->query('direction');
-
 
128
		$filter = $this->request->query('filter');
-
 
129
		$brands = $this->request->query('brands');
128
		$url = $this->getDealsApiUrl($page,$this->Auth->User('id'),$id,$sort,$direction);
130
		$url = $this->getDealsApiUrl($page,$this->Auth->User('id'),$id,$sort,$direction,$filter,$brands);
129
		// $url = $this->apihost.'deals/'.$this->Auth->User('id').'?categoryId='.$id;
131
		// $url = $this->apihost.'deals/'.$this->Auth->User('id').'?categoryId='.$id;
130
		$deals = $this->make_request($url,null);
132
		$deals = $this->make_request($url,null);
131
		$this->loadModel('Api');
133
		$this->loadModel('Api');
132
		// $apideals = $this->Api->getDealsByCategory($this->Auth->User('id'),$id,$page);
134
		// $apideals = $this->Api->getDealsByCategory($this->Auth->User('id'),$id,$page);
133
		// $deals = $apideals['products'];
135
		// $deals = $apideals['products'];