SdkRegLogController.php 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | saiadmin [ saiadmin快速开发框架 ]
  4. // +----------------------------------------------------------------------
  5. // | Author: your name
  6. // +----------------------------------------------------------------------
  7. namespace app\v1\controller\gameLog;
  8. use plugin\saiadmin\basic\BaseController;
  9. use app\v1\logic\gameLog\SdkRegLogLogic;
  10. use app\v1\validate\gameLog\SdkRegLogValidate;
  11. use support\Request;
  12. use support\Response;
  13. /**
  14. * 注册日志控制器
  15. */
  16. class SdkRegLogController extends BaseController
  17. {
  18. /**
  19. * 构造函数
  20. */
  21. public function __construct()
  22. {
  23. $this->logic = new SdkRegLogLogic();
  24. $this->validate = new SdkRegLogValidate;
  25. parent::__construct();
  26. }
  27. /**
  28. * 数据列表
  29. * @param Request $request
  30. * @return Response
  31. */
  32. public function index(Request $request): Response
  33. {
  34. $where = $request->more([
  35. ['user_name', ''],
  36. ['game_id', ''],
  37. ['media_id', ''],
  38. ['agent_id', ''],
  39. ['site_id', ''],
  40. ['reg_time', ''],
  41. ['vt', ''],
  42. ]);
  43. // 传入的是多选game_id, 转换成字符串
  44. $where['game_id'] = is_array($where['game_id']) ? implode(',', $where['game_id']) : $where['game_id'];
  45. $query = $this->logic->searchByAuth($where);
  46. $data = $this->logic->getList($query);
  47. $data['data'] = $this->logic->trandformListColumn($data['data'], ['game', 'ip', 'agent']);
  48. return $this->success($data);
  49. }
  50. }