<?php

namespace App\Http\Controllers\Core;

use App\Http\Controllers\Controller;
use App\Models\User\Openid;

class User extends Controller
{
    /**
     * 通过openid获取uid
     * @param  string  $openid
     * @return array
     * @throws \App\Exceptions\AlertException
     */
    public static function getUidByOpenid(string $openid)
    {
        $model = new Openid();
        $data = $model->getUidByopenid($openid);
        return $data;
    }

    /**
     * 通过uid获取openid
     * @param  int  $uid
     * @return array
     * @throws \App\Exceptions\AlertException
     */
    public static function getOpenidByUid(int $uid)
    {
        $model = new Openid();
        $data = $model->getOpenidByuid($uid);
        return $data;
    }
}
