TransactionAnalyzeController.php 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <?php
  2. namespace addons\TinyShop\merchant\modules\statistics\controllers;
  3. use Yii;
  4. use common\helpers\ResultHelper;
  5. use addons\TinyShop\merchant\controllers\BaseController;
  6. /**
  7. * Class TransactionAnalyzeController
  8. * @package addons\TinyShop\merchant\modules\statistics\controllers
  9. * @author jianyan74 <751393839@qq.com>
  10. */
  11. class TransactionAnalyzeController extends BaseController
  12. {
  13. /**
  14. * 运营报告
  15. *
  16. * 24小时/周/月下单商品数
  17. * 24小时/周/月下单金额
  18. */
  19. public function actionIndex()
  20. {
  21. return $this->render($this->action->id, [
  22. 'total' => Yii::$app->tinyShopService->orderStat->getStatByTime(0),
  23. ]);
  24. }
  25. /**
  26. * @return array|mixed
  27. */
  28. public function actionOrderMoney()
  29. {
  30. $type = Yii::$app->request->get('type');
  31. $data = Yii::$app->tinyShopService->orderStat->getBetweenProductMoneyAndCountStatToEchant($type);
  32. return ResultHelper::json(200, '获取成功', $data);
  33. }
  34. /**
  35. * @return array|mixed
  36. */
  37. public function actionOrderCreateCount()
  38. {
  39. $type = Yii::$app->request->get('type');
  40. $data = Yii::$app->tinyShopService->orderStat->getOrderCreateCountStat($type);
  41. return ResultHelper::json(200, '获取成功', $data);
  42. }
  43. /**
  44. * 订单来源
  45. *
  46. * @return array|mixed
  47. */
  48. public function actionOrderFrom()
  49. {
  50. $type = Yii::$app->request->get('type');
  51. $data = Yii::$app->tinyShopService->orderStat->getFormStat($type);
  52. return ResultHelper::json(200, '获取成功', $data);
  53. }
  54. /**
  55. * 订单类型
  56. *
  57. * @return array|mixed
  58. */
  59. public function actionOrderType()
  60. {
  61. $type = Yii::$app->request->get('type');
  62. $data = Yii::$app->tinyShopService->orderStat->getOrderTypeStat($type);
  63. return ResultHelper::json(200, '获取成功', $data);
  64. }
  65. }
粤ICP备19079148号