当前位置: 首页>>代码示例>>PHP>>正文


PHP account_fetch函数代码示例

本文整理汇总了PHP中account_fetch函数的典型用法代码示例。如果您正苦于以下问题:PHP account_fetch函数的具体用法?PHP account_fetch怎么用?PHP account_fetch使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了account_fetch函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __construct

 public function __construct()
 {
     global $_W;
     load()->func('communication');
     $openid = $_W['openid'];
     if (!empty($openid)) {
         $account = account_fetch($_W['acid']);
         //获取公众号信息
         $url = "https://api.weixin.qq.com/cgi-bin/user/info?access_token=" . $account['access_token']['token'] . "&openid=" . $openid . "&lang=zh_CN";
         $re = ihttp_get($url);
         //ihttp_get()封装的 http GET 请求方法
         if ($re['code'] == 200) {
             $content = json_decode($re['content'], true);
             if ($content['subscribe'] == 1) {
                 //此人已关注
                 $data = array('uniacid' => $_W['uniacid'], 'from_user' => $openid, 'nickname' => $content['nickname'], 'avatar' => $content['headimgurl']);
                 $profile = pdo_fetch("SELECT id FROM " . tablename('auction_member') . " WHERE uniacid ='{$_W['uniacid']}' and from_user = '{$openid}'");
                 if (empty($profile)) {
                     pdo_insert('auction_member', $data);
                 } else {
                     pdo_update('auction_member', $data, array('id' => $profile['id']));
                 }
             } else {
                 $userinfo = mc_oauth_userinfo();
                 $data = array('uniacid' => $_W['uniacid'], 'from_user' => $userinfo['openid'], 'nickname' => $userinfo['nickname'], 'avatar' => $userinfo['avatar']);
                 $profile = pdo_fetch("SELECT id FROM " . tablename('auction_member') . " WHERE uniacid ='{$_W['uniacid']}' and from_user = '{$userinfo['openid']}'");
                 if (empty($profile)) {
                     pdo_insert('auction_member', $data);
                 } else {
                     pdo_update('auction_member', $data, array('id' => $profile['id']));
                 }
             }
         }
     }
 }
开发者ID:wisemyth,项目名称:weizan,代码行数:35,代码来源:site.php

示例2: __construct

 function __construct()
 {
     global $_W, $_GPC;
     $this->_fromuser = $_W['fans']['from_user'];
     //debug
     if ($_SERVER['HTTP_HOST'] == '127.0.0.1') {
         $this->_fromuser = 'debug';
     }
     $this->_weid = $_W['uniacid'];
     $account = account_fetch($this->_weid);
     $this->_auth2_openid = 'auth2_openid_' . $_W['uniacid'];
     $this->_auth2_nickname = 'auth2_nickname_' . $_W['uniacid'];
     $this->_auth2_headimgurl = 'auth2_headimgurl_' . $_W['uniacid'];
     $this->_appid = '';
     $this->_appsecret = '';
     $this->_accountlevel = $account['level'];
     //是否为高级号
     //$lock_path = base64_decode(LOCK);
     //if (!file_exists($lock_path)) {
     // } else {
     //$file_content = file_get_contents($lock_path);
     //$validation_code = $this->authorization();
     //$this->code_compare($file_content, $validation_code);
     // }
     if ($this->_accountlevel == 4) {
         $this->_appid = $account['key'];
         $this->_appsecret = $account['secret'];
     }
 }
开发者ID:6662680,项目名称:qday_wx,代码行数:29,代码来源:site.php

