OrderStatistic.php 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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\statistic\OrderStatisticServices;
  14. use think\facade\App;
  15. class OrderStatistic extends AuthController
  16. {
  17. public function __construct(App $app, OrderStatisticServices $services)
  18. {
  19. parent::__construct($app);
  20. $this->services = $services;
  21. }
  22. /**
  23. * 订单统计基础信息
  24. * @return mixed
  25. */
  26. public function getBasic()
  27. {
  28. $where = $this->request->getMore([
  29. ['time', '']
  30. ]);
  31. $data = $this->services->getBasic($where);
  32. return app('json')->success($data);
  33. }
  34. /**
  35. * 订单统计趋势图
  36. * @return mixed
  37. */
  38. public function getTrend()
  39. {
  40. $where = $this->request->getMore([
  41. ['time', '']
  42. ]);
  43. $data = $this->services->getTrend($where);
  44. return app('json')->success($data);
  45. }
  46. /**
  47. * 订单来源
  48. * @return mixed
  49. */
  50. public function getChannel()
  51. {
  52. $where = $this->request->getMore([
  53. ['time', '']
  54. ]);
  55. $data = $this->services->getChannel($where);
  56. return app('json')->success($data);
  57. }
  58. /**
  59. * 订单类型
  60. * @return mixed
  61. */
  62. public function getType()
  63. {
  64. $where = $this->request->getMore([
  65. ['time', '']
  66. ]);
  67. $data = $this->services->getType($where);
  68. return app('json')->success($data);
  69. }
  70. }