BalanceStatistic.php 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2016~2023 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\v1\statistic;
  12. use app\controller\admin\AuthController;
  13. use app\services\user\UserMoneyServices;
  14. use think\facade\App;
  15. class BalanceStatistic extends AuthController
  16. {
  17. /**
  18. * @param App $app
  19. * @param UserMoneyServices $services
  20. */
  21. public function __construct(App $app, UserMoneyServices $services)
  22. {
  23. parent::__construct($app);
  24. $this->services = $services;
  25. }
  26. /**
  27. * 余额统计基础信息
  28. * @return mixed
  29. */
  30. public function getBasic()
  31. {
  32. $where = $this->request->getMore([
  33. ['time', '']
  34. ]);
  35. $data = $this->services->getBasic($where);
  36. return app('json')->success($data);
  37. }
  38. /**
  39. * 余额统计趋势图
  40. * @return mixed
  41. */
  42. public function getTrend()
  43. {
  44. $where = $this->request->getMore([
  45. ['time', '']
  46. ]);
  47. $data = $this->services->getTrend($where);
  48. return app('json')->success($data);
  49. }
  50. /**
  51. * 余额来源
  52. * @return mixed
  53. */
  54. public function getChannel()
  55. {
  56. $where = $this->request->getMore([
  57. ['time', '']
  58. ]);
  59. $data = $this->services->getChannel($where);
  60. return app('json')->success($data);
  61. }
  62. /**
  63. * 余额类型
  64. * @return mixed
  65. */
  66. public function getType()
  67. {
  68. $where = $this->request->getMore([
  69. ['time', '']
  70. ]);
  71. $data = $this->services->getType($where);
  72. return app('json')->success($data);
  73. }
  74. }