示例3: __construct

 function __construct()
 {
     global $_W, $_GPC;
     $this->_fromuser = $_W['fans']['from_user'];
     //debug
     if ($_SERVER['HTTP_HOST'] == '127.0.0.1') {
         $this->_fromuser = 'debug';
     }
     $this->_weid = $_W['uniacid'];
     $account = account_fetch($this->_weid);
     $this->_auth2_openid = 'auth2_openid_' . $_W['uniacid'];
     $this->_auth2_nickname = 'auth2_nickname_' . $_W['uniacid'];
     $this->_auth2_headimgurl = 'auth2_headimgurl_' . $_W['uniacid'];
     $this->_appid = '';
     $this->_appsecret = '';
     $this->_accountlevel = $account['level'];
     //是否为高级号
     if ($this->_accountlevel == 4) {
         $this->_appid = $account['key'];
         $this->_appsecret = $account['secret'];
     }
     if (!empty($this->_appid) && !empty($this->_appsecret)) {
         require_once IA_ROOT . '/framework/class/account.class.php';
         $acc = WeAccount::create($this->_weid);
         $_W['account']['jssdkconfig'] = $acc->getJssdkConfig();
         $accountInfo = $acc->fetchAccountInfo();
         $_W['account']['access_token'] = $accountInfo['access_token'];
         $_W['account']['jsapi_ticket'] = $accountInfo['jsapi_ticket'];
     }
 }
开发者ID:keycoolkui,项目名称:weixinfenxiao,代码行数:30,代码来源:site.php

示例4: __construct

 function __construct()
 {
     global $_W, $_GPC;
     $this->_fromuser = $_W['fans']['from_user'];
     //debug
     if ($_SERVER['HTTP_HOST'] == '127.0.0.1' || $_SERVER['HTTP_HOST'] == 'localhost:8888') {
         $this->_fromuser = 'debug';
     }
     $this->_weid = $_W['uniacid'];
     $account = $_W['account'];
     $this->_auth2_openid = 'auth2_openid_' . $_W['uniacid'];
     $this->_auth2_nickname = 'auth2_nickname_' . $_W['uniacid'];
     $this->_auth2_headimgurl = 'auth2_headimgurl_' . $_W['uniacid'];
     $this->_appid = '';
     $this->_appsecret = '';
     $this->_accountlevel = $account['level'];
     //是否为高级号
     if (isset($_COOKIE[$this->_auth2_openid])) {
         $this->_fromuser = $_COOKIE[$this->_auth2_openid];
     }
     if ($this->_accountlevel < 4) {
         $setting = uni_setting($this->_weid);
         $oauth = $setting['oauth'];
         if (!empty($oauth) && !empty($oauth['account'])) {
             $this->_account = account_fetch($oauth['account']);
             $this->_appid = $this->_account['key'];
             $this->_appsecret = $this->_account['secret'];
         }
     } else {
         $this->_appid = $_W['account']['key'];
         $this->_appsecret = $_W['account']['secret'];
     }
 }
开发者ID:eduNeusoft,项目名称:weixin,代码行数:33,代码来源:site.php

示例5: __construct

 public function __construct()
 {
     global $_W;
     $this->weid = $_W['uniacid'];
     load()->model('account');
     $_W['account'] = account_fetch($_W['uniacid']);
     $this->appId = $_W['account']['key'];
     $this->appSecret = $_W['account']['secret'];
     //借用了分享
     $set = $this->get_sysset();
     if (!empty($set['appid']) && !empty($set['secret'])) {
         $this->appId = $set['appid'];
         $this->appSecret = $set['secret'];
     }
     $_W['account']['appid_share'] = $this->appId;
     $_W['account']['appsecret_share'] = $this->appSecret;
 }
开发者ID:keycoolkui,项目名称:weixinfenxiao,代码行数:17,代码来源:jssdk.php

示例6: __construct

 function __construct()
 {
     global $_W;
     $weid = $_W['uniacid'];
     $set = pdo_fetch("SELECT * FROM " . tablename('fineness_sysset') . " WHERE weid=:weid limit 1", array(':weid' => $weid));
     if ($set && $set['isget'] == 1) {
         load()->model('account');
         $_W['account'] = account_fetch($_W['uniacid']);
         $this->_appid = trim($_W['account']['key']);
         $this->_appsecret = trim($_W['account']['secret']);
         if ($_W['account']['level'] != 4) {
             //不是认证服务号
             if (!empty($set['appid']) && !empty($set['appsecret'])) {
                 $this->_appid = trim($set['appid']);
                 $this->_appsecret = trim($set['appsecret']);
             }
         }
     }
 }
