Subversion Repositories SmartDukaan

Rev

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

Rev 15718 Rev 15720
Line 158... Line 158...
158
		$date = $this->request->query('date');
158
		$date = $this->request->query('date');
159
		if($product==null || $product=='search'){	
159
		if($product==null || $product=='search'){	
160
			if(!empty($date)){
160
			if(!empty($date)){
161
				$sql = "select count(*) as count,product_name,brand from clicks where length(product_name)>0 and store_product_id>0 and date(created)='$date' group by store_product_id order by count desc";
161
				$sql = "select count(*) as count,product_name,brand from clicks where length(product_name)>0 and store_product_id>0 and date(created)='$date' group by store_product_id order by count desc";
162
			} else{
162
			} else{
163
				$sql = "select count(*) as count,product_name,brand from clicks where length(product_name)>0 and store_product_id>0 and date(created)='2015-06-29' group by store_product_id order by count desc";
163
				$sql = "select count(*) as count,product_name,brand from clicks where length(product_name)>0 and store_product_id>0 and date(created)=curdate() group by store_product_id order by count desc";
164
			}
164
			}
165
		$clicks_count = $this->Click->query($sql);
165
		$clicks_count = $this->Click->query($sql);
166
		$this->set(compact('clicks_count'));
166
		$this->set(compact('clicks_count'));
167
		}else{
167
		}else{
168
			$sql="select count(*) as count,date(created) date from clicks where length(product_name)>0 and store_product_id>0 and product_name ='$product' group by date(created) order by date desc";
168
			$sql="select count(*) as count,date(created) date from clicks where length(product_name)>0 and store_product_id>0 and product_name ='$product' group by date(created) order by date desc";