SdkOrderSuccessController.php 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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\SdkOrderSuccessLogic;
  10. use app\v1\validate\gameLog\SdkOrderSuccessValidate;
  11. use support\Request;
  12. use support\Response;
  13. /**
  14. * 订单记录表(支付成功)控制器
  15. */
  16. class SdkOrderSuccessController extends BaseController
  17. {
  18. /**
  19. * 构造函数
  20. */
  21. public function __construct()
  22. {
  23. $this->logic = new SdkOrderSuccessLogic();
  24. $this->validate = new SdkOrderSuccessValidate;
  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. ['game_id', ''],
  36. ['media_id', ''],
  37. ['auth_id', ''],
  38. ['agent_id', ''],
  39. ['site_id', ''],
  40. ['user_name', ''],
  41. ['server_id', ''],
  42. ['server_name', ''],
  43. ['reg_date', ''],
  44. ['pay_date', ''],
  45. ]);
  46. // 传入的是多选game_id, 转换成字符串
  47. // $where['game_id'] = is_array($where['game_id']) ? implode(',', $where['game_id']) : $where['game_id'];
  48. $query = $this->logic->searchByAuth($where);
  49. $data = $this->logic->getList($query);
  50. $data['data'] = $this->logic->trandformListColumn($data['data'], ['game', 'ip', 'agent','auth', 'pay_channel']);
  51. return $this->success($data);
  52. }
  53. /**
  54. * 导出数据
  55. * @param Request $request
  56. * @return Response
  57. */
  58. public function export(Request $request) : Response
  59. {
  60. $where = $request->more([
  61. ['game_id', ''],
  62. ['media_id', ''],
  63. ['auth_id', ''],
  64. ['agent_id', ''],
  65. ['site_id', ''],
  66. ['user_name', ''],
  67. ['server_id', ''],
  68. ['server_name', ''],
  69. ['reg_date', ''],
  70. ['pay_date', ''],
  71. ]);
  72. return $this->logic->export($where);
  73. }
  74. }