本文整理汇总了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);
}
}
}
}