Subversion Repositories SmartDukaan

Rev

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

Rev 15667 Rev 15718
Line 150... Line 150...
150
			$sql = "select count(id) as count,date(created) as date,user_id  from devices where imeinumber in (select imeinumber from devices where date(created) = curdate()) group by imeinumber having count(id) > 1 order by id desc";
150
			$sql = "select count(id) as count,date(created) as date,user_id  from devices where imeinumber in (select imeinumber from devices where date(created) = curdate()) group by imeinumber having count(id) > 1 order by id desc";
151
		}
151
		}
152
		$device_upgrades = $this->Device->query($sql);
152
		$device_upgrades = $this->Device->query($sql);
153
		$this->set(compact('device_upgrades'));
153
		$this->set(compact('device_upgrades'));
154
	}
154
	}
-
 
155
 
-
 
156
	public function admin_clicks_report($product=null){
-
 
157
		$this->loadModel('Click');
-
 
158
		$date = $this->request->query('date');
-
 
159
		if($product==null || $product=='search'){	
-
 
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";
-
 
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";
-
 
164
			}
-
 
165
		$clicks_count = $this->Click->query($sql);
-
 
166
		$this->set(compact('clicks_count'));
-
 
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";
-
 
169
			$product_count = $this->Click->query($sql);
-
 
170
			$this->set(compact('product_count','product'));
-
 
171
		}
-
 
172
	}
155
}
173
}
156
174