IncomeStatistics.php 1.1 KB

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. /**
  3. * Niushop商城系统 - 团队十年电商经验汇集巨献!
  4. * =========================================================
  5. * Copy right 2019-2029 杭州牛之云科技有限公司, 保留所有权利。
  6. * ----------------------------------------------
  7. * 官方网址: https://www.niushop.com
  8. * =========================================================
  9. */
  10. namespace addon\cashier\event;
  11. use app\model\order\Order as OrderModel;
  12. /**
  13. * 资金收入统计
  14. */
  15. class IncomeStatistics
  16. {
  17. public function handle($param)
  18. {
  19. $money = ( new OrderModel() )->getOrderMoneySum([ [ 'site_id', '=', $param[ 'site_id' ] ], [ 'pay_time', 'between', [ $param[ 'start_time' ], $param[ 'end_time' ] ] ], [ 'order_scene', '=', 'cashier' ], [ 'cashier_order_type', '<>', 'recharge' ] ], 'pay_money')[ 'data' ];
  20. return [
  21. [
  22. 'title' => '收银订单',
  23. 'value' => $money,
  24. 'desc' => '统计时间内,收银台所有开放售卡订单实付金额之和',
  25. 'url' => 'cashier://shop/order/lists'
  26. ]
  27. ];
  28. }
  29. }