OrderStatistic.php 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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. ['order_province', ''],
  31. ['order_city', ''],
  32. ['order_district', ''],
  33. ]);
  34. $data = $this->services->getBasic($where);
  35. return app('json')->success($data);
  36. }
  37. /**
  38. * 订单统计趋势图
  39. * @return mixed
  40. */
  41. public function getTrend()
  42. {
  43. $where = $this->request->getMore([
  44. ['time', ''],
  45. ['order_province', ''],
  46. ['order_city', ''],
  47. ['order_district', ''],
  48. ]);
  49. $data = $this->services->getTrend($where);
  50. return app('json')->success($data);
  51. }
  52. /**
  53. * 订单来源
  54. * @return mixed
  55. */
  56. public function getChannel()
  57. {
  58. $where = $this->request->getMore([
  59. ['time', ''],
  60. ['order_province', ''],
  61. ['order_city', ''],
  62. ['order_district', ''],
  63. ]);
  64. $data = $this->services->getChannel($where);
  65. return app('json')->success($data);
  66. }
  67. /**
  68. * 订单类型
  69. * @return mixed
  70. */
  71. public function getType()
  72. {
  73. $where = $this->request->getMore([
  74. ['time', ''],
  75. ['order_province', ''],
  76. ['order_city', ''],
  77. ['order_district', ''],
  78. ]);
  79. $data = $this->services->getType($where);
  80. return app('json')->success($data);
  81. }
  82. }