UserRecharge.php 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2016~2024 https://www.crmeb.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  8. // +----------------------------------------------------------------------
  9. // | Author: CRMEB Team <admin@crmeb.com>
  10. // +----------------------------------------------------------------------
  11. namespace app\controller\admin\user;
  12. use crmeb\basic\BaseController;
  13. use app\common\repositories\user\UserRechargeRepository;
  14. use think\App;
  15. /**
  16. * Class UserRecharge
  17. * app\controller\admin\user
  18. * 用户充值订单
  19. */
  20. class UserRecharge extends BaseController
  21. {
  22. protected $repository;
  23. public function __construct(App $app, UserRechargeRepository $repository)
  24. {
  25. parent::__construct($app);
  26. $this->repository = $repository;
  27. }
  28. /**
  29. * 充值记录列表
  30. * @return mixed
  31. * @author xaboy
  32. * @day 2020-04-16
  33. */
  34. public function getList()
  35. {
  36. $where = $this->request->params(['date', 'paid', 'keyword','uid','phone','real_name','nickname','recharge_type']);
  37. [$page, $limit] = $this->getPage();
  38. return app('json')->success($this->repository->getList($where, $page, $limit));
  39. }
  40. /**
  41. * 充值统计
  42. * @return mixed
  43. * @author xaboy
  44. * @day 2020-04-16
  45. */
  46. public function total()
  47. {
  48. $totalRefundPrice = $this->repository->totalRefundPrice();
  49. $totalPayPrice = $this->repository->totalPayPrice();
  50. $totalRoutinePrice = $this->repository->totalRoutinePrice();
  51. $totalWxPrice = $this->repository->totalWxPrice();
  52. return app('json')->success(compact('totalWxPrice', 'totalRoutinePrice', 'totalPayPrice', 'totalRefundPrice'));
  53. }
  54. }