コード例 #1
0
ファイル: display.ctrl.php プロジェクト: zhang19960118/html11
    $condition = " AND `uniacid` = :uniacid";
    $pars[':uniacid'] = $s_uniacid;
}
if (empty($_W['isfounder'])) {
    $condition .= " AND `uniacid` IN (SELECT `uniacid` FROM " . tablename('uni_account_users') . " WHERE `uid`=:uid)";
    $pars[':uid'] = $_W['uid'];
}
$tsql = "SELECT COUNT(*) FROM " . tablename('uni_account') . " WHERE 1 = 1{$condition}";
$total = pdo_fetchcolumn($tsql, $pars);
$sql = "SELECT * FROM " . tablename('uni_account') . " WHERE 1 = 1{$condition} ORDER BY `uniacid` DESC LIMIT {$start}, {$psize}";
$pager = pagination($total, $pindex, $psize);
$list = pdo_fetchall($sql, $pars);
if (!empty($list)) {
    foreach ($list as &$account) {
        $account['details'] = uni_accounts($account['uniacid']);
        if ($account['default_acid'] == $_W['account']['acid']) {
            $isconnect = $account['details'][$account['default_acid']]['isconnect'];
        }
        $account['role'] = uni_permission($_W['uid'], $account['uniacid']);
        $account['setmeal'] = uni_setmeal($account['uniacid']);
    }
}
if (!$_W['isfounder']) {
    $stat = user_account_permission();
}
if (!empty($_W['setting']['platform']['authstate'])) {
    load()->classs('weixin.platform');
    $account_platform = new WeiXinPlatform();
    $authurl = $account_platform->getAuthLoginUrl();
}
template('account/display');
コード例 #2
0
ファイル: auth.ctrl.php プロジェクト: eduNeusoft/weixin
<?php

/**
 * [WeEngine System] Copyright (c) 2014 WE7.CC
 * WeEngine is NOT a free software, it under the license terms, visited http://www.we7.cc/ for more details.
 */
defined('IN_IA') or exit('Access Denied');
load()->func('communication');
set_time_limit(0);
$dos = array('ticket', 'forward', 'test');
$do = in_array($do, $dos) ? $do : 'forward';
load()->classs('weixin.platform');
$account_platform = new WeiXinPlatform();
$setting = setting_load('platform');
if ($do == 'forward') {
    if (empty($_GPC['auth_code'])) {
        message('授权登录失败,请重试', url('account/display'), 'error');
    }
    $auth_info = $account_platform->getAuthInfo($_GPC['auth_code']);
    $auth_refresh_token = $auth_info['authorization_info']['authorizer_refresh_token'];
    $auth_appid = $auth_info['authorization_info']['authorizer_appid'];
    $account_info = $account_platform->getAccountInfo($auth_appid);
    if (is_error($account_info)) {
        message('授权登录新建公众号失败,请重试', url('account/display'), 'error');
    }
    if (!empty($_GPC['test'])) {
        echo "此为测试平台接入返回结果:<br/> 公众号名称:{$account_info['authorizer_info']['nick_name']} <br/> 接入状态:成功";
        exit;
    }
    if ($account_info['authorizer_info']['service_type_info'] = '0' || $account_info['authorizer_info']['service_type_info'] == '1') {
        if ($account_info['authorizer_info']['verify_type_info'] > -1) {