本文整理匯總了PHP中Reports::whereBetween方法的典型用法代碼示例。如果您正苦於以下問題:PHP Reports::whereBetween方法的具體用法?PHP Reports::whereBetween怎麽用?PHP Reports::whereBetween使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Reports
的用法示例。
在下文中一共展示了Reports::whereBetween方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: SummarySubmit
public function SummarySubmit()
{
$start = date('Y-m-d', strtotime(Input::get('start')));
$end = date('Y-m-d', strtotime(Input::get('end')));
$date_today = date('Y-m-d');
$prCount = 0;
$POCount = 0;
$chequeCount = 0;
if ($end == '1970-01-01' && $start == '1970-01-01') {
$end = '9998-01-01';
$start = '0001-01-01';
$reports = Reports::whereBetween('date', array($start, $end))->get();
foreach ($reports as $report) {
$prCount = $prCount + $report->pRequestCount;
$POCount = $POCount + $report->pOrderCount;
$chequeCount = $chequeCount + $report->chequeCount;
}
$data = array("inner-fragments" => array("#PR" => "\n\t\t\t\t\t<span class='summary-panel-title'><strong>Total Number of PR Received:</strong></span><br/>\n\t <span class='summary-amount' style='color: #246D27'> {$prCount} </span>\n\t\t\t\t", "#PO" => "\n\t\t\t\t\t<span class='summary-panel-title'><strong>Total Number of PO Received:</strong></span><br/>\n\t <span class='summary-amount' style='color: #4E3A17'> {$POCount} </span>\n\t\t\t\t", "#Cheque" => "\n\t\t\t\t\t<span class='summary-panel-title'><strong>Total Number of Cheque Received:</strong></span><br/>\n\t <span class='summary-amount' style='color: #1B4F69'> {$chequeCount} </span>\n\t\t\t\t", "#dateReport" => "\n\t\t\t\t\t<div id='dateReport' class='alert alert-info'>\n\t\t\t <p>Summary Reports from beginning to {$date_today}.</p>\n\t\t\t </div>\n\t\t\t\t"));
return Response::json($data);
} else {
if ($end == '1970-01-01') {
$end = '9998-01-01';
$reports = Reports::whereBetween('date', array($start, $end))->get();
foreach ($reports as $report) {
$prCount = $prCount + $report->pRequestCount;
$POCount = $POCount + $report->pOrderCount;
$chequeCount = $chequeCount + $report->chequeCount;
}
$data = array("inner-fragments" => array("#PR" => "\n\t\t\t\t\t<span class='summary-panel-title'><strong>Total Number of PR Received:</strong></span><br/>\n\t <span class='summary-amount' style='color: #246D27'> {$prCount} </span>\n\t\t\t\t", "#PO" => "\n\t\t\t\t\t<span class='summary-panel-title'><strong>Total Number of PO Received:</strong></span><br/>\n\t <span class='summary-amount' style='color: #4E3A17'> {$POCount} </span>\n\t\t\t\t", "#Cheque" => "\n\t\t\t\t\t<span class='summary-panel-title'><strong>Total Number of Cheque Received:</strong></span><br/>\n\t <span class='summary-amount' style='color: #1B4F69'> {$chequeCount} </span>\n\t\t\t\t", "#dateReport" => "\n\t\t\t\t\t<div id='dateReport' class='alert alert-info'>\n\t\t\t <p>Summary Reports {$start} to {$date_today}.</p>\n\t\t\t </div>\n\t\t\t\t"));
return Response::json($data);
} else {
if ($start == '1970-01-01') {
$start = '0001-01-01';
$reports = Reports::whereBetween('date', array($start, $end))->get();
foreach ($reports as $report) {
$prCount = $prCount + $report->pRequestCount;
$POCount = $POCount + $report->pOrderCount;
$chequeCount = $chequeCount + $report->chequeCount;
}
$data = array("inner-fragments" => array("#PR" => "\n\t\t\t\t\t<span class='summary-panel-title'><strong>Total Number of PR Received:</strong></span><br/>\n\t <span class='summary-amount' style='color: #246D27'> {$prCount} </span>\n\t\t\t\t", "#PO" => "\n\t\t\t\t\t<span class='summary-panel-title'><strong>Total Number of PO Received:</strong></span><br/>\n\t <span class='summary-amount' style='color: #4E3A17'> {$POCount} </span>\n\t\t\t\t", "#Cheque" => "\n\t\t\t\t\t<span class='summary-panel-title'><strong>Total Number of Cheque Received:</strong></span><br/>\n\t <span class='summary-amount' style='color: #1B4F69'> {$chequeCount} </span>\n\t\t\t\t", "#dateReport" => "\n\t\t\t\t\t<div id='dateReport' class='alert alert-info'>\n\t\t\t <p>Summary Reports from beginning to {$end}.</p>\n\t\t\t </div>\n\t\t\t\t"));
return Response::json($data);
} else {
$reports = Reports::whereBetween('date', array($start, $end))->get();
foreach ($reports as $report) {
$prCount = $prCount + $report->pRequestCount;
$POCount = $POCount + $report->pOrderCount;
$chequeCount = $chequeCount + $report->chequeCount;
}
$data = array("inner-fragments" => array("#PR" => "\n\t\t\t\t\t<span class='summary-panel-title'><strong>Total Number of PR Received:</strong></span><br/>\n\t <span class='summary-amount' style='color: #246D27'> {$prCount} </span>\n\t\t\t\t", "#PO" => "\n\t\t\t\t\t<span class='summary-panel-title'><strong>Total Number of PO Received:</strong></span><br/>\n\t <span class='summary-amount' style='color: #4E3A17'> {$POCount} </span>\n\t\t\t\t", "#Cheque" => "\n\t\t\t\t\t<span class='summary-panel-title'><strong>Total Number of Cheque Received:</strong></span><br/>\n\t <span class='summary-amount' style='color: #1B4F69'> {$chequeCount} </span>\n\t\t\t\t", "#dateReport" => "\n\t\t\t\t\t<div id='dateReport' class='alert alert-info'>\n\t\t\t <p>Summary Reports from {$start} to {$end}.</p>\n\t\t\t </div>\n\t\t\t\t"));
return Response::json($data);
}
}
}
}