开发者ID:aspnmy,项目名称:weizan,代码行数:19,代码来源:site.php

示例7: doMobileIndex

 public function doMobileIndex()
 {
     global $_W, $_GPC;
     $account = account_fetch($_W['uniacid']);
     if (!empty($account['key']) && !empty($account['secret'])) {
         require_once IA_ROOT . '/framework/class/account.class.php';
         $acc = WeAccount::create($_W['uniacid']);
         $_W['account']['jssdkconfig'] = $acc->getJssdkConfig();
         $accountInfo = $acc->fetchAccountInfo();
         $_W['account']['access_token'] = $accountInfo['access_token'];
         $_W['account']['jsapi_ticket'] = $accountInfo['jsapi_ticket'];
     }
     $setting = pdo_fetch("select * from " . tablename($this->modulename . '_setting') . " where weid =:weid LIMIT 1", array(':weid' => $_W['uniacid']));
     $share_image = empty($setting['share_image']) ? $_W['siteroot'] . '../addons/weiyun_shuqian/icon.jpg' : tomedia($setting['share_image']);
     $share_title = empty($setting['share_title']) ? '数钱数到手抽筋' : $setting['share_title'];
     $share_desc = empty($setting['share_desc']) ? '数钱数到手抽筋' : $setting['share_desc'];
     $share_url = empty($setting['share_url']) ? $_W['siteroot'] . 'app/' . $this->createMobileUrl('index') : $setting['share_url'];
     include $this->template('index');
 }
开发者ID:keycoolkui,项目名称:weixinfenxiao,代码行数:19,代码来源:site.php

示例8: get_user_info

 public function get_user_info($uid, $openid)
 {
     global $_W;
     load()->func('communication');
     if ($uid == 0) {
         $f_log = pdo_fetch("SELECT * FROM " . tablename('mc_mapping_fans') . " WHERE `uniacid` = '{$_W['uniacid']}' AND `openid` = '{$openid}'");
         if (!empty($f_log['uid'])) {
             pdo_update('hx_subscribe_data', array('uid' => $f_log['uid']), array('openid' => $openid));
             $uid = $f_log['uid'];
         } else {
             $default_groupid = pdo_fetchcolumn('SELECT groupid FROM ' . tablename('mc_groups') . ' WHERE uniacid = :uniacid AND isdefault = 1', array(':uniacid' => $_W['uniacid']));
             $data = array('uniacid' => $_W['uniacid'], 'email' => md5($openid) . '@012wz.com', 'salt' => random(8), 'groupid' => $default_groupid, 'createtime' => TIMESTAMP);
             $data['password'] = md5($message['from'] . $data['salt'] . $_W['config']['setting']['authkey']);
             pdo_insert('mc_members', $data);
             $uid = pdo_insertid();
             pdo_update('mc_mapping_fans', array('uid' => $uid), array('openid' => $openid));
             pdo_update('hx_subscribe_data', array('uid' => $uid), array('openid' => $openid));
         }
     }
     $info = mc_fetch($uid);
     if (empty($info['nickname'])) {
         $account = account_fetch($_W['acid']);
         $url = "https://api.weixin.qq.com/cgi-bin/user/info?access_token=" . $account['access_token']['token'] . "&openid=" . $openid . "&lang=zh_CN";
         $re = ihttp_get($url);
         if ($re['code'] == 200) {
             $content = json_decode($re['content'], true);
             if ($content['subscribe'] == 1) {
                 //此人已关注
                 $data = array('nickname' => $content['nickname'], 'gender' => $content['sex'], 'avatar' => $content['headimgurl'], 'resideprovince' => $content['province'], 'residecity' => $content['city'], 'nationality' => $content['country']);
                 pdo_update('mc_members', $data, array('uid' => $_W['member']['uid']));
                 pdo_update('mc_mapping_fans', array('follow' => 1), array('acid' => $_W['acid'], 'openid' => $openid));
             }
         }
         $info = mc_fetch($uid);
         return $info;
     } else {
         return $info;
     }
 }
