BalanceStatistic.php 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2016~2026 https://www.crmeb.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  8. // +----------------------------------------------------------------------
  9. // | Author: CRMEB Team <admin@crmeb.com>
  10. // +----------------------------------------------------------------------
  11. namespace app\adminapi\controller\v1\statistic;
  12. use app\adminapi\controller\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. $data = $this->services->getBasic();
  33. return app('json')->success($data);
  34. }
  35. /**
  36. * 余额统计趋势图
  37. * @return mixed
  38. */
  39. public function getTrend()
  40. {
  41. $where = $this->request->getMore([
  42. ['time', '']
  43. ]);
  44. $data = $this->services->getTrend($where);
  45. return app('json')->success($data);
  46. }
  47. /**
  48. * 余额来源
  49. * @return mixed
  50. */
  51. public function getChannel()
  52. {
  53. $where = $this->request->getMore([
  54. ['time', '']
  55. ]);
  56. $data = $this->services->getChannel($where);
  57. return app('json')->success($data);
  58. }
  59. /**
  60. * 余额类型
  61. * @return mixed
  62. */
  63. public function getType()
  64. {
  65. $where = $this->request->getMore([
  66. ['time', '']
  67. ]);
  68. $data = $this->services->getType($where);
  69. return app('json')->success($data);
  70. }
  71. }