本文整理汇总了PHP中QC::__call方法的典型用法代码示例。如果您正苦于以下问题:PHP QC::__call方法的具体用法?PHP QC::__call怎么用?PHP QC::__call使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QC
的用法示例。
在下文中一共展示了QC::__call方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: qq_sucsess
public function qq_sucsess()
{
session_start();
define('M_ROOT', dirname(dirname(__FILE__)));
$ss = M_ROOT;
$str = str_replace("\\", "/", $ss);
include_once $str . "/API/qq/qqConnectAPI.php";
$qc = new \QC();
$atid = $qc->qq_callback();
$opid = $qc->get_openid();
$opid = (string) $opid;
$state = I('state');
$_SESSION['state'] = $state;
$qc = new \QC($atid, $opid);
// 重新带参地new一次否则会丢失信息
$user_model = D('yuser');
$find = $user_model->field('uid,username,nickname,figureurl,userpic')->where(' openid=' . '"' . $opid . '"')->find();
if (empty($find)) {
$info = $qc->__call('get_user_info');
}
if (!empty($info)) {
$data = array('username' => $info['nickname'], 'nickname' => $info['nickname'], 'sex' => $info['gender'], 'province' => $info['province'], 'city' => $info['city'], 'year' => $info['year'], 'figureurl' => $info['figureurl_qq_2'], 'openid' => $opid, 'tokenid' => $atid, 'addtime' => date('Y-m-d H:i:s'), 'loginip' => get_client_ip(), 'status' => 1);
if ($id = $user_model->add($data)) {
$user = $user_model->field('uid,username,figureurl,userpic')->where('uid=' . $id)->find();
$picName = $find['userpic'];
$picInfo = pathinfo($picName);
$find['userpic'] = $picInfo['filename'] . '70.' . $picInfo['extension'];
$_SESSION['user'] = $user;
$this->redirect('/Index', '登录成功,正在跳转到首页', 0);
}
} else {
$picName = $find['userpic'];
$picInfo = pathinfo($picName);
$find['userpic'] = $picInfo['filename'] . '70.' . $picInfo['extension'];
$qiandao = $user_model->getQiandao($find['uid']);
$find['qiandao'] = $qiandao;
$data = array('lastlogin' => date('Y-m-d H:i:s', time()), 'uid' => session('user.uid'));
$user_model->save($data);
$_SESSION['user'] = $find;
$this->redirect('/Index', '登录成功,正在跳转到首页', 0);
}
}