开发者ID:eduNeusoft,项目名称:weixin,代码行数:39,代码来源:site.php

示例9: uni_setting

    $settings = uni_setting($uniacid, array('notify'));
    $notify = $settings['notify'] ? $settings['notify'] : array();
    $ownerid = pdo_fetchcolumn("SELECT uid FROM " . tablename('uni_account_users') . " WHERE uniacid = :uniacid AND role = 'owner'", array(':uniacid' => $uniacid));
    if (!empty($ownerid)) {
        $owner = user_single(array('uid' => $ownerid));
        $owner['group'] = pdo_fetch("SELECT id, name, package FROM " . tablename('users_group') . " WHERE id = :id", array(':id' => $owner['groupid']));
        $owner['group']['package'] = iunserializer($owner['group']['package']);
    }
    $extend = pdo_fetch("SELECT * FROM " . tablename('uni_group') . " WHERE uniacid = :uniacid", array(':uniacid' => $uniacid));
    $extend['modules'] = iunserializer($extend['modules']);
    $extend['templates'] = iunserializer($extend['templates']);
    if (!empty($extend['modules'])) {
        $owner['extend']['modules'] = pdo_getall('modules', array('name' => $extend['modules']));
    }
    if (!empty($extend['templates'])) {
        $owner['extend']['templates'] = pdo_getall('site_templates', array('id' => $extend['templates']));
    }
    $extend['package'] = pdo_getall('uni_account_group', array('uniacid' => $uniacid), array(), 'groupid');
    $groups = pdo_fetchall("SELECT id, name, package FROM " . tablename('users_group') . " ORDER BY id ASC", array(), 'id');
    $modules = pdo_fetchall("SELECT mid, name, title FROM " . tablename('modules') . ' WHERE issystem != 1', array(), 'name');
    $templates = pdo_fetchall("SELECT * FROM " . tablename('site_templates'));
} elseif ($step == '4') {
    $uniacid = intval($_GPC['uniacid']);
    $acid = intval($_GPC['acid']);
    $uni_account = pdo_fetch('SELECT * FROM ' . tablename('uni_account') . ' WHERE uniacid = ' . $uniacid);
    if (empty($uni_account)) {
        message('非法访问');
    }
    $account = account_fetch($uni_account['default_acid']);
}
template('account/post-step');
开发者ID:aspnmy,项目名称:weizan,代码行数:31,代码来源:post-step.ctrl.php

示例10: domobileprofile

 public function domobileprofile()
 {
     global $_GPC, $_W;
     $profile = fans_search($_W['fans']['from_user'], array('nickname', 'credit1', 'credit2', 'avatar'));
     if (empty($profile['avatar'])) {
         load()->func('communication');
         $openid = $_W['openid'];
         $account = account_fetch($_W['acid']);
         //获取公众号信息
         $url = "https://api.weixin.qq.com/cgi-bin/user/info?access_token=" . $account['access_token']['token'] . "&openid=" . $openid . "&lang=zh_CN";
         $re = ihttp_get($url);
         //ihttp_get()封装的 http GET 请求方法
         if ($re['code'] == 200) {
             $content = json_decode($re['content'], true);
             if ($content['subscribe'] == 1) {
                 //此人已关注
                 $data = array('nickname' => $content['nickname'], 'gender' => $content['sex'], 'avatar' => $content['headimgurl'], 'resideprovince' => $content['province'], 'residecity' => $content['city'], 'nationality' => $content['country']);
                 pdo_update('mc_members', $data, array('uid' => $_W['member']['uid']));
                 pdo_update('mc_mapping_fans', array('follow' => 1), array('acid' => $_W['acid'], 'openid' => $openid));
                 $profile = fans_search($_W['fans']['from_user'], array('nickname', 'credit1', 'credit2', 'avatar'));
             }
         }
     }
     $carttotal = $this->getCartTotal();
     include $this->template('profile');
 }
