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


PHP Self::getLastOpen方法代码示例

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


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

示例1: onClosing

 public static function onClosing()
 {
     $getLastOpen = Self::getLastOpen()->toArray();
     #$lastOpen['created_at']
     $lastOpen = $getLastOpen['created_at'];
     /**
      * Total de depositos
      * @var decimal
      */
     $deposites = Till::where('action', Self::getActionTrans('deposit'))->where('created_at', '>=', $lastOpen)->get()->toArray();
     $deposites = array_sum(array_column($deposites, 'cash'));
     /**
      * Total de Ventas
      * @var decimal
      */
     $cash_sales = Till::where('action', Self::getActionTrans('sale'))->where('created_at', '>=', $lastOpen)->get()->toArray();
     $cash_sales = array_sum(array_column($cash_sales, 'cash'));
     /**
      * Total de Ventas
      * @var decimal
      */
     $payable_sales = Till::where('action', Self::getActionTrans('sale'))->where('created_at', '>=', $lastOpen)->get()->toArray();
     $payable_sales = array_sum(array_column($payable_sales, 'payable'));
     /**
      * Total de Retiros
      * @var decimal
      */
     $withdrawals = Till::where('action', Self::getActionTrans('withdrawal'))->where('created_at', '>=', $lastOpen)->get()->toArray();
     $withdrawals = array_sum(array_column($withdrawals, 'cash'));
     $till = ['total_in_open_till' => $getLastOpen['till'], 'total_deposites' => $deposites, 'total_cash_sales' => $cash_sales, 'total_payable_sales' => $payable_sales, 'total_witdrawls' => $withdrawals, 'total_all_sales' => Calc::suma([$cash_sales, $payable_sales]), 'total_till' => Calc::resta([$cash_sales, $deposites, $getLastOpen['till']], [$withdrawals])];
     return (object) $till;
 }
开发者ID:awme,项目名称:stocket,代码行数:32,代码来源:CashRegister.php

示例2: onClosing

 public static function onClosing()
 {
     $getLastOpen = Self::getLastOpen()->toArray();
     #$lastOpen['created_at']
     $lastOpen = $getLastOpen['created_at'];
     /**
      * Total de depositos
      * @var decimal
      */
     $deposites = Till::where('action', Self::getActionTrans('deposit'))->where('created_at', '>=', $lastOpen)->get()->toArray();
     $deposites = array_sum(array_column($deposites, 'total'));
     /**
      * Total de Ventas de Parking
      * @var decimal
      */
     $parking_sales = Till::where('action', Self::getActionTrans('sale'))->where('created_at', '>=', $lastOpen)->get()->toArray();
     $parking_sales = array_sum(array_column($parking_sales, 'total'));
     /**
      * Total de Abonoso pagos
      * @var decimal
      */
     $total_subs = Till::where('action', Self::getActionTrans('sale_subs'))->where('created_at', '>=', $lastOpen)->get()->toArray();
     $total_subs = array_sum(array_column($total_subs, 'total'));
     /**
      * Total de Retiros
      * @var decimal
      */
     $withdrawals = Till::where('action', Self::getActionTrans('withdrawal'))->where('created_at', '>=', $lastOpen)->get()->toArray();
     $withdrawals = array_sum(array_column($withdrawals, 'total'));
     $till = ['total_deposites' => $deposites, 'total_parking_sales' => $parking_sales, 'total_subscription' => $total_subs, 'total_witdrawls' => $withdrawals, 'total_all_sales' => Calc::suma([$parking_sales, $total_subs]), 'total_income' => Calc::suma([$parking_sales, $total_subs, $deposites])];
     $till['total_in_till'] = Calc::resta([$till['total_income']], [$withdrawals]);
     # lo que queda en caja con la suma total menos los depositos.
     return (object) $till;
 }
开发者ID:AWME,项目名称:Parking,代码行数:34,代码来源:CashRegister.php


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