| Line 204... |
Line 204... |
| 204 |
if(!isset($type) && !isset($date_from) && !isset($date_to)){
|
204 |
if(!isset($type) && !isset($date_from) && !isset($date_to)){
|
| 205 |
$date = date('Y-m-d',time());
|
205 |
$date = date('Y-m-d',time());
|
| 206 |
$this->Paginator->settings = array(
|
206 |
$this->Paginator->settings = array(
|
| 207 |
'fields' => array('AppTransaction.app_id','retailer_id','app_name', 'COUNT(*) AS count'),
|
207 |
'fields' => array('AppTransaction.app_id','retailer_id','app_name', 'COUNT(*) AS count'),
|
| 208 |
'conditions' => array('Date(AppTransaction.transaction_time)'=>$date),
|
208 |
'conditions' => array('Date(AppTransaction.transaction_time)'=>$date),
|
| - |
|
209 |
'limit' => $this->AppTransaction->find('count',array('group'=>'app_id','conditions'=>array('Date(AppTransaction.transaction_time)'=>$date))),
|
| 209 |
'order' => 'count desc' ,
|
210 |
'order' => 'count desc' ,
|
| 210 |
'group' => 'app_id'
|
211 |
'group' => 'app_id'
|
| 211 |
);
|
212 |
);
|
| 212 |
$approvedCounts = $this->Paginator->paginate();
|
213 |
$approvedCounts = $this->Paginator->paginate();
|
| 213 |
$sql="SELECT app_id,count(1) from app_transactions where date(transaction_time)='$date' and payout_description='Approved' group by app_id";
|
214 |
$sql="SELECT app_id,count(1) from app_transactions where date(transaction_time)='$date' and payout_description='Approved' group by app_id";
|
| Line 226... |
Line 227... |
| 226 |
else if($type=='yesterday'){
|
227 |
else if($type=='yesterday'){
|
| 227 |
$date = date('Y-m-d',time()-86400);
|
228 |
$date = date('Y-m-d',time()-86400);
|
| 228 |
$this->Paginator->settings = array(
|
229 |
$this->Paginator->settings = array(
|
| 229 |
'fields' => array('AppTransaction.app_id','retailer_id','app_name', 'COUNT(*) AS count'),
|
230 |
'fields' => array('AppTransaction.app_id','retailer_id','app_name', 'COUNT(*) AS count'),
|
| 230 |
'conditions' => array('Date(AppTransaction.transaction_time)'=>$date),
|
231 |
'conditions' => array('Date(AppTransaction.transaction_time)'=>$date),
|
| - |
|
232 |
'limit' => $this->AppTransaction->find('count',array('group'=>'app_id','conditions'=>array('Date(AppTransaction.transaction_time)'=>$date))),
|
| 231 |
'order' => 'count desc' ,
|
233 |
'order' => 'count desc' ,
|
| 232 |
'group' => 'app_id'
|
234 |
'group' => 'app_id'
|
| 233 |
);
|
235 |
);
|
| 234 |
$approvedCounts = $this->Paginator->paginate();
|
236 |
$approvedCounts = $this->Paginator->paginate();
|
| 235 |
$sql="SELECT app_id,count(1) from app_transactions where date(transaction_time)='$date' and payout_description='Approved' group by app_id";
|
237 |
$sql="SELECT app_id,count(1) from app_transactions where date(transaction_time)='$date' and payout_description='Approved' group by app_id";
|
| Line 246... |
Line 248... |
| 246 |
}
|
248 |
}
|
| 247 |
}else if(isset($date_from) && isset($date_to)){
|
249 |
}else if(isset($date_from) && isset($date_to)){
|
| 248 |
$this->Paginator->settings = array(
|
250 |
$this->Paginator->settings = array(
|
| 249 |
'fields' => array('AppTransaction.app_id','retailer_id','app_name', 'COUNT(*) AS count'),
|
251 |
'fields' => array('AppTransaction.app_id','retailer_id','app_name', 'COUNT(*) AS count'),
|
| 250 |
'conditions' => array('Date(AppTransaction.transaction_time) BETWEEN ? AND ?' =>array($date_from, $date_to)),
|
252 |
'conditions' => array('Date(AppTransaction.transaction_time) BETWEEN ? AND ?' =>array($date_from, $date_to)),
|
| - |
|
253 |
'limit'=> $this->AppTransaction->find(
|
| - |
|
254 |
'count',array('group'=>'app_id','conditions' =>
|
| - |
|
255 |
array('Date(AppTransaction.transaction_time) BETWEEN ? AND ?' =>
|
| - |
|
256 |
array($date_from, $date_to)))),
|
| 251 |
'order' => 'count desc' ,
|
257 |
'order' => 'count desc' ,
|
| 252 |
'group' => 'app_id'
|
258 |
'group' => 'app_id'
|
| 253 |
);
|
259 |
);
|
| 254 |
$approvedCounts = $this->Paginator->paginate();
|
260 |
$approvedCounts = $this->Paginator->paginate();
|
| 255 |
$sql="SELECT app_id,count(1) from app_transactions where date(transaction_time) BETWEEN '$date_from' and '$date_to' and payout_description='Approved' group by app_id";
|
261 |
$sql="SELECT app_id,count(1) from app_transactions where date(transaction_time) BETWEEN '$date_from' and '$date_to' and payout_description='Approved' group by app_id";
|
| Line 267... |
Line 273... |
| 267 |
}else{
|
273 |
}else{
|
| 268 |
$date = date('Y-m-d',time());
|
274 |
$date = date('Y-m-d',time());
|
| 269 |
$this->Paginator->settings = array(
|
275 |
$this->Paginator->settings = array(
|
| 270 |
'fields' => array('AppTransaction.app_id','retailer_id','app_name', 'COUNT(*) AS count'),
|
276 |
'fields' => array('AppTransaction.app_id','retailer_id','app_name', 'COUNT(*) AS count'),
|
| 271 |
'conditions' => array('Date(AppTransaction.transaction_time)'=>$date),
|
277 |
'conditions' => array('Date(AppTransaction.transaction_time)'=>$date),
|
| - |
|
278 |
'limit' => $this->AppTransaction->find('count',array('group'=>'app_id','conditions'=>array('Date(AppTransaction.transaction_time)'=>$date))),
|
| 272 |
'order' => 'count desc' ,
|
279 |
'order' => 'count desc' ,
|
| 273 |
'group' => 'app_id'
|
280 |
'group' => 'app_id'
|
| 274 |
);
|
281 |
);
|
| 275 |
$approvedCounts = $this->Paginator->paginate();
|
282 |
$approvedCounts = $this->Paginator->paginate();
|
| 276 |
$sql="SELECT app_id,count(1) from app_transactions where date(transaction_time)='$date' and payout_description='Approved' group by app_id";
|
283 |
$sql="SELECT app_id,count(1) from app_transactions where date(transaction_time)='$date' and payout_description='Approved' group by app_id";
|
| Line 294... |
Line 301... |
| 294 |
$totalApproved+=0;
|
301 |
$totalApproved+=0;
|
| 295 |
}else{
|
302 |
}else{
|
| 296 |
$totalApproved+=$value['AppTransaction']['approved'];
|
303 |
$totalApproved+=$value['AppTransaction']['approved'];
|
| 297 |
}
|
304 |
}
|
| 298 |
}
|
305 |
}
|
| - |
|
306 |
$url=$_SERVER['REQUEST_URI'];
|
| - |
|
307 |
if (strpos($url,'sort') == false) {
|
| - |
|
308 |
|
| - |
|
309 |
}else{
|
| - |
|
310 |
$new1=explode("/sort:", $url);
|
| - |
|
311 |
$new2=explode("/direction:", $new1[1]);
|
| - |
|
312 |
$new2=explode("/direction:", $new1[1]);
|
| - |
|
313 |
$sortType=$new2[0];
|
| - |
|
314 |
if (strpos($new2[1],'page') == false) {
|
| - |
|
315 |
$sortDirection=$new2[1];
|
| - |
|
316 |
}else{
|
| - |
|
317 |
$new3=explode("/page:", $new2[1]);
|
| - |
|
318 |
$sortDirection=$new3[0];
|
| - |
|
319 |
}
|
| - |
|
320 |
if (strpos($new2[1],'date') == false) {
|
| - |
|
321 |
$sortDirection=$new2[1];
|
| - |
|
322 |
}else{
|
| - |
|
323 |
$new3=explode("?date", $new2[1]);
|
| - |
|
324 |
$sortDirection=$new3[0];
|
| - |
|
325 |
}
|
| - |
|
326 |
if($sortType=='approved' && $sortDirection=='desc'){
|
| - |
|
327 |
$newApprovedCount = array();
|
| - |
|
328 |
foreach ($approvedCounts as $key => $row)
|
| - |
|
329 |
{
|
| - |
|
330 |
if(!(isset($row['AppTransaction']['approved']))){
|
| - |
|
331 |
$newApprovedCount[$key]['AppTransaction']['approved']=0;
|
| - |
|
332 |
}else{
|
| - |
|
333 |
$newApprovedCount[$key]['AppTransaction']['approved'] = $row['AppTransaction']['approved'];
|
| - |
|
334 |
}
|
| - |
|
335 |
}
|
| - |
|
336 |
array_multisort($newApprovedCount, SORT_DESC, $approvedCounts);
|
| - |
|
337 |
}
|
| - |
|
338 |
else if($sortType=='approved' && $sortDirection=='asc'){
|
| - |
|
339 |
$newApprovedCount = array();
|
| - |
|
340 |
foreach ($approvedCounts as $key => $row)
|
| - |
|
341 |
{
|
| - |
|
342 |
if(!(isset($row['AppTransaction']['approved']))){
|
| - |
|
343 |
$newApprovedCount[$key]['AppTransaction']['approved']=0;
|
| - |
|
344 |
}else{
|
| - |
|
345 |
$newApprovedCount[$key]['AppTransaction']['approved'] = $row['AppTransaction']['approved'];
|
| - |
|
346 |
}
|
| - |
|
347 |
}
|
| - |
|
348 |
array_multisort($newApprovedCount, SORT_ASC, $approvedCounts);
|
| - |
|
349 |
}
|
| - |
|
350 |
else if($sortType=='conversion_percentage' && $sortDirection=='desc'){
|
| - |
|
351 |
$newApprovedCount = array();
|
| - |
|
352 |
foreach ($approvedCounts as $key => $row)
|
| - |
|
353 |
{
|
| - |
|
354 |
if(!(isset($row['AppTransaction']['conversion_percentage']))){
|
| - |
|
355 |
$newApprovedCount[$key]['AppTransaction']['conversion_percentage']=0;
|
| - |
|
356 |
}else{
|
| - |
|
357 |
$newApprovedCount[$key]['AppTransaction']['conversion_percentage'] = $row['AppTransaction']['conversion_percentage'];
|
| - |
|
358 |
}
|
| - |
|
359 |
}
|
| - |
|
360 |
array_multisort($newApprovedCount, SORT_DESC, $approvedCounts);
|
| - |
|
361 |
}
|
| - |
|
362 |
else if($sortType=='conversion_percentage' && $sortDirection=='asc'){
|
| - |
|
363 |
$newApprovedCount = array();
|
| - |
|
364 |
foreach ($approvedCounts as $key => $row)
|
| - |
|
365 |
{
|
| - |
|
366 |
if(!(isset($row['AppTransaction']['conversion_percentage']))){
|
| - |
|
367 |
$newApprovedCount[$key]['AppTransaction']['conversion_percentage']=0;
|
| - |
|
368 |
}else{
|
| - |
|
369 |
$newApprovedCount[$key]['AppTransaction']['conversion_percentage'] = $row['AppTransaction']['conversion_percentage'];
|
| - |
|
370 |
}
|
| - |
|
371 |
}
|
| - |
|
372 |
array_multisort($newApprovedCount, SORT_ASC, $approvedCounts);
|
| - |
|
373 |
}
|
| - |
|
374 |
else if($sortType=='clicks'&& $sortDirection=='asc'){
|
| - |
|
375 |
$newApprovedCount = array();
|
| - |
|
376 |
foreach ($approvedCounts as $key => $row){
|
| - |
|
377 |
$newApprovedCount[$key][0]['count'] = $row[0]['count'];
|
| - |
|
378 |
}
|
| - |
|
379 |
array_multisort($newApprovedCount, SORT_ASC, $approvedCounts);
|
| - |
|
380 |
}
|
| - |
|
381 |
else if($sortType=='clicks'&& $sortDirection=='desc'){
|
| - |
|
382 |
$newApprovedCount = array();
|
| - |
|
383 |
foreach ($approvedCounts as $key => $row){
|
| - |
|
384 |
$newApprovedCount[$key][0]['count'] = $row[0]['count'];
|
| - |
|
385 |
}
|
| - |
|
386 |
array_multisort($newApprovedCount, SORT_DESC, $approvedCounts);
|
| - |
|
387 |
}
|
| - |
|
388 |
}
|
| - |
|
389 |
|
| - |
|
390 |
|
| 299 |
$this->set('appTransactions', $approvedCounts);
|
391 |
$this->set('appTransactions', $approvedCounts);
|
| 300 |
$this->set('totalClicks', $totalClicks);
|
392 |
$this->set('totalClicks', $totalClicks);
|
| 301 |
$this->set('totalApproved', $totalApproved);
|
393 |
$this->set('totalApproved', $totalApproved);
|
| 302 |
}
|
394 |
}
|
| 303 |
|
395 |
|
| Line 307... |
Line 399... |
| 307 |
$date_from = $this->request->query('date_from');
|
399 |
$date_from = $this->request->query('date_from');
|
| 308 |
$date_to = $this->request->query('date_to');
|
400 |
$date_to = $this->request->query('date_to');
|
| 309 |
if(!isset($type) && !isset($date_from) && !isset($date_to)){
|
401 |
if(!isset($type) && !isset($date_from) && !isset($date_to)){
|
| 310 |
$date = date('Y-m-d',time());
|
402 |
$date = date('Y-m-d',time());
|
| 311 |
$this->Paginator->settings = array(
|
403 |
$this->Paginator->settings = array(
|
| 312 |
'fields' => array('AppTransaction.app_id','retailer_id','app_name', 'COUNT(*) AS count'),
|
404 |
'fields' => array('AppTransaction.app_id','retailer_id','app_name',
|
| - |
|
405 |
'COUNT(*) AS count'),
|
| 313 |
'conditions' => array('Date(AppTransaction.transaction_time)'=>$date),
|
406 |
'conditions' => array('Date(AppTransaction.transaction_time)'=>$date),
|
| - |
|
407 |
'limit' => $this->AppTransaction->find('count',array('group'=>'retailer_id','conditions'=>array('Date(AppTransaction.transaction_time)'=>$date))),
|
| 314 |
'order' => 'count desc' ,
|
408 |
'order' => 'count desc',
|
| 315 |
'group' => 'retailer_id'
|
409 |
'group' => 'retailer_id'
|
| 316 |
);
|
410 |
);
|
| 317 |
$approvedCounts = $this->Paginator->paginate();
|
411 |
$approvedCounts = $this->Paginator->paginate();
|
| 318 |
$sql="SELECT retailer_id,count(1) from app_transactions where date(transaction_time)='$date' and payout_description='Approved' group by retailer_id";
|
412 |
$sql="SELECT retailer_id,count(1) from app_transactions where date(transaction_time)='$date' and payout_description='Approved' group by retailer_id";
|
| 319 |
$approved = $this->AppTransaction->query($sql);
|
413 |
$approved = $this->AppTransaction->query($sql);
|
| Line 331... |
Line 425... |
| 331 |
else if($type=='yesterday'){
|
425 |
else if($type=='yesterday'){
|
| 332 |
$date = date('Y-m-d',time()-86400);
|
426 |
$date = date('Y-m-d',time()-86400);
|
| 333 |
$this->Paginator->settings = array(
|
427 |
$this->Paginator->settings = array(
|
| 334 |
'fields' => array('AppTransaction.app_id','retailer_id','app_name', 'COUNT(*) AS count'),
|
428 |
'fields' => array('AppTransaction.app_id','retailer_id','app_name', 'COUNT(*) AS count'),
|
| 335 |
'conditions' => array('Date(AppTransaction.transaction_time)'=>$date),
|
429 |
'conditions' => array('Date(AppTransaction.transaction_time)'=>$date),
|
| - |
|
430 |
'limit' => $this->AppTransaction->find('count',array('group'=>'retailer_id','conditions'=>array('Date(AppTransaction.transaction_time)'=>$date))),
|
| 336 |
'order' => 'count desc' ,
|
431 |
'order' => 'count desc',
|
| 337 |
'group' => 'retailer_id'
|
432 |
'group' => 'retailer_id'
|
| 338 |
);
|
433 |
);
|
| 339 |
$approvedCounts = $this->Paginator->paginate();
|
434 |
$approvedCounts = $this->Paginator->paginate();
|
| 340 |
$sql="SELECT retailer_id,count(1) from app_transactions where date(transaction_time)='$date' and payout_description='Approved' group by retailer_id";
|
435 |
$sql="SELECT retailer_id,count(1) from app_transactions where date(transaction_time)='$date' and payout_description='Approved' group by retailer_id";
|
| 341 |
$approved = $this->AppTransaction->query($sql);
|
436 |
$approved = $this->AppTransaction->query($sql);
|
| Line 351... |
Line 446... |
| 351 |
}
|
446 |
}
|
| 352 |
}else if(isset($date_from) && isset($date_to)){
|
447 |
}else if(isset($date_from) && isset($date_to)){
|
| 353 |
$this->Paginator->settings = array(
|
448 |
$this->Paginator->settings = array(
|
| 354 |
'fields' => array('AppTransaction.app_id','retailer_id','app_name', 'COUNT(*) AS count'),
|
449 |
'fields' => array('AppTransaction.app_id','retailer_id','app_name', 'COUNT(*) AS count'),
|
| 355 |
'conditions' => array('Date(AppTransaction.transaction_time) BETWEEN ? AND ?' =>array($date_from, $date_to)),
|
450 |
'conditions' => array('Date(AppTransaction.transaction_time) BETWEEN ? AND ?' =>array($date_from, $date_to)),
|
| - |
|
451 |
'limit'=> $this->AppTransaction->find(
|
| - |
|
452 |
'count',array('group'=>'retailer_id','conditions' =>
|
| - |
|
453 |
array('Date(AppTransaction.transaction_time) BETWEEN ? AND ?' =>
|
| - |
|
454 |
array($date_from, $date_to)))),
|
| 356 |
'order' => 'count desc' ,
|
455 |
'order' => 'count desc' ,
|
| 357 |
'group' => 'retailer_id'
|
456 |
'group' => 'retailer_id'
|
| 358 |
);
|
457 |
);
|
| 359 |
$approvedCounts = $this->Paginator->paginate();
|
458 |
$approvedCounts = $this->Paginator->paginate();
|
| 360 |
$sql="SELECT retailer_id,count(1) from app_transactions where date(transaction_time) BETWEEN '$date_from' and '$date_to' and payout_description='Approved' group by retailer_id";
|
459 |
$sql="SELECT retailer_id,count(1) from app_transactions where date(transaction_time) BETWEEN '$date_from' and '$date_to' and payout_description='Approved' group by retailer_id";
|
| Line 372... |
Line 471... |
| 372 |
}else{
|
471 |
}else{
|
| 373 |
$date = date('Y-m-d',time());
|
472 |
$date = date('Y-m-d',time());
|
| 374 |
$this->Paginator->settings = array(
|
473 |
$this->Paginator->settings = array(
|
| 375 |
'fields' => array('AppTransaction.app_id','retailer_id','app_name', 'COUNT(*) AS count'),
|
474 |
'fields' => array('AppTransaction.app_id','retailer_id','app_name', 'COUNT(*) AS count'),
|
| 376 |
'conditions' => array('Date(AppTransaction.transaction_time)'=>$date),
|
475 |
'conditions' => array('Date(AppTransaction.transaction_time)'=>$date),
|
| - |
|
476 |
'limit' => $this->AppTransaction->find('count',array('group'=>'retailer_id','conditions'=>array('Date(AppTransaction.transaction_time)'=>$date))),
|
| 377 |
'order' => 'count desc' ,
|
477 |
'order' => 'count desc' ,
|
| 378 |
'group' => 'retailer_id'
|
478 |
'group' => 'retailer_id'
|
| 379 |
);
|
479 |
);
|
| 380 |
$approvedCounts = $this->Paginator->paginate();
|
480 |
$approvedCounts = $this->Paginator->paginate();
|
| 381 |
$sql="SELECT retailer_id,count(1) from app_transactions where date(transaction_time)='$date' and payout_description='Approved' group by retailer_id";
|
481 |
$sql="SELECT retailer_id,count(1) from app_transactions where date(transaction_time)='$date' and payout_description='Approved' group by retailer_id";
|
| Line 399... |
Line 499... |
| 399 |
$totalApproved+=0;
|
499 |
$totalApproved+=0;
|
| 400 |
}else{
|
500 |
}else{
|
| 401 |
$totalApproved+=$value['AppTransaction']['approved'];
|
501 |
$totalApproved+=$value['AppTransaction']['approved'];
|
| 402 |
}
|
502 |
}
|
| 403 |
}
|
503 |
}
|
| - |
|
504 |
$url=$_SERVER['REQUEST_URI'];
|
| - |
|
505 |
if (strpos($url,'sort') == false) {
|
| - |
|
506 |
|
| - |
|
507 |
}else{
|
| - |
|
508 |
$new1=explode("/sort:", $url);
|
| - |
|
509 |
$new2=explode("/direction:", $new1[1]);
|
| - |
|
510 |
$new2=explode("/direction:", $new1[1]);
|
| - |
|
511 |
$sortType=$new2[0];
|
| - |
|
512 |
if (strpos($new2[1],'page') == false) {
|
| - |
|
513 |
$sortDirection=$new2[1];
|
| - |
|
514 |
}else{
|
| - |
|
515 |
$new3=explode("/page:", $new2[1]);
|
| - |
|
516 |
$sortDirection=$new3[0];
|
| - |
|
517 |
}
|
| - |
|
518 |
if (strpos($new2[1],'date') == false) {
|
| - |
|
519 |
$sortDirection=$new2[1];
|
| - |
|
520 |
}else{
|
| - |
|
521 |
$new3=explode("?date", $new2[1]);
|
| - |
|
522 |
$sortDirection=$new3[0];
|
| - |
|
523 |
}
|
| - |
|
524 |
if($sortType=='approved' && $sortDirection=='desc'){
|
| - |
|
525 |
$newApprovedCount = array();
|
| - |
|
526 |
foreach ($approvedCounts as $key => $row)
|
| - |
|
527 |
{
|
| - |
|
528 |
if(!(isset($row['AppTransaction']['approved']))){
|
| - |
|
529 |
$newApprovedCount[$key]['AppTransaction']['approved']=0;
|
| - |
|
530 |
}else{
|
| - |
|
531 |
$newApprovedCount[$key]['AppTransaction']['approved'] = $row['AppTransaction']['approved'];
|
| - |
|
532 |
}
|
| - |
|
533 |
}
|
| - |
|
534 |
array_multisort($newApprovedCount, SORT_DESC, $approvedCounts);
|
| - |
|
535 |
}
|
| - |
|
536 |
else if($sortType=='approved' && $sortDirection=='asc'){
|
| - |
|
537 |
$newApprovedCount = array();
|
| - |
|
538 |
foreach ($approvedCounts as $key => $row)
|
| - |
|
539 |
{
|
| - |
|
540 |
if(!(isset($row['AppTransaction']['approved']))){
|
| - |
|
541 |
$newApprovedCount[$key]['AppTransaction']['approved']=0;
|
| - |
|
542 |
}else{
|
| - |
|
543 |
$newApprovedCount[$key]['AppTransaction']['approved'] = $row['AppTransaction']['approved'];
|
| - |
|
544 |
}
|
| - |
|
545 |
}
|
| - |
|
546 |
array_multisort($newApprovedCount, SORT_ASC, $approvedCounts);
|
| - |
|
547 |
}
|
| - |
|
548 |
else if($sortType=='conversion_percentage' && $sortDirection=='desc'){
|
| - |
|
549 |
$newApprovedCount = array();
|
| - |
|
550 |
foreach ($approvedCounts as $key => $row)
|
| - |
|
551 |
{
|
| - |
|
552 |
if(!(isset($row['AppTransaction']['conversion_percentage']))){
|
| - |
|
553 |
$newApprovedCount[$key]['AppTransaction']['conversion_percentage']=0;
|
| - |
|
554 |
}else{
|
| - |
|
555 |
$newApprovedCount[$key]['AppTransaction']['conversion_percentage'] = $row['AppTransaction']['conversion_percentage'];
|
| - |
|
556 |
}
|
| - |
|
557 |
}
|
| - |
|
558 |
array_multisort($newApprovedCount, SORT_DESC, $approvedCounts);
|
| - |
|
559 |
}
|
| - |
|
560 |
else if($sortType=='conversion_percentage' && $sortDirection=='asc'){
|
| - |
|
561 |
$newApprovedCount = array();
|
| - |
|
562 |
foreach ($approvedCounts as $key => $row)
|
| - |
|
563 |
{
|
| - |
|
564 |
if(!(isset($row['AppTransaction']['conversion_percentage']))){
|
| - |
|
565 |
$newApprovedCount[$key]['AppTransaction']['conversion_percentage']=0;
|
| - |
|
566 |
}else{
|
| - |
|
567 |
$newApprovedCount[$key]['AppTransaction']['conversion_percentage'] = $row['AppTransaction']['conversion_percentage'];
|
| - |
|
568 |
}
|
| - |
|
569 |
}
|
| - |
|
570 |
array_multisort($newApprovedCount, SORT_ASC, $approvedCounts);
|
| - |
|
571 |
}
|
| - |
|
572 |
else if($sortType=='clicks'&& $sortDirection=='asc'){
|
| - |
|
573 |
$newApprovedCount = array();
|
| - |
|
574 |
foreach ($approvedCounts as $key => $row){
|
| - |
|
575 |
$newApprovedCount[$key][0]['count'] = $row[0]['count'];
|
| - |
|
576 |
}
|
| - |
|
577 |
array_multisort($newApprovedCount, SORT_ASC, $approvedCounts);
|
| - |
|
578 |
}
|
| - |
|
579 |
else if($sortType=='clicks'&& $sortDirection=='desc'){
|
| - |
|
580 |
$newApprovedCount = array();
|
| - |
|
581 |
foreach ($approvedCounts as $key => $row){
|
| - |
|
582 |
$newApprovedCount[$key][0]['count'] = $row[0]['count'];
|
| - |
|
583 |
}
|
| - |
|
584 |
array_multisort($newApprovedCount, SORT_DESC, $approvedCounts);
|
| - |
|
585 |
}
|
| - |
|
586 |
}
|
| 404 |
$this->set('appTransactions', $approvedCounts);
|
587 |
$this->set('appTransactions', $approvedCounts);
|
| 405 |
$this->set('totalClicks', $totalClicks);
|
588 |
$this->set('totalClicks', $totalClicks);
|
| 406 |
$this->set('totalApproved', $totalApproved);
|
589 |
$this->set('totalApproved', $totalApproved);
|
| 407 |
}
|
590 |
}
|
| 408 |
}
|
- |
|
| 409 |
|
591 |
}
|
| - |
|
592 |
|
| - |
|
593 |
|
| - |
|
594 |
|
| - |
|
595 |
|