本文整理汇总了PHP中Payment::select方法的典型用法代码示例。如果您正苦于以下问题:PHP Payment::select方法的具体用法?PHP Payment::select怎么用?PHP Payment::select使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Payment
的用法示例。
在下文中一共展示了Payment::select方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: GeneraReportePagos
public function GeneraReportePagos()
{
$user_id = Auth::user()->id;
ini_set('max_execution_time', 900000);
$idurbanismo = Neighbors::where('user_id', '=', $user_id)->first();
$idurbanismo = $idurbanismo->urbanism_id;
$breadcrumbs = Neighbors::select('neighbors.name as name_ne', 'neighbors.last_name', 'urbanisms.name as name_ur ')->join('neighbors_properties', 'neighbors.id', '=', 'neighbors_properties.neighbors_id')->join('urbanisms', 'neighbors_properties.urbanism_id', '=', 'urbanisms.id')->where('neighbors.user_id', '=', $user_id)->first();
$breadcrumbs_data = $breadcrumbs->name_ne . " " . $breadcrumbs->last_name . " [" . $breadcrumbs->name_ur . "]";
$payments = Payment::select()->join('neighbors_properties', 'payments.neighbor_property_id', '=', 'neighbors_properties.neighbors_id')->where('neighbors_properties.urbanism_id', '=', $idurbanismo)->count();
if ($payments == 0) {
$isEmpty = true;
} else {
$isEmpty = false;
}
return View::make("dashboard.reports.report", ['isEmpty' => $isEmpty, 'idurbanismo' => $idurbanismo, 'breadcrumbs_data' => $breadcrumbs_data]);
}
示例2: modalEstadoCuenta
public function modalEstadoCuenta()
{
$neighbor_property_id = Input::get('neighbor_property_id');
$user_id = Auth::user()->id;
$colonia = Session::get("colonia");
$urbanism = Urbanism::where('colony_id', '=', $colonia)->first();
$urbanismo = $urbanism->id;
$urb_name = $urbanism->name;
$property_id = NeighborProperty::where('urbanism_id', '=', $urbanismo)->pluck('id');
$vigencia = date("Y-m");
$months = array("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Decem");
$today = date("Y-m-d");
$ano = date("Y");
$selano = Payment::select(DB::raw('DATE_FORMAT(payments.created_at,\'%Y\') as y'))->groupBy(DB::raw('Year(payments.created_at)'))->orderBy(DB::raw('Year(payments.created_at)'))->get();
$monthly_all = MonthlyFee::where('monthly_fee.urbanism_id', '=', $urbanismo)->where(DB::raw('DATE_FORMAT(monthly_fee.since,\'%Y\')'), '=', $ano)->get();
$monthly_ini = MonthlyFee::where('monthly_fee.urbanism_id', '=', $urbanismo)->where(DB::raw('DATE_FORMAT(monthly_fee.since,\'%Y\')'), '=', $ano)->orderBy('monthly_fee.created_at', 'ASC')->pluck('since');
$mes_ini = (int) date("m", strtotime($monthly_ini));
$cuotas = array();
foreach ($monthly_all as $cuota_mensual) {
$ini = (int) date("m", strtotime($cuota_mensual->since));
$fin = (int) date("m", strtotime($cuota_mensual->until));
if ($cuota_mensual->until == NULL) {
$fin = (int) date("m");
}
for ($i = $ini; $i <= $fin; $i++) {
$cuotas[$months[$i - 1]] = $cuota_mensual->amount;
}
}
for ($j = 0; $j <= 11; $j++) {
if ($j + 1 < $mes_ini) {
$saldoAnteriol[$j] = "";
$cuataMes[$j] = "";
$totalDebe[$j] = "";
$pagos[$j] = "";
$saldoTotal[$j] = "";
} elseif ($j + 1 <= date("m")) {
$saldoAnteriol[$j] = $saldoTotal[$j - 1];
$cuataMes[$j] = -$cuotas[$months[$j]];
$totalDebe[$j] = $saldoAnteriol[$j] + $cuataMes[$j];
$neighbor_payments = PaymentStates::with('NeighborProperty')->where('neighbor_property_id', '=', $neighbor_property_id)->first();
if ($neighbor_payments) {
$pagos[$j] = $neighbor_payments->{$months}[$j] == NULL ? 0 : $neighbor_payments->{$months}[$j];
} else {
$pagos[$j] = 0;
}
$saldoTotal[$j] = $totalDebe[$j] + $pagos[$j];
} elseif ($j + 1 > date("m")) {
$saldoAnteriol[$j] = "";
$cuataMes[$j] = "";
$totalDebe[$j] = "";
$pagos[$j] = "";
$saldoTotal[$j] = "";
}
}
$neighbor = NeighborProperty::find($neighbor_property_id);
return View::make('dashboard.payments.neighbors.table_neigbor', compact('breadcrumbs_data', 'saldoAnteriol', 'cuataMes', 'totalDebe', 'pagos', 'saldoTotal', 'mes_ini', 'ini', 'months', 'color', 'neighbor'));
}
示例3: reportStatus
public function reportStatus()
{
$user_id = Auth::user()->id;
$colonia = Session::get("colonia");
$urbanism = Urbanism::where('colony_id', '=', $colonia)->first();
$urbanismo = $urbanism->id;
$urb_name = $urbanism->name;
$property_id = NeighborProperty::where('urbanism_id', '=', $urbanismo)->pluck('id');
$vigencia = date("Y-m");
$months = array("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Decem");
$today = date("Y-m-d");
$ano = date("Y");
$selano = Payment::select(DB::raw('DATE_FORMAT(payments.created_at,\'%Y\') as y'))->groupBy(DB::raw('Year(payments.created_at)'))->orderBy(DB::raw('Year(payments.created_at)'))->get();
$monthly_all = MonthlyFee::where('monthly_fee.urbanism_id', '=', $urbanismo)->where(DB::raw('DATE_FORMAT(monthly_fee.since,\'%Y\')'), '=', $ano)->get();
$monthly_ini = MonthlyFee::where('monthly_fee.urbanism_id', '=', $urbanismo)->where(DB::raw('DATE_FORMAT(monthly_fee.since,\'%Y\')'), '=', $ano)->orderBy('monthly_fee.created_at', 'ASC')->pluck('since');
$mes_ini = (int) date("m", strtotime($monthly_ini));
$cuotas = array();
foreach ($monthly_all as $cuota_mensual) {
$ini = (int) date("m", strtotime($cuota_mensual->since));
$fin = (int) date("m", strtotime($cuota_mensual->until));
if ($cuota_mensual->until == NULL) {
$fin = (int) date("m");
}
for ($i = $ini; $i <= $fin; $i++) {
$cuotas[$months[$i - 1]] = $cuota_mensual->amount;
}
}
$neighbors = NeighborProperty::with('Neighbors')->where('urbanism_id', '=', $urbanismo)->get();
$breadcrumbs = Neighbors::select('neighbors.name as name_ne', 'neighbors.last_name', 'urbanisms.name as name_ur ')->join('neighbors_properties', 'neighbors.id', '=', 'neighbors_properties.neighbors_id')->join('urbanisms', 'neighbors_properties.urbanism_id', '=', 'urbanisms.id')->where('neighbors.user_id', '=', self::getUserId())->first();
$breadcrumbs_data = $breadcrumbs->name_ne . " " . $breadcrumbs->last_name . " [" . $breadcrumbs->name_ur . "]";
$data = ['mes_ini' => $mes_ini, 'months' => $months, 'cuotas' => $cuotas, 'selano' => $selano, 'urbanism' => $urbanismo, 'breadcrumbs_data' => $breadcrumbs_data, 'neighbors' => $neighbors, 'ini' => $ini, 'fin' => $fin, 'ano' => $ano, 'breadcrumbs_data' => $breadcrumbs_data];
$pdf = PDF::loadView('dashboard.reports.status.pdf', $data);
return $pdf->download('reporte_Estato_cuanta_general.pdf');
}