| Line 702... |
Line 702... |
| 702 |
$type = $this->request->query('date');
|
702 |
$type = $this->request->query('date');
|
| 703 |
$date_from = $this->request->query('date_from');
|
703 |
$date_from = $this->request->query('date_from');
|
| 704 |
$date_to = $this->request->query('date_to');
|
704 |
$date_to = $this->request->query('date_to');
|
| 705 |
if(!isset($type) && !isset($date_from) && !isset($date_to)){
|
705 |
if(!isset($type) && !isset($date_from) && !isset($date_to)){
|
| 706 |
$date = date('Y-m-d',time());
|
706 |
$date = date('Y-m-d',time());
|
| 707 |
$showDate=' for '.$date;
|
- |
|
| 708 |
$this->Paginator->settings = array(
|
707 |
$this->Paginator->settings = array(
|
| 709 |
'fields' => array('sum(offer_price) as offer_price','sum(final_user_payout) as payout_amount'),
|
708 |
'fields' => array('date(transaction_time) as date','sum(offer_price) as offer_price','sum(final_user_payout) as payout_amount'),
|
| 710 |
'conditions' => array('Date(AppTransaction.transaction_time)'=>$date,'payout_description'=>'Approved'),
|
709 |
'conditions' => array('Date(AppTransaction.transaction_time)'=>$date,'payout_description'=>'Approved'),
|
| 711 |
);
|
710 |
);
|
| 712 |
$approvedCounts = $this->Paginator->paginate();
|
711 |
$approvedCounts = $this->Paginator->paginate();
|
| 713 |
}
|
712 |
}
|
| 714 |
else if($type=='yesterday'){
|
713 |
else if($type=='yesterday'){
|
| 715 |
$date = date('Y-m-d',time()-86400);
|
714 |
$date = date('Y-m-d',time()-86400);
|
| 716 |
$showDate=' for '.$date;
|
- |
|
| 717 |
$this->Paginator->settings = array(
|
715 |
$this->Paginator->settings = array(
|
| 718 |
'fields' => array('sum(offer_price) as offer_price','sum(final_user_payout) as payout_amount'),
|
716 |
'fields' => array('date(transaction_time) as date','sum(offer_price) as offer_price','sum(final_user_payout) as payout_amount'),
|
| 719 |
'conditions' => array('Date(AppTransaction.transaction_time)'=>$date,'payout_description'=>'Approved'),
|
717 |
'conditions' => array('Date(AppTransaction.transaction_time)'=>$date,'payout_description'=>'Approved'),
|
| 720 |
);
|
718 |
);
|
| 721 |
$approvedCounts = $this->Paginator->paginate();
|
719 |
$approvedCounts = $this->Paginator->paginate();
|
| 722 |
}else if(isset($date_from) && isset($date_to)){
|
720 |
}else if(isset($date_from) && isset($date_to)){
|
| 723 |
$showDate='between '. $date_from.' & '.$date_to;
|
- |
|
| 724 |
$this->Paginator->settings = array(
|
721 |
$this->Paginator->settings = array(
|
| 725 |
'fields' => array('sum(offer_price) as offer_price','sum(final_user_payout) as payout_amount'),
|
722 |
'fields' => array('date(transaction_time) as date','sum(offer_price) as offer_price','sum(final_user_payout) as payout_amount'),
|
| 726 |
'conditions' => array('Date(AppTransaction.transaction_time) BETWEEN ? AND ?' =>array($date_from, $date_to),'payout_description'=>'Approved'),
|
723 |
'conditions' => array('Date(AppTransaction.transaction_time) BETWEEN ? AND ?' =>array($date_from, $date_to),'payout_description'=>'Approved'),
|
| - |
|
724 |
'group' => 'Date(transaction_time)',
|
| - |
|
725 |
'order' => 'date desc',
|
| - |
|
726 |
'limit' => '50',
|
| 727 |
);
|
727 |
);
|
| 728 |
$approvedCounts = $this->Paginator->paginate();
|
728 |
$approvedCounts = $this->Paginator->paginate();
|
| 729 |
}else{
|
729 |
}else{
|
| 730 |
$date = date('Y-m-d',time());
|
730 |
$date = date('Y-m-d',time());
|
| 731 |
$showDate=' for '.$date;
|
- |
|
| 732 |
$this->Paginator->settings = array(
|
731 |
$this->Paginator->settings = array(
|
| 733 |
'fields' => array('sum(offer_price) as offer_price','sum(final_user_payout) as payout_amount'),
|
732 |
'fields' => array('date(transaction_time) as date','sum(offer_price) as offer_price','sum(final_user_payout) as payout_amount'),
|
| 734 |
'conditions' => array('Date(AppTransaction.transaction_time)'=>$date,'payout_description'=>'Approved'),
|
733 |
'conditions' => array('Date(AppTransaction.transaction_time)'=>$date,'payout_description'=>'Approved'),
|
| 735 |
);
|
734 |
);
|
| 736 |
$approvedCounts = $this->Paginator->paginate();
|
735 |
$approvedCounts = $this->Paginator->paginate();
|
| 737 |
}
|
736 |
}
|
| 738 |
$totalSum=$this->AppTransaction->find('all',array(
|
737 |
$totalSum=$this->AppTransaction->find('all',array(
|
| 739 |
'fields' => array('sum(offer_price) as total_offer_price','sum(final_user_payout)as total_payout_amount'),
|
738 |
'fields' => array('sum(offer_price) as total_offer_price','sum(final_user_payout)as total_payout_amount'),
|
| 740 |
'conditions' => array('payout_description'=>'Approved')
|
739 |
'conditions' => array('payout_description'=>'Approved')
|
| 741 |
));
|
740 |
));
|
| 742 |
$this->set('date',$showDate);
|
- |
|
| 743 |
$this->set('datewiseTotal',$approvedCounts);
|
741 |
$this->set('datewiseTotal',$approvedCounts);
|
| 744 |
$this->set('total',$totalSum);
|
742 |
$this->set('total',$totalSum);
|
| 745 |
}
|
743 |
}
|
| 746 |
}
|
744 |
}
|
| 747 |
|
745 |
|