BalanceStatistic.php 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <?php
  2. namespace app\adminapi\controller\v1\statistic;
  3. use app\adminapi\controller\AuthController;
  4. use app\services\user\UserMoneyServices;
  5. use think\facade\App;
  6. class BalanceStatistic extends AuthController
  7. {
  8. /**
  9. * @param App $app
  10. * @param UserMoneyServices $services
  11. */
  12. public function __construct(App $app, UserMoneyServices $services)
  13. {
  14. parent::__construct($app);
  15. $this->services = $services;
  16. }
  17. /**
  18. * 余额统计基础信息
  19. * @return mixed
  20. */
  21. public function getBasic()
  22. {
  23. $data = $this->services->getBasic();
  24. return app('json')->success($data);
  25. }
  26. /**
  27. * 余额统计趋势图
  28. * @return mixed
  29. */
  30. public function getTrend()
  31. {
  32. $where = $this->request->getMore([
  33. ['time', '']
  34. ]);
  35. $data = $this->services->getTrend($where);
  36. return app('json')->success($data);
  37. }
  38. /**
  39. * 余额来源
  40. * @return mixed
  41. */
  42. public function getChannel()
  43. {
  44. $where = $this->request->getMore([
  45. ['time', '']
  46. ]);
  47. $data = $this->services->getChannel($where);
  48. return app('json')->success($data);
  49. }
  50. /**
  51. * 余额类型
  52. * @return mixed
  53. */
  54. public function getType()
  55. {
  56. $where = $this->request->getMore([
  57. ['time', '']
  58. ]);
  59. $data = $this->services->getType($where);
  60. return app('json')->success($data);
  61. }
  62. }