开发者ID:noikiy,项目名称:mygit,代码行数:26,代码来源:site.php

示例11: extend_W

 protected function extend_W()
 {
     global $_W;
     if (!empty($_W['openid'])) {
         load()->model('mc');
         $_W['member'] = mc_fetch($_W['openid']);
     }
     if (empty($_W['member'])) {
         $_W['member'] = array();
     }
     if (!empty($_W['acid'])) {
         load()->model('account');
         if (empty($_W['uniaccount'])) {
             $_W['uniaccount'] = uni_fetch($_W['uniacid']);
         }
         if (empty($_W['account'])) {
             $_W['account'] = account_fetch($_W['acid']);
             $_W['account']['qrcode'] = "{$_W['attachurl']}qrcode_{$_W['acid']}.jpg?time={$_W['timestamp']}";
             $_W['account']['avatar'] = "{$_W['attachurl']}headimg_{$_W['acid']}.jpg?time={$_W['timestamp']}";
             $_W['account']['groupid'] = $_W['uniaccount']['groupid'];
         }
     }
 }
开发者ID:aspnmy,项目名称:weizan,代码行数:23,代码来源:account.class.php

示例12: json_encode

        }
        if ($type == 'asc') {
            $exit = json_encode(array('code' => 1, 'str' => $str, 'id' => max(array_keys($data))));
        } else {
            $exit = json_encode(array('code' => 1, 'str' => $str, 'id' => min(array_keys($data))));
        }
    } else {
        $exit = json_encode(array('code' => 2, 'str' => '', 'id' => $id));
    }
    echo $exit;
    exit;
}
if ($do == 'end') {
    $fanid = intval($_GPC['fanid']);
    $fans = pdo_fetch('SELECT fanid,acid,openid FROM ' . tablename('mc_mapping_fans') . ' WHERE uniacid = :uniacid AND fanid = :id', array(':uniacid' => $_W['uniacid'], ':id' => $fanid));
    $account = account_fetch($fans['acid']);
    $message['from'] = $_W['openid'] = $fans['openid'];
    $message['to'] = $account['original'];
    if (!empty($message['to'])) {
        $sessionid = md5($message['from'] . $message['to'] . $_W['uniacid']);
        load()->classs('wesession');
        load()->classs('account');
        session_id($sessionid);
        WeSession::start($_W['uniacid'], $_W['openid'], 300);
        $processor = WeUtility::createModuleProcessor('chats');
        $processor->end();
    }
    if (!empty($_GPC['from'])) {
        $url = base64_decode($_GPC['from']);
    } else {
        $url = url('mc/fans/', array('acid' => $fans['acid']));
开发者ID:nsoff,项目名称:wdlcms,代码行数:31,代码来源:notice.ctrl.php

示例13: mc_oauth_userinfo

function mc_oauth_userinfo($acid = 0)
{
    global $_W;
    if (empty($_W['openid'])) {
        return error(-1, '未指定 openid, 无法获取用户信息.');
    }
    if (intval($_W['account']['level']) < 4) {
        $setting = uni_setting($_W['uniacid']);
        $oauth = $setting['oauth'];
        if (!empty($oauth) && !empty($oauth['account'])) {
            $account = account_fetch($oauth['account']);
        }
    } else {
        $account = $_W['account'];
    }
    if (empty($account)) {
        return error(-2, '未指定网页授权公众号, 无法获取用户信息.');
    }
    if (empty($account['key']) || empty($account['secret'])) {
        return error(-3, '公众号未设置 appId 或 secret.');
    }
    if (intval($account['level']) < 4) {
        return error(-4, '公众号非认证服务号, 无法获取用户信息.');
    }
    $state = 'we7sid-' . $_W['session_id'];
    $_SESSION['dest_url'] = base64_encode($_SERVER['QUERY_STRING']);
    $url = $_W['siteroot'] . "app/index.php?c=auth&a=oauth&scope=userinfo&i={$_W['uniacid']}&j={$_W['acid']}";
    $callback = urlencode($url);
    $forward = 'https://open.weixin.qq.com/connect/oauth2/authorize?appid=' . $account['key'] . '&redirect_uri=' . $callback . '&response_type=code&scope=snsapi_userinfo&state=' . $state . '#wechat_redirect';
    header('Location: ' . $forward);
    exit;
}
开发者ID:legeng,项目名称:project-2,代码行数:32,代码来源:mc.mod.php

示例14: unset

    $_W['gh']['qrcode'] = "{$_W['attachurl']}qrcode_{$_W['acid']}.jpg?time={$_W['timestamp']}";
    $_W['gh']['avatar'] = "{$_W['attachurl']}headimg_{$_W['acid']}.jpg?time={$_W['timestamp']}";
    $_W['gh']['childname'] = $_W['gh']['name'];
    unset($_W['gh']['name']);
    $_W['account'] = array_merge($_W['account'], $_W['gh']);
    unset($_W['gh']);
} else {
    $sql = 'SELECT * FROM ' . tablename('account_wechats') . ' WHERE uniacid=:uniacid ORDER BY `level` DESC LIMIT 1';
    $jsauth_acc = pdo_fetch($sql, array(':uniacid' => $_W['uniacid']));
    $jsauth_acid = $jsauth_acc['acid'];
}
if ($jsauth_acc['level'] < 3) {
    load()->model('account');
    $unisetting = uni_setting();
    $acid = intval($unisetting['jsauth_acid']);
    if (!empty($acid)) {
        $account = account_fetch($jsauth_acid);
    }
    if (!empty($account)) {
        $jsauth_acid = $acid;
        $jsauth_acc = $account;
    }
}
if (!empty($jsauth_acid)) {
    load()->classs('weixin.account');
    $accObj = WeiXinAccount::create($jsauth_acid);
    $_W['account']['jssdkconfig'] = $accObj->getJssdkConfig();
    unset($accObj);
}
unset($jsauth_acid, $jsauth_acc, $acid, $unisetting, $account, $sql, $pars, $where);
load()->func('compat.biz');
开发者ID:hahamy,项目名称:we7,代码行数:31,代码来源:bootstrap.app.inc.php

示例15: changeWechatSend

 private function changeWechatSend($id, $status, $msg = '')
 {
     global $_W;
     $paylog = pdo_fetch("SELECT plid, openid, tag FROM " . tablename('core_paylog') . " WHERE tid = '{$id}' AND status = 1 AND type = 'wechat'");
     if (!empty($paylog['openid'])) {
         $paylog['tag'] = iunserializer($paylog['tag']);
         $acid = $paylog['tag']['acid'];
         $account = account_fetch($acid);
         $payment = uni_setting($account['uniacid'], 'payment');
         if ($payment['payment']['wechat']['version'] == '2') {
             return true;
         }
         $send = array('appid' => $account['key'], 'openid' => $paylog['openid'], 'transid' => $paylog['tag']['transaction_id'], 'out_trade_no' => $paylog['plid'], 'deliver_timestamp' => TIMESTAMP, 'deliver_status' => $status, 'deliver_msg' => $msg);
         $sign = $send;
         $sign['appkey'] = $payment['payment']['wechat']['signkey'];
         ksort($sign);
         $string = '';
         foreach ($sign as $key => $v) {
             $key = strtolower($key);
             $string .= "{$key}={$v}&";
         }
         $send['app_signature'] = sha1(rtrim($string, '&'));
         $send['sign_method'] = 'sha1';
         $account = WeAccount::create($acid);
         $response = $account->changeOrderStatus($send);
         if (is_error($response)) {
             message($response['message']);
         }
     }
 }
开发者ID:ChainBoy,项目名称:wxfx,代码行数:30,代码来源:site.php


注:本文中的account_fetch函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。