Subversion Repositories SmartDukaan

Rev

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

Rev 14996 Rev 15015
Line 142... Line 142...
142
	   } 
142
	   } 
143
       } 
143
       } 
144
       return $headers; 
144
       return $headers; 
145
    } 
145
    } 
146
 
146
 
147
    public function getDealsApiUrl($page=1,$userId = null,$categoryId=0,$sort=null,$direction=null){
147
    public function getDealsApiUrl($page=1,$userId = null,$categoryId=0,$sort=null,$direction=null,$filter=null,$brands=null){
148
    	$this->log('categoryId '.$categoryId,'api');
148
    	$this->log('categoryId '.$categoryId,'api');
149
    	$this->log('page '.$page,'api');
149
    	$this->log('page '.$page,'api');
150
    	$offset = ($page - 1) * $this->limit;
150
    	$offset = ($page - 1) * $this->limit;
151
    	if(isset($sort) && !empty($sort) && $sort!=-1){
151
    	if(isset($sort) && !empty($sort) && $sort!=-1){
152
    		$url = $this->apihost.'deals/'.$userId.'?categoryId='.$categoryId.'&sort='.$sort.'&direction='.$direction.'&limit='.$this->limit.'&offset='.$offset;
152
    		$url = $this->apihost.'deals/'.$userId.'?categoryId='.$categoryId.'&sort='.$sort.'&direction='.$direction.'&limit='.$this->limit.'&offset='.$offset;
153
    	}else{
153
    	}else{
154
    		$url = $this->apihost.'deals/'.$userId.'?categoryId='.$categoryId.'&limit='.$this->limit.'&offset='.$offset;
154
    		$url = $this->apihost.'deals/'.$userId.'?categoryId='.$categoryId.'&limit='.$this->limit.'&offset='.$offset;
155
    	}    	
155
    	}    	
-
 
156
    	if(isset($filter) && !empty($filter)){
-
 
157
    		$url .= "&filterData=brandFilter:".$brands;
-
 
158
    	}
156
    	return $url;
159
    	return $url;
157
    }
160
    }
158
 
161
 
159
	function make_request($url,$fields,$format='json'){
162
	function make_request($url,$fields,$format='json'){
160
		$this->log("[url] $url",'api');
163
		$this->log("[url] $url",'api');