OrderStatistic.php 1.5 KB

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