ChannelAnalysisController.php 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. <?php
  2. namespace app\v1\controller\dataReport;
  3. use app\v1\logic\dataReport\channelAnalysisLogic;
  4. use plugin\saiadmin\basic\BaseController;
  5. use support\Request;
  6. class ChannelAnalysisController extends BaseController
  7. {
  8. public function __construct()
  9. {
  10. $this->logic = new channelAnalysisLogic();
  11. parent::__construct();
  12. }
  13. // 分时数据
  14. public function getHourDataList(Request $request)
  15. {
  16. $where = $request->more([
  17. ['game_id', ''],
  18. ['media_id', ''],
  19. ['agent_id', ''],
  20. ['site_id', ''],
  21. ['auth_id', ''],
  22. ['reg_date', '']
  23. ]);
  24. $data = $this->logic->getHourDataList($where);
  25. $data = $this->logic->trandformListColumn($data, ['agent']);
  26. return $this->success($data);
  27. }
  28. // 留存数据
  29. public function getActiveDataList(Request $request)
  30. {
  31. $where = $request->more([
  32. ['game_id', ''],
  33. ['media_id', ''],
  34. ['agent_id', ''],
  35. ['site_id', ''],
  36. ['auth_id', ''],
  37. ['reg_date', '']
  38. ]);
  39. $data = $this->logic->getActiveDataList($where);
  40. return $this->success($data);
  41. }
  42. // 渠道总览
  43. public function getAgentDataList(Request $request)
  44. {
  45. $where = $request->more([
  46. ['game_id', ''],
  47. ['media_id', ''],
  48. ['agent_id', ''],
  49. ['site_id', ''],
  50. ['auth_id', ''],
  51. ['reg_date', ''],
  52. ['group', ''],
  53. ['filter', '']
  54. ]);
  55. $data = $this->logic->getAgentDataList($where);
  56. return $this->success($data);
  57. }
  58. // 广告位总览
  59. public function getAdSiteDataList(Request $request)
  60. {
  61. $where = $request->more([
  62. ['game_id', ''],
  63. ['reg_date', ''],
  64. ['media_id', ''],
  65. ['agent_id', ''],
  66. ['agent_name', ''],
  67. ['site_id', ''],
  68. ['site_name', ''],
  69. ['auth_id', ''],
  70. ['filter', '']
  71. ]);
  72. $resultData = $this->logic->getAdSiteDataList($where);
  73. $data = $this->logic->trandformListColumn($resultData['data'], ['agent', 'site', 'auth']);
  74. return $this->success(['data' => $data, 'totalRow' => $resultData['total']]);
  75. }
  76. // 渠道按日分析
  77. public function getAgentDayDataList(Request $request)
  78. {
  79. $where = $request->more([
  80. ['game_id', ''],
  81. ['reg_date', ''],
  82. ['media_id', ''],
  83. ['agent_id', ''],
  84. ['agent_name', ''],
  85. ['site_name', ''],
  86. ['site_id', ''],
  87. ['auth_id', '']
  88. ]);
  89. $resultData = $this->logic->getAgentDayDataList($where);
  90. return $this->success($resultData);
  91. }
  92. // ltv
  93. public function getLtvDataList(Request $request)
  94. {
  95. $where = $request->more([
  96. ['game_id', ''],
  97. ['media_id', ''],
  98. ['auth_id', ''],
  99. ['agent_id', ''],
  100. ['site_id', ''],
  101. ['reg_date', ''],
  102. ['data_type', '']
  103. ]);
  104. $resultData = $this->logic->getLtvDataList($where);
  105. return $this->success($resultData);
  106. }
  107. // ltvm
  108. public function getLtvmDataList(Request $request)
  109. {
  110. $where = $request->more([
  111. ['game_id', ''],
  112. ['media_id', ''],
  113. ['auth_id', ''],
  114. ['agent_id', ''],
  115. ['site_id', ''],
  116. ['reg_date', ''],
  117. ['data_type', '']
  118. ]);
  119. $resultData = $this->logic->getLtvmDataList($where);
  120. return $this->success($resultData);
  121. }
  122. }