I want to search data from table according to branch_id or date or in between dates.
What should be the Query in CakePHP.
Query in Controller:
$branchId = $_GET['data']['BranchDailyReport']['branch_id'];
$from_date = $_GET['data']['BranchDailyReport']['from_date'];
$to_date = $_GET['data']['BranchDailyReport']['to_date'];
$condition = array('OR' => array('BranchDailyReport.branch_id =' => $branchId,
'BranchDailyReport.date <= ' => $from_date,
'BranchDailyReport.date >= ' => $to_date
)
);