UserRecharge.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. /**
  3. * @package merchant
  4. *
  5. * @author xaboy
  6. * @day 2020/6/23
  7. *
  8. *
  9. */
  10. namespace app\controller\admin\user;
  11. use crmeb\basic\BaseController;
  12. use app\common\repositories\user\UserRechargeRepository;
  13. use think\App;
  14. class UserRecharge extends BaseController
  15. {
  16. protected $repository;
  17. public function __construct(App $app, UserRechargeRepository $repository)
  18. {
  19. parent::__construct($app);
  20. $this->repository = $repository;
  21. }
  22. public function getList()
  23. {
  24. $where = $this->request->params(['date', 'paid', 'keyword']);
  25. [$page, $limit] = $this->getPage();
  26. return app('json')->success($this->repository->getList($where, $page, $limit));
  27. }
  28. public function total()
  29. {
  30. $totalRefundPrice = $this->repository->totalRefundPrice();
  31. $totalPayPrice = $this->repository->totalPayPrice();
  32. $totalRoutinePrice = $this->repository->totalRoutinePrice();
  33. $totalWxPrice = $this->repository->totalWxPrice();
  34. return app('json')->success(compact('totalWxPrice', 'totalRoutinePrice', 'totalPayPrice', 'totalRefundPrice'));
  35. }
  36. }