本文整理汇总了PHP中Receipt::whereBetween方法的典型用法代码示例。如果您正苦于以下问题:PHP Receipt::whereBetween方法的具体用法?PHP Receipt::whereBetween怎么用?PHP Receipt::whereBetween使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Receipt
的用法示例。
在下文中一共展示了Receipt::whereBetween方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: salesummary
private function salesummary($date = 'salesummary_today')
{
$time = $this->_dateSetter($date);
$sales = Receipt::whereBetween('created_at', $time)->orderBy('id', 'desc');
$data['salesummary']['sales'] = $sales->get()->toArray();
$data['salesummary']['totalamount'] = 0.0;
if (!empty($data['salesummary']['sales'])) {
$data['salesummary']['totalamount'] = $sales->sum('receipt_worth');
}
return $data;
}
示例2: getReport
public function getReport()
{
$input = Input::all();
$v = Validator::make(Input::All(), array('property_name' => 'required', 'from_date' => 'required', 'to_date' => 'required', 'type' => 'required', 'houseIDReport' => 'required', 'agent_id' => 'required'));
if ($v->passes()) {
$propertyid = Input::get('property_name');
$from_date = Input::get('from_date');
$to_date = Input::get('to_date');
$type = Input::get('type');
$houseID = Input::get('houseIDReport');
$start_day = date("Y-m-d H:i:s", strtotime($from_date));
$end_day = date("Y-m-d H:i:s", strtotime($to_date));
$agent_id = Input::get('agent_id');
$billedusr = User::find($agent_id);
$hisBalance = $billedusr->credit_balance;
$newBalance = $hisBalance - 3;
$billedusr->credit_balance = $newBalance;
$billedusr->save();
$billstatement = new Statement();
$billstatement->type = "Report Generation";
$billstatement->amount = 3;
$billstatement->save();
if ($houseID === "All Report") {
$sumReceipts = Receipt::whereBetween('created_at', array($start_day, $end_day))->where('propertyid', $propertyid)->sum('amountpaid');
$sumInvoiceBalance = Invoice::whereBetween('created_at', array($start_day, $end_day))->where('propertyid', $propertyid)->sum('balance');
$sumInvoicePaid = Invoice::whereBetween('created_at', array($start_day, $end_day))->where('propertyid', $propertyid)->sum('amountpaid');
$sumRefundPaid = Invoice::where('propertyid', $propertyid)->where('type', '=', 'refund')->sum('amountpaid');
$invoiceUn = Invoice::list('houseID');
$unitsUnpaid = House::whereIn('name', $invoiceUn)->count();
$sumInvoice = $sumInvoiceBalance + $sumInvoicePaid;
$noteSum = array('error' => false, 'type' => "All", 'sumRefund' => $sumRefundPaid, 'unitsUnpaid' => $unitsUnpaid, 'sumInvoice' => $sumInvoice, 'sumReceipt' => $sumReceipts);
} else {
$sumReceipts = Receipt::where('houseID', $houseID)->whereBetween('created_at', array($start_day, $end_day))->sum('amountpaid');
$sumInvoiceBalance = Invoice::where('houseID', $houseID)->whereBetween('created_at', array($start_day, $end_day))->sum('balance');
$sumInvoicePaid = Invoice::where('houseID', $houseID)->whereBetween('created_at', array($start_day, $end_day))->sum('amountpaid');
$sumInvoice = $sumInvoiceBalance + $sumInvoicePaid;
$noteSum = array('error' => false, 'type' => "House", 'sumInvoice' => $sumInvoice, 'sumReceipt' => $sumReceipts);
}
return $noteSum;
}
$notePE = array('error' => true, 'message' => 'Ensure that all the fields are set');
return $notePE;
}