User.php 761 B

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. namespace App\Http\Controllers\Core;
  3. use App\Http\Controllers\Controller;
  4. use App\Models\User\Openid;
  5. class User extends Controller
  6. {
  7. /**
  8. * 通过openid获取uid
  9. * @param string $openid
  10. * @return array
  11. * @throws \App\Exceptions\AlertException
  12. */
  13. public static function getUidByOpenid(string $openid)
  14. {
  15. $model = new Openid();
  16. $data = $model->getUidByopenid($openid);
  17. return $data;
  18. }
  19. /**
  20. * 通过uid获取openid
  21. * @param int $uid
  22. * @return array
  23. * @throws \App\Exceptions\AlertException
  24. */
  25. public static function getOpenidByUid(int $uid)
  26. {
  27. $model = new Openid();
  28. $data = $model->getOpenidByuid($uid);
  29. return $data;
  30. }
  31. }