当前位置: 首页>>代码示例>>PHP>>正文


PHP Carbon::addMonth方法代码示例

本文整理汇总了PHP中Carbon\Carbon::addMonth方法的典型用法代码示例。如果您正苦于以下问题:PHP Carbon::addMonth方法的具体用法?PHP Carbon::addMonth怎么用?PHP Carbon::addMonth使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Carbon\Carbon的用法示例。


在下文中一共展示了Carbon::addMonth方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: onProcessing

 /**
  * A subscription charge has been marked as processing
  *
  * @param integer $chargeId
  * @param integer $userId
  * @param Carbon  $paymentDate
  * @param double  $amount
  */
 public function onProcessing($chargeId, $userId, Carbon $paymentDate, $amount)
 {
     $user = $this->userRepository->getById($userId);
     /** @var $user \BB\Entities\User */
     $user->extendMembership(null, $paymentDate->addMonth());
 }
开发者ID:adamstrawson,项目名称:BBMembershipSystem,代码行数:14,代码来源:SubChargeEventHandler.php

示例2: addInterval

 public function addInterval(Carbon $date)
 {
     switch ($this->interval) {
         case 'yearly':
             $date->addYear();
             break;
         case 'quarterly':
             $date->addMonths(3);
             break;
         case 'weekly':
             $date->addWeek();
             break;
         case 'monthly':
         default:
             $date->addMonth();
     }
     return $date;
 }
开发者ID:SAIBA0011,项目名称:laravel-billing,代码行数:18,代码来源:Plan.php

示例3: singleYearInOutSummarized

 /**
  * @param array  $earned
  * @param array  $spent
  * @param Carbon $start
  * @param Carbon $end
  *
  * @return array
  */
 protected function singleYearInOutSummarized(array $earned, array $spent, Carbon $start, Carbon $end)
 {
     $income = '0';
     $expense = '0';
     $count = 0;
     while ($start < $end) {
         $date = $start->format('Y-m');
         $currentIncome = isset($earned[$date]) ? $earned[$date] : 0;
         $currentExpense = isset($spent[$date]) ? $spent[$date] : 0;
         $income = bcadd($income, $currentIncome);
         $expense = bcadd($expense, $currentExpense);
         $count++;
         $start->addMonth();
     }
     $data = $this->generator->yearInOutSummarized($income, $expense, $count);
     return $data;
 }
开发者ID:roberthorlings,项目名称:firefly-iii,代码行数:25,代码来源:ReportController.php

示例4: createYearHeaders

 /**
  * @param Carbon $current
  * @param Carbon $end
  *
  * @return array
  */
 private function createYearHeaders(Carbon $current, Carbon $end) : array
 {
     $headers = [];
     while ($current < $end) {
         $short = $current->format('m-Y');
         $headers[$short] = $current->formatLocalized((string) trans('config.month'));
         $current->addMonth();
     }
     return $headers;
 }
开发者ID:roberthorlings,项目名称:firefly-iii,代码行数:16,代码来源:BudgetReportHelper.php

示例5: show

 public function show($id)
 {
     $success = true;
     $message = "La actualizacion se realizo correctamente";
     $clients = $this->clienteHostRepo->findByField2('id_host', $id);
     $transacciones = $this->transaccionRepo->getAll();
     $transaccionHost = [];
     $cajeroTransaccion = [];
     foreach ($transacciones as $key => $value) {
         $transaccionHost[$key] = $value->id;
     }
     foreach ($clients as $key => $value) {
         $cajeroTransaccion[$key] = $value->id_transaccion;
     }
     $prueba = 0;
     for ($i = 0; $i < count($transaccionHost); $i++) {
         $contador = 0;
         if (count($cajeroTransaccion) != 0) {
             for ($x = 0; $x < count($cajeroTransaccion); $x++) {
                 if ($transaccionHost[$i] == $cajeroTransaccion[$x]) {
                     $contador++;
                 }
             }
         }
         if ($contador == 0) {
             $transaccionData = $this->transaccionRepo->findOrFail($transaccionHost[$i]);
             $creditoData = $this->creditoRepo->findOrFail($transaccionData->idCredito);
             if ($transaccionData->tipoTransaccion == 'credito') {
                 $datos['id_host'] = $id;
                 $datos['id_cliente'] = $creditoData->idCliente;
                 $datos['saldo'] = $transaccionData->monto;
                 $datos['interes'] = $creditoData->interes;
                 $datos['id_credito'] = $transaccionData->idCredito;
                 $datos['id_transaccion'] = $transaccionData->id;
                 $datos['tipo_transaccion'] = $transaccionData->tipoTransaccion;
                 $registro = $this->clienteHostRepo->create($datos);
                 $cuota = $this->cuotaRepo->findByField('idCredito', $creditoData->id);
                 $fecha = new Carbon($cuota->fechaPago);
                 for ($i = 1; $i <= $creditoData->no_cuotas; $i++) {
                     $dataCuota['id_clienteHost'] = $registro->id;
                     $dataCuota['montoCuota'] = $cuota->montoCuota;
                     $dataCuota['fechaPago'] = $fecha->addMonth();
                     $dataCuota['estado'] = 'activa';
                     $dataCuota['balance'] = $cuota->montoCuota;
                     $this->cuotasHostRepo->create($dataCuota);
                 }
             } else {
                 $bitacoraBranch = $this->bitacoraRepo->findByField('idTransaccionMaster', $transaccionData->id);
                 $prueba = $bitacoraBranch['id_cuota_branch'];
                 $idCreditoBranch = $bitacoraBranch['id_credito_branch'];
                 $idCuotaBranch = $bitacoraBranch['id_cuota_branch'];
                 $creditoBranch = $this->clienteHostRepo->findOrFail($idCreditoBranch);
                 $creditoBranch['saldo'] = $creditoBranch['saldo'] - $transaccionData['monto'];
                 $creditoBranch->save();
                 $cuotaBranch = $this->cuotasHostRepo->findOrFail($idCuotaBranch);
                 $cuotaBranch = $this->cuotasHostRepo->findOrFail($idCuotaBranch);
                 $cuotaBranch['estado'] = 'Cancelada';
                 $cuotaBranch['balance'] = 0.0;
                 $cuotaBranch->save();
             }
         }
     }
     return compact('success', 'message');
 }
开发者ID:Burris19,项目名称:CreditosZacapaCliente,代码行数:64,代码来源:SincronizarController.php

示例6: singleYearInOut

 /**
  * @param array  $earned
  * @param array  $spent
  * @param Carbon $start
  * @param Carbon $end
  *
  * @return array
  */
 protected function singleYearInOut(array $earned, array $spent, Carbon $start, Carbon $end)
 {
     // per month? simply use each month.
     $entries = new Collection();
     while ($start < $end) {
         // total income and total expenses:
         $date = $start->format('Y-m');
         $incomeSum = isset($earned[$date]) ? $earned[$date] : 0;
         $expenseSum = isset($spent[$date]) ? $spent[$date] * -1 : 0;
         $entries->push([clone $start, $incomeSum, $expenseSum]);
         $start->addMonth();
     }
     $data = $this->generator->yearInOut($entries);
     return $data;
 }
开发者ID:zjean,项目名称:firefly-iii,代码行数:23,代码来源:ReportController.php


注:本文中的Carbon\Carbon::addMonth方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。