Ejemplo n.º 1
0
if (isset($_GET['uid']) || $_GET['tel']) {
    $uid = $_GET['uid'];
    $re = new UserProfile();
    if (isset($_GET['password']) && isset($_GET['tel'])) {
        $tel = $_GET['tel'];
        $pwd = md5($_GET['password']);
        $userinfo = $re->checkAuth($tel, $pwd);
        //登录验证密码
        if ($userinfo == FALSE) {
            echo $msg->show('406');
        } else {
            $userinfo = $re->userinfo(null, $tel);
            if (!isset($userinfo['nickname'])) {
                $data = array('nickname' => $tel);
                $condition = '`tel`=' . $tel;
                $re->updateUserInfo($data, $condition);
            }
            $parentpercent = $re->parentpercent($uid);
            //父母信息完成比例
            $likeNum = $re->likeNum($uid);
            //收藏个数
            $data = array('userinfo' => $userinfo, 'parentpercent' => $parentpercent, 'likeNum' => $likeNum);
            echo $msg->show('200', $data);
        }
        exit;
    }
    $userinfo = $re->userinfo($uid, null, $page);
    //个人信息
    if (!$userinfo) {
        echo $msg->show(405);
        exit;