| Line 177... |
Line 177... |
| 177 |
$this->loadModel('MasterData');
|
177 |
$this->loadModel('MasterData');
|
| 178 |
$date = $this->request->query('date');
|
178 |
$date = $this->request->query('date');
|
| 179 |
|
179 |
|
| 180 |
if($product==null || $product=='search'){
|
180 |
if($product==null || $product=='search'){
|
| 181 |
if(!empty($date)){
|
181 |
if(!empty($date)){
|
| 182 |
$sql = "SELECT DATE( created ) date, count(id) AS count,count(distinct user_id) as countUserId, SUBSTRING_INDEX( url, '/', -1 ) AS skuBundleId FROM `user_urls` WHERE date(created) = '$date' AND url LIKE '%store_products/view%' GROUP BY skuBundleId ORDER BY count DESC ";
|
182 |
$sql = "SELECT DATE( created ) date, count(id) AS count,count(distinct user_id) as countUserId, SUBSTRING_INDEX( url, '/', -1 ) AS skuBundleId FROM `user_urls` WHERE date(created) = '$date' AND url LIKE '%store_products/view%' GROUP BY skuBundleId ORDER BY countUserId DESC ";
|
| 183 |
} else{
|
183 |
} else{
|
| 184 |
$sql = "SELECT DATE( created ) date, count(id) AS count,count(distinct user_id) as countUserId, SUBSTRING_INDEX( url, '/', -1 ) AS skuBundleId FROM `user_urls` WHERE date(created) = curdate() AND url LIKE '%store_products/view%' group by skuBundleId ORDER BY count DESC ";
|
184 |
$sql = "SELECT DATE( created ) date, count(id) AS count,count(distinct user_id) as countUserId, SUBSTRING_INDEX( url, '/', -1 ) AS skuBundleId FROM `user_urls` WHERE date(created) = curdate() AND url LIKE '%store_products/view%' group by skuBundleId ORDER BY countUserId DESC ";
|
| 185 |
}
|
185 |
}
|
| 186 |
$clicks_count = $this->UserUrl->query($sql);
|
186 |
$clicks_count = $this->UserUrl->query($sql);
|
| 187 |
$this->set(compact('clicks_count'));
|
187 |
$this->set(compact('clicks_count'));
|
| 188 |
} else{
|
188 |
} else{
|
| 189 |
$sql = "SELECT DATE( created ) date, count(id) AS count,count(distinct user_id) as countUserId, SUBSTRING_INDEX( url, '/', -1 ) AS skuBundleId FROM `user_urls` WHERE SUBSTRING_INDEX( url, '/', -1 ) = $product group by date(created) ORDER BY id DESC ";
|
189 |
$sql = "SELECT DATE( created ) date, count(id) AS count,count(distinct user_id) as countUserId, SUBSTRING_INDEX( url, '/', -1 ) AS skuBundleId FROM `user_urls` WHERE SUBSTRING_INDEX( url, '/', -1 ) = $product group by date(created) ORDER BY id DESC ";
|