ThirdH5ChatController.php 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <?php
  2. namespace App\Http\Controllers\Api\V1;
  3. use Illuminate\Http\Request;
  4. use App\Facades\ThirdH5ChatFacade;
  5. use App\Facades\UserFacade;
  6. class ThirdH5ChatController extends BaseController
  7. {
  8. /**
  9. * Display a listing of the resource.
  10. *
  11. * @return \Illuminate\Http\Response
  12. */
  13. public function index()
  14. {
  15. //
  16. }
  17. /**
  18. * Store a newly created resource in storage.
  19. *
  20. * @param \Illuminate\Http\Request $request
  21. * @return \Illuminate\Http\Response
  22. */
  23. public function store(Request $request)
  24. {
  25. $conditions = [
  26. 'id' => $this->auth()
  27. ];
  28. $fields = ['*'];
  29. $user = UserFacade::findBy($conditions, $fields);
  30. $user = $user->getData()->data;
  31. $uid = $user->third_up_openid;
  32. $nickname = $user->third_up_nickname?$user->third_up_nickname:$user->wx_nickname;
  33. $headUrl = $user->wx_headimgurl;
  34. return ThirdH5ChatFacade::getChatUrl($uid, $nickname, $headUrl);
  35. }
  36. /**
  37. * Display the specified resource.
  38. *
  39. * @param int $id
  40. * @return \Illuminate\Http\Response
  41. */
  42. public function show($id)
  43. {
  44. //
  45. }
  46. /**
  47. * Update the specified resource in storage.
  48. *
  49. * @param \Illuminate\Http\Request $request
  50. * @param int $id
  51. * @return \Illuminate\Http\Response
  52. */
  53. public function update(Request $request, $id)
  54. {
  55. //
  56. }
  57. /**
  58. * Remove the specified resource from storage.
  59. *
  60. * @param int $id
  61. * @return \Illuminate\Http\Response
  62. */
  63. public function destroy($id)
  64. {
  65. //
  66. }
  67. }