本文整理匯總了PHP中Logs::record方法的典型用法代碼示例。如果您正苦於以下問題:PHP Logs::record方法的具體用法?PHP Logs::record怎麽用?PHP Logs::record使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Logs
的用法示例。
在下文中一共展示了Logs::record方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getGET
$_SESSION['parent_id'] = 0;
}
if (!isset($_SESSION['openid'])) {
$_SESSION['openid'] = '';
}
if (!isset($_SESSION['account'])) {
$_SESSION['account'] = '';
}
//$_SESSION['account'] = 'SJ000000';
$code = getGET('code');
$state = getGET('state');
//微信獲取和同步用戶信息
if ($_SESSION['openid'] == '' && $code != '' && $state == 2048 && is_weixin()) {
$wechat_user = get_user_info($code, $config['appid'], $config['appsecret'], 'userinfo');
if ($wechat_user) {
$log->record("get user openid:" . $wechat_user->openid);
$_SESSION['openid'] = $wechat_user->openid;
$get_account = 'select `account` from ' . $db->table('member') . ' where `openid`=\'' . $wechat_user->openid . '\'';
$account = $db->fetchOne($get_account);
if (!$account) {
//檢查用戶的unionid
$access_token = get_access_token($config['appid'], $config['appsecret']);
$all_info = get_user_wechat_info($access_token, $wechat_user->openid);
if (isset($all_info->unionid)) {
$get_account = 'select `account` from ' . $db->table('member') . ' where `unionid`=\'' . $db->escape($all_info->unionid) . '\'';
$account = $db->fetchOne($get_account);
if ($account) {
$member_data = array('openid' => $_SESSION['openid']);
$db->autoUpdate('member', $member_data, '`account`=\'' . $account . '\'');
}
}