家政小程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

WechatInfoController.php 778B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. namespace App\Http\Controllers;
  3. use Illuminate\Http\Request;
  4. use App\Models\WechatInfo;
  5. class WechatInfoController extends Controller
  6. {
  7. /**
  8. * 获取微信信息
  9. * @param Request $request
  10. * @return \Illuminate\Http\JsonResponse
  11. */
  12. function get(Request $request) {
  13. $wechat_id = $request->input("openid");
  14. if($wechat_id) {
  15. $info = WechatInfo::where("openid", $wechat_id)->first();
  16. return Response()->json([
  17. "status" => 0,
  18. "data" => $info
  19. ]);
  20. }
  21. }
  22. /**
  23. * 获取所有微信信息
  24. * @param Request $request
  25. * @return mixed
  26. */
  27. public function list(Request $request)
  28. {
  29. return WechatInfo::paginate(20);
  30. }
  31. }