PairController.php 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <?php
  2. namespace App\Http\Controllers\Share;
  3. use App\Managers\SharePairManager;
  4. use Illuminate\Http\Request;
  5. use App\Http\Controllers\Controller;
  6. use App\Http\Controllers\Core\Auth;
  7. class PairController extends Controller
  8. {
  9. /**
  10. * 获取邀请详情
  11. * @param int $list_id
  12. * @return array
  13. * @deprecated Share/PairGet
  14. */
  15. public function get(int $list_id)
  16. {
  17. $ps = new SharePairManager();
  18. $data = $ps->get($list_id);
  19. return array(
  20. 'code' => 200,
  21. 'message' => 'success',
  22. 'data' => $data
  23. );
  24. }
  25. /**
  26. * 匹配成功率分享完成列表
  27. * @param Request $request
  28. * @return array
  29. * @throws \Tymon\JWTAuth\Exceptions\JWTException
  30. */
  31. public function scorelist(Request $request)
  32. {
  33. $uid = Auth::auth();
  34. $page = $request->get('page') ?? 1;
  35. $pages = array(
  36. 'limit' => 20,
  37. 'page' => $page
  38. );
  39. $ps = new SharePairManager();
  40. $data = $ps->scorelist($uid, $pages);
  41. return array(
  42. 'code' => 200,
  43. 'message' => 'success',
  44. 'data' => $data
  45. );
  46. }
  47. /**
  48. * 退费分享完成列表
  49. * @param Request $request
  50. * @return array
  51. * @throws \Tymon\JWTAuth\Exceptions\JWTException
  52. */
  53. public function refundlist(Request $request)
  54. {
  55. $uid = Auth::auth();
  56. $page = $request->get('page') ?? 1;
  57. $pages = array(
  58. 'limit' => 20,
  59. 'page' => $page
  60. );
  61. $ps = new SharePairManager();
  62. $data = $ps->refundlist($uid, $pages);
  63. return array(
  64. 'code' => 200,
  65. 'message' => 'success',
  66. 'data' => $data
  67. );
  68. }
  69. }