Commits

Iñigo In The Cloud  committed 0b54229

Get cached results for just last 3 months

  • Participants
  • Parent commits c6f2592

Comments (0)

Files changed (1)

File app/Controller/MainController.php

 			
 		
 		$rec = $this->Query->find('first',array(
-			'conditions'=>array('query LIKE' => $q ),
+			'conditions'=>array( 'query LIKE' => $q, 'created >' => strtotime('-3 months') ),
 			'contain' => array()
 		));
 		
 		$geoTime = 0;
 		
-		if(empty($rec) or $rec['Query']['modified'] < strtotime('-3 months')):
+		if(empty($rec)):
 			
 			
 			$rec['Query']['query']  = $q;