UserRecharge.php 1.0 KB

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