• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP WeAccount类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: respond

 public function respond()
 {
     global $_W;
     $rid = $this->rule;
     $sql = "SELECT * FROM " . tablename('wxcard_reply') . " WHERE rid = :rid ORDER BY RAND() LIMIT 1";
     $reply = pdo_fetch($sql, array(':rid' => $rid));
     if (empty($reply)) {
         return false;
     }
     load()->classs('weixin.account');
     load()->classs('coupon');
     $coupon = new coupon($_W['acid']);
     if (is_error($coupon)) {
         $this->error($reply, $coupon['message']);
         die;
     }
     $card = $coupon->BuildCardExt($reply['cid']);
     if (is_error($card)) {
         $this->error($reply, $card['message']);
         die;
     }
     $data = array('touser' => $_W['openid'], 'msgtype' => 'wxcard', 'wxcard' => array('card_id' => $card['card_id'], 'card_ext' => $card['card_ext']));
     $acc = WeAccount::create($_W['acid']);
     $status = $acc->sendCustomNotice($data);
     if (is_error($status)) {
         $this->error($reply, $status['message']);
         die;
     }
     if (!empty($reply['success'])) {
         return $this->respText($reply['success']);
         die;
     }
     return true;
 }
开发者ID:zhang19960118,项目名称:html11,代码行数:34,代码来源:processor.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'];
     //是否为高级号
     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


示例3: doWebChatlog

 public function doWebChatlog()
 {
     global $_GPC, $_W;
     load()->func('tpl');
     $acids = uni_accounts($_W['uniacid']);
     if (!empty($acids)) {
         $data = array();
         foreach ($acids as $acid) {
             if (in_array($acid['level'], array(3, 4))) {
                 $data[] = $acid;
             }
         }
     }
     $starttime = empty($_GPC['starttime']) ? strtotime(date('Y-m-d')) : strtotime($_GPC['starttime']);
     if (!empty($_GPC['token'])) {
         unset($_GPC['token']);
         $avatar = '';
         $endtime = $starttime + 23 * 3600 + 3599;
         $acid = intval($_GPC['acid']);
         if (!empty($_GPC['nickname']) && empty($_GPC['openid'])) {
             $user = pdo_fetch('SELECT b.openid,a.avatar FROM ' . tablename('mc_members') . ' AS a LEFT JOIN ' . tablename('mc_mapping_fans') . ' AS b ON a.uid = b.uid WHERE a.nickname = :nickname', array(':nickname' => trim($_GPC['nickname'])));
             if (empty($user['openid'])) {
                 message('没有找到昵称为 "' . $_GPC['nickname'] . '" 的用户', $this->createWebUrl('chatlog', array('acid' => $acid, 'nickname' => $_GPC['nickname'], 'openid' => $_GPC['openid'], 'starttime' => $_GPC['starttime'])), 'error');
             } else {
                 if (!empty($user['avatar'])) {
                     $avatar = tomedia($user['avatar']);
                     $nickname = $user['nickname'];
                 }
             }
         } else {
             $openid = trim($_GPC['openid']);
             $user = pdo_fetch('SELECT b.openid,a.avatar,a.nickname FROM ' . tablename('mc_members') . ' AS a LEFT JOIN ' . tablename('mc_mapping_fans') . ' AS b ON a.uid = b.uid WHERE b.openid = :openid', array(':openid' => trim($_GPC['openid'])));
             if (!empty($user['avatar'])) {
                 $avatar = tomedia($user['avatar']);
                 $nickname = $user['nickname'];
             }
         }
         if ($acid > 0 && !empty($starttime) && !empty($endtime) && !empty($openid)) {
             $pindex = max(1, intval($_GPC['page']));
             $acc = WeAccount::create($acid);
             $params = array('openid' => trim($_GPC['openid']), 'starttime' => $starttime, 'endtime' => $endtime, 'pageindex' => $pindex, 'pagesize' => 1000);
             $logs = $acc->fetchChatLog($params);
             $next = 1;
             if (is_error($logs) || empty($logs['recordlist']) || count($logs['recordlist']) < $params['pagesize']) {
                 $next = 0;
             }
             $codedata = array();
             $codedata[1000] = '创建未接入会话';
             $codedata[1001] = '接入会话';
             $codedata[1002] = '主动发起会话';
             $codedata[1004] = '关闭会话';
             $codedata[1005] = '抢接会话';
             $codedata[2001] = '公众号收到消息';
             $codedata[2002] = '客服发送消息';
             $codedata[2003] = '客服收到消息';
         }
     }
     include $this->template('chatlog');
 }
开发者ID:legeng,项目名称:project-2,代码行数:59,代码来源:site.php


示例4: __construct

 public function __construct()
 {
     global $_W;
     $this->account = WeAccount::create($_W['account']);
     $this->modules = array_keys($_W['modules']);
     $this->modules[] = 'cover';
     $this->modules[] = 'default';
     $this->modules = array_unique($this->modules);
 }
开发者ID:ChainBoy,项目名称:wxfx,代码行数:9,代码来源:api.php


示例5: getAccessToken

 public function getAccessToken()
 {
     global $_W;
     load()->model('account');
     $acid = $_W['acid'];
     if (empty($acid)) {
         $acid = $_W['uniacid'];
     }
     $account = WeAccount::create($acid);
     $token = $account->fetch_available_token();
     return $token;
 }
开发者ID:keycoolkui,项目名称:weixinfenxiao,代码行数:12,代码来源:wechatapi.php


示例6: 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


示例7: doMobilelikePage

 public function doMobilelikePage()
 {
     global $_GPC, $_W;
     $uniacid = $_W['uniacid'];
     $openid = $_W['openid'];
     load()->func('logging');
     logging_run($openid, '', 'openid');
     if (empty($openid)) {
         echo "error";
         exit;
     }
     $acid = intval($_W['account']['uniacid']);
     $acc = WeAccount::create($acid);
     $fan = $acc->fansQueryInfo($_W['openid'], true);
     if (intval($fan['errno']) == -1) {
         echo "noway";
         exit;
     }
     if ($fan['subscribe'] != '1') {
         echo "unsub";
         exit;
     }
     $type = 1;
     $result = $this->pic_limit($type);
     if ($result) {
         echo 'liked';
     } else {
         $param = array('uniacid' => $uniacid, 'openid' => $openid, 'tousername' => $tousername, 'time' => date("Y-m-d H:i:s", time()), 'picid' => $_GPC['personalPicWallId']);
         pdo_insert('ice_picWallLikelist', $param);
         $param2 = array(':uniacid' => $uniacid, 'picid' => $_GPC['personalPicWallId']);
         $sql = 'SELECT count(openid) FROM ' . tablename('ice_picWallLikelist') . ' WHERE uniacid = :uniacid and picid = :picid';
         $column = pdo_fetchcolumn($sql, $param2);
         load()->func('logging');
         logging_run('点赞数据更新:' . $column, '', 'column');
         if (intval($column) > 0) {
             pdo_update('ice_picWallMain', array('likenum' => $column), array('id' => $_GPC['personalPicWallId']));
         }
         echo $column;
     }
 }
开发者ID:wisemyth,项目名称:weizan,代码行数:40,代码来源:site.php


示例8: receive

 public function receive()
 {
     global $_W;
     load()->model('mc');
     $type = $this->message['type'];
     $event = $this->message['event'];
     $openid = $this->message['from'];
     $config = $this->module['config'];
     $acc = WeAccount::create($_W['acid']);
     if ($event == 'subscribe' && $config['sub_num'] != 0 && !empty($config['sub_type'])) {
         $log = pdo_fetch("SELECT id FROM " . tablename('ju_credit_log') . " WHERE uniacid=:uniacid and openid=:openid", array(':uniacid' => $_W['uniacid'], ':openid' => $openid));
         if (empty($log)) {
             $uid = mc_openid2uid($openid);
             $result = mc_credit_update($uid, $config['sub_type'], $config['sub_num'], array('0' => '1', '1' => '关注平台奖励'));
             if ($result) {
                 $insert = array('uniacid' => $_W['uniacid'], 'openid' => $openid, 'subscribetime' => time(), 'unsubscribetime' => 0, 'follow' => 1);
                 pdo_insert('ju_credit_log', $insert);
                 $this->sendText($acc, $this->message['from'], '感谢您的关注,赠送您' . $config['sub_num'] . '!');
             }
         } else {
             pdo_update('ju_credit_log', array('follow' => 1, 'subscribetime' => time()), array('id' => $log['id']));
         }
     } elseif ($event == 'unsubscribe' && $config['unsub_num'] != 0) {
         $log = pdo_fetch("SELECT id FROM " . tablename('ju_credit_log') . " WHERE uniacid=:uniacid and openid=:openid", array(':uniacid' => $_W['uniacid'], ':openid' => $openid));
         $uid = mc_openid2uid($openid);
         if (empty($log)) {
             $result = mc_credit_update($uid, $config['unsub_type'], '-' . $config['unsub_num'], array('0' => '1', '1' => '取消关注平台扣除'));
             if ($result) {
                 $insert = array('uniacid' => $_W['uniacid'], 'openid' => $openid, 'subscribetime' => 0, 'unsubscribetime' => time(), 'follow' => 0);
                 pdo_insert('ju_credit_log', $insert);
             }
         } else {
             $result = mc_credit_update($uid, $config['unsub_type'], '-' . $config['unsub_num'], array('0' => '1', '1' => '取消关注平台扣除'));
             pdo_update('ju_credit_log', array('follow' => 0, 'subscribetime' => 0, 'unsubscribetime' => time()), array('id' => $log['id']));
         }
     }
 }
开发者ID:aspnmy,项目名称:weizan,代码行数:37,代码来源:receiver.php


示例9: base64_encode

                 $auth = base64_encode(json_encode($pass));
                 $vars = array();
                 $vars['__auth'] = $auth;
                 $vars['forward'] = base64_encode($c['url']);
                 $row['url'] = $_W['siteroot'] . 'app/' . murl('auth/forward', $vars);
             }
             $news[] = $row;
         }
         $send['news']['articles'] = $news;
     } else {
         $idata = array();
         $send['news'] = '';
     }
 }
 if ($acid) {
     $acc = WeAccount::create($acid);
     $data = $acc->sendCustomNotice($send);
     if (is_error($data)) {
         exit(json_encode(array('status' => 'error', 'message' => $data['message'])));
     } else {
         $account = account_fetch($acid);
         $message['from'] = $_W['openid'] = $send['touser'];
         $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->begin(300);
开发者ID:nsoff,项目名称:wdlcms,代码行数:31,代码来源:notice.ctrl.php


示例10: payResult

 public function payResult($params)
 {
     global $_W;
     $fee = intval($params['fee']);
     $data = array('status' => $params['result'] == 'success' ? 1 : 0);
     $paytype = array('credit' => 1, 'wechat' => 2, 'alipay' => 2, 'delivery' => 3);
     $data['pay_type'] = $paytype[$params['type']];
     if ($params['result'] == 'success') {
         $data['pay_time'] = TIMESTAMP;
     }
     pdo_update('daijia_orders', $data, array('ordersn' => $params['tid']));
     if ($params['from'] == 'return') {
         $setting = uni_setting($_W['uniacid'], array('creditbehaviors'));
         $credit = $setting['creditbehaviors']['currency'];
         //支付成功,打印订单
         $order = pdo_fetch("SELECT * FROM " . tablename('daijia_orders') . "where ordersn={$params['tid']}");
         //获取所有打印机
         $prints = pdo_fetchall('SELECT * FROM ' . tablename('daijia_print') . ' WHERE uniacid = :aid AND status = 1', array(':aid' => $_W['uniacid']));
         if (empty($prints)) {
             // exit('没有有效的打印机');
         }
         $paytype = $order['paytype'] == '3' ? '货到付款' : '已付款';
         $ordertype = $order['type'] == 'daijia' ? '代驾' : '代劳、代步';
         //邮件提醒
         $orderinfo = '';
         $orderinfo .= '订单编号  起始地址   目的地址 价格   备注<BR>';
         $orderinfo .= '--------------------------------<BR>';
         $orderInfo .= "{$order['ordersn']}{$order['start_address']}{$order['end_address']}{$order['price']}{$order['remark']}<br />";
         $orderInfo .= '--------------------------------<BR>';
         $orderinfo .= "合计:{$order['price']}元<BR>";
         $orderinfo .= "联系电话:{$order['mobile']}<BR>";
         $orderinfo .= "支付方式:{$paytype}<BR>";
         //微信提醒
         $sendinfo = '您的订单支付成功,请等待处理:\\n';
         $sendinfo .= '--------------------\\n';
         $sendinfo .= "{$ordertype}详情:\n";
         $sendinfo .= '--------------------\\n';
         $sendinfo .= "订单编号:{$order['ordersn']}\n";
         $sendinfo .= "起始地址: {$order['start_address']}\n";
         $sendinfo .= "目的地址: {$order['end_address']}\n";
         $sendinfo .= "备注: {$order['remark']}\n";
         $sendinfo .= '--------------------\\n';
         $sendinfo .= "合计:{$order['price']}元\n";
         $sendinfo .= "联系电话:{$order['mobile']}\n";
         $sendinfo .= "支付方式:{$paytype}\n";
         //发送微信提醒
         $send['msgtype'] = 'text';
         $send['text'] = array('content' => urlencode($sendinfo));
         $acc = WeAccount::create($_W['account']['acid']);
         $send['touser'] = trim($_W['openid']);
         $s_mess = $acc->sendCustomNotice($send);
         include 'wprint.class.php';
         //遍历所有打印机
         foreach ($prints as $li) {
             if (!empty($li['qrcode_link'])) {
                 $orderinfo .= "<QR>{$li['qrcode_link']}</QR>";
             }
             if (!empty($li['print_no']) && !empty($li['key'])) {
                 $wprint = new wprint();
                 $status = $wprint->StrPrint($li['print_no'], $li['key'], $orderinfo, 1);
                 if (!is_error($status)) {
                     $i++;
                     $data2 = array('uniacid' => $_W['uniacid'], 'sid' => $sid, 'pid' => $li['id'], 'oid' => $id, 'status' => 1, 'aid' => $status, 'addtime' => TIMESTAMP);
                     pdo_insert('daijia_order_print', $data2);
                 }
             }
         }
         // if($i > 0) {
         // 	 pdo_query('UPDATE ' . tablename('str_order') . " SET print_nums = print_nums + {$i} WHERE uniacid = {$_W['uniacid']} AND id = {$id}");
         // } else {
         // 	exit('发送打印指令失败。没有有效的机器号');
         // }
         // exit('success');
         //打印结束
         if ($params['type'] == $credit) {
             message('支付成功!', $this->createMobileUrl('daijia', array('op' => 'yes')), 'success');
         } else {
             message('支付成功!', '../../app/' . $this->createMobileUrl('daijia', array('op' => 'yes')), 'success');
         }
     }
 }
开发者ID:noikiy,项目名称:mygit,代码行数:81,代码来源:site.php


示例11: sendtempmsg

 public function sendtempmsg($template_id, $url, $data, $topcolor, $tousers = '')
 {
     load()->func('communication');
     load()->classs('weixin.account');
     $access_token = WeAccount::token();
     if (empty($access_token)) {
         return;
     }
     $postarr = '{"touser":"' . $tousers . '","template_id":"' . $template_id . '","url":"' . $url . '","topcolor":"' . $topcolor . '","data":' . $data . '}';
     $res = ihttp_post('https://api.weixin.qq.com/cgi-bin/message/template/send?access_token=' . $access_token, $postarr);
     return true;
 }
开发者ID:eduNeusoft,项目名称:weixin,代码行数:12,代码来源:site.php


示例12: doWebhotelset

 public function doWebhotelset()
 {
     global $_GPC, $_W;
     $acc = WeAccount::create($_W['acid']);
     $id = intval($_GPC['id']);
     if (checksubmit('submit')) {
         $data = array('weid' => $_W['uniacid'], 'location_p' => $_GPC['district']['province'], 'location_c' => $_GPC['district']['city'], 'location_a' => $_GPC['district']['district'], 'version' => $_GPC['version'], 'user' => $_GPC['user'], 'reg' => $_GPC['reg'], 'regcontent' => $_GPC['regcontent'], 'bind' => $_GPC['bind'], 'ordertype' => $_GPC['ordertype'], 'paytype1' => $_GPC['paytype1'], 'paytype2' => $_GPC['paytype2'], 'paytype3' => $_GPC['paytype3'], 'is_unify' => $_GPC['is_unify'], 'tel' => $_GPC['tel'], 'email' => $_GPC['email'], 'mobile' => $_GPC['mobile'], 'template' => $_GPC['template'], 'templateid' => trim($_GPC['templateid']));
         if ($data['template'] && $data['templateid'] == '') {
             message('请输入模板ID', referer(), 'info');
         }
         if (!empty($id)) {
             pdo_update("hotel2_set", $data, array("id" => $id));
         } else {
             pdo_insert("hotel2_set", $data);
         }
         message("保存设置成功!", referer(), "success");
     }
     $sql = 'SELECT * FROM ' . tablename('hotel2_set') . ' WHERE `weid` = :weid';
     $set = pdo_fetch($sql, array(':weid' => $_W['uniacid']));
     if (empty($set)) {
         $set = array('user' => 1, 'reg' => 1, 'bind' => 1);
     }
     include $this->template("hotelset");
 }
开发者ID:aspnmy,项目名称:weizan,代码行数:24,代码来源:site.php


示例13: header

        $oauth_account = WeAccount::create($_W['account']['oauth']);
        $forward = $oauth_account->getOauthCodeUrl($callback, $state);
        header('Location: ' . $forward);
        exit;
    }
}
$_W['account']['groupid'] = $_W['uniaccount']['groupid'];
$_W['account']['qrcode'] = tomedia('qrcode_' . $_W['acid'] . '.jpg') . '?time=' . $_W['timestamp'];
$_W['account']['avatar'] = tomedia('headimg_' . $_W['acid'] . '.jpg') . '?time=' . $_W['timestamp'];
if ($_W['container'] == 'wechat') {
    if ($_W['account']['level'] < 3) {
        if (!empty($unisetting['jsauth_acid'])) {
            $jsauth_acid = $unisetting['jsauth_acid'];
        } elseif (!empty($unisetting['oauth']['account'])) {
            $jsauth_acid = $unisetting['oauth']['account'];
        }
    } else {
        $jsauth_acid = $_W['acid'];
    }
    if (!empty($jsauth_acid)) {
        $accountObj = WeAccount::create($jsauth_acid);
        $_W['account']['jssdkconfig'] = $accountObj->getJssdkConfig();
        $_W['account']['jsauth_acid'] = $jsauth_acid;
    }
    unset($jsauth_acid, $accountObj);
}
$_W['card_permission'] = 0;
if ($_W['acid'] && $_W['account']['level'] >= 3 && $_W['container'] == 'wechat') {
    $_W['card_permission'] = 1;
}
load()->func('compat.biz');
开发者ID:aspnmy,项目名称:weizan,代码行数:31,代码来源:bootstrap.app.inc.php


示例14: defined

/**
 * [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');
$dos = array('display', 'change', 'qr', 'chat');
$do = !empty($_GPC['do']) && in_array($do, $dos) ? $do : 'display';
load()->model('account');
if ($do == 'display') {
    template('platform/url2qr');
}
if ($do == 'change') {
    if ($_W['ispost']) {
        load()->func('communication');
        $longurl = trim($_GPC['longurl']);
        $token = WeAccount::token(WeAccount::TYPE_WEIXIN);
        $url = "https://api.weixin.qq.com/cgi-bin/shorturl?access_token={$token}";
        $send = array();
        $send['action'] = 'long2short';
        $send['long_url'] = $longurl;
        $response = ihttp_request($url, json_encode($send));
        if (is_error($response)) {
            $result = error(-1, "访问公众平台接口失败, 错误: {$response['message']}");
        }
        $result = @json_decode($response['content'], true);
        if (empty($result)) {
            $result = error(-1, "接口调用失败, 元数据: {$response['meta']}");
        } elseif (!empty($result['errcode'])) {
            $result = error(-1, "访问微信接口错误, 错误代码: {$result['errcode']}, 错误信息: {$result['errmsg']}");
        }
        if (is_error($result)) {
开发者ID:legeng,项目名称:project-2,代码行数:31,代码来源:url2qr.ctrl.php


示例15: getVailableAccessToken

 public function getVailableAccessToken()
 {
     $accounts = pdo_fetchall("SELECT `key`, `secret`, `acid` FROM " . tablename('account_wechats') . " WHERE uniacid = :uniacid ORDER BY `level` DESC ", array(':uniacid' => $GLOBALS['_W']['uniacid']));
     if (empty($accounts)) {
         return error(-1, 'no permission');
     }
     foreach ($accounts as $account) {
         if (empty($account['key']) || empty($account['secret'])) {
             continue;
         }
         $acid = $account['acid'];
         break;
     }
     $account = WeAccount::create($acid);
     return $account->getAccessToken();
 }
开发者ID:noikiy,项目名称:mygit,代码行数:16,代码来源:weixin.account.class.php


示例16: mc_notice_init

function mc_notice_init()
{
    global $_W;
    if (empty($_W['account'])) {
        $_W['account'] = uni_fetch($_W['uniacid']);
    }
    if (empty($_W['account'])) {
        return error(-1, '创建公众号操作类失败');
    }
    if ($_W['account']['level'] < 3) {
        return error(-1, '公众号没有经过认证,不能使用模板消息和客服消息');
    }
    $acc = WeAccount::create();
    if (is_null($acc)) {
        return error(-1, '创建公众号操作对象失败');
    }
    $setting = uni_setting();
    $noticetpl = $setting['tplnotice'];
    $acc->noticetpl = $noticetpl;
    if (!is_array($acc->noticetpl)) {
        return error(-1, '微信通知参数错误');
    }
    return $acc;
}
开发者ID:wisemyth,项目名称:weizan,代码行数:24,代码来源:mc.mod.php


示例17: checkSubscribe

 public function checkSubscribe()
 {
     global $_W;
     session_start();
     if (empty($_W['openid']) || empty($_W['acid'])) {
         return false;
     }
     if (empty($_SESSION['__:subscribe'])) {
         $account = WeAccount::create($_W['acid']);
         if (!empty($account)) {
             $ainfo = $account->fetchAccountInfo();
             if (!empty($ainfo['secret']) && !empty($ainfo['key'])) {
                 $fans = $account->fansQueryInfo($_W['openid']);
                 if (!is_error($fans) && !empty($fans) && !empty($fans['subscribe'])) {
                     $_SESSION['__:subscribe'] = true;
                     return true;
                 }
             } else {
                 $_SESSION['__:subscribe'] = true;
                 return true;
             }
         }
     } else {
         return true;
     }
     return false;
 }
开发者ID:ChainBoy,项目名称:wxfx,代码行数:27,代码来源:site.php


示例18: array

    }
} else {
    if (isset($avatar) && isset($nickname) && isset($from_user)) {
        $shareuserdata = $_W['siteroot'] . 'app/' . $this->createMobileUrl('shareuserdata', array('rid' => $rid, 'fromuser' => $fromuser, 'duli' => $_GPC['duli'], 'tfrom_user' => $tfrom_user));
        header("location:{$shareuserdata}");
        exit;
    } else {
        $from_user = $_W['openid'];
        if ($from_user) {
            //取得openid后查询是否为高级号
            if ($serverapp == 4) {
                //认证服务号查询是否关注
                $profile = pdo_fetch("SELECT follow FROM " . tablename('mc_mapping_fans') . " WHERE uniacid = :uniacid and openid = :from_user", array(':uniacid' => $uniacid, ':from_user' => $from_user));
                if ($_W['fans']['follow'] || $profile['follow']) {
                    //已关注直接获取信息
                    $access_token = WeAccount::token();
                    $oauth2_url = "https://api.weixin.qq.com/cgi-bin/user/info?access_token=" . $access_token . "&openid=" . $from_user . "&lang=zh_CN";
                    $content = ihttp_get($oauth2_url);
                    $info = @json_decode($content['content'], true);
                    if (empty($info) || !is_array($info) || empty($info['openid']) || empty($info['nickname'])) {
                        echo '<h1>分享获取微信公众号授权失败[无法取得info], 请稍后重试! 公众平台返回原始数据为: <br />' . $content['meta'] . '<h1>';
                        exit;
                    } else {
                        $avatar = $info['headimgurl'];
                        $nickname = $info['nickname'];
                        $sex = $info['sex'];
                        //设置cookie信息
                        setcookie("user_oauth2_avatar", $avatar, time() + 3600 * 24 * 7);
                        setcookie("user_oauth2_nickname", $nickname, time() + 3600 * 24 * 7);
                        setcookie("user_oauth2_sex", $sex, time() + 3600 * 24 * 7);
                        setcookie("user_oauth2_openid", $from_user, time() + 3600 * 24 * 7);
开发者ID:keycoolkui,项目名称:weixinfenxiao,代码行数:31,代码来源:shareuserview.php


示例19: getQR

 public function getQR($poster, $member, $goodsid = 0)
 {
     global $_W, $_GPC;
     $acid = $_W['acid'];
     if ($poster['type'] == 1) {
         $qrimg = m('qrcode')->createShopQrcode($member['id'], $poster['id']);
         $qr = pdo_fetch('select * from ' . tablename('ewei_shop_poster_qr') . ' where openid=:openid and acid=:acid and type=:type limit 1', array(':openid' => $member['openid'], ':acid' => $_W['acid'], ':type' => 1));
         if (empty($qr)) {
             $qr = array('acid' => $acid, 'openid' => $member['openid'], 'type' => 1, 'qrimg' => $qrimg);
             pdo_insert('ewei_shop_poster_qr', $qr);
             $qr['id'] = pdo_insertid();
         }
         $qr['current_qrimg'] = $qrimg;
         return $qr;
     } else {
         if ($poster['type'] == 2) {
             $p = p('commission');
             if ($p) {
                 $qrimg = $p->createMyShopQrcode($member['id'], $poster['id']);
                 $qr = pdo_fetch('select * from ' . tablename('ewei_shop_poster_qr') . ' where openid=:openid and acid=:acid and type=:type limit 1', array(':openid' => $member['openid'], ':acid' => $_W['acid'], ':type' => 2));
                 if (empty($qr)) {
                     $qr = array('acid' => $acid, 'openid' => $member['openid'], 'type' => 2, 'qrimg' => $qrimg);
                     pdo_insert('ewei_shop_poster_qr', $qr);
                     $qr['id'] = pdo_insertid();
                 }
                 $qr['current_qrimg'] = $qrimg;
                 return $qr;
             }
         } else {
             if ($poster['type'] == 3) {
                 $qrimg = m('qrcode')->createGoodsQrcode($member['id'], $goodsid, $poster['id']);
                 $qr = pdo_fetch('select * from ' . tablename('ewei_shop_poster_qr') . ' where openid=:openid and acid=:acid and type=:type and goodsid=:goodsid limit 1', array(':openid' => $member['openid'], ':acid' => $_W['acid'], ':type' => 3, ':goodsid' => $goodsid));
                 if (empty($qr)) {
                     $qr = array('acid' => $acid, 'openid' => $member['openid'], 'type' => 3, 'goodsid' => $goodsid, 'qrimg' => $qrimg);
                     pdo_insert('ewei_shop_poster_qr', $qr);
                     $qr['id'] = pdo_insertid();
                 }
                 $qr['current_qrimg'] = $qrimg;
                 return $qr;
             } else {
                 if ($poster['type'] == 4) {
                     $uniacccount = WeAccount::create($acid);
                     $qr = pdo_fetch('select * from ' . tablename('ewei_shop_poster_qr') . ' where openid=:openid and acid=:acid and type=4 limit 1', array(':openid' => $member['openid'], ':acid' => $acid));
                     if (empty($qr)) {
                         $sceneid = pdo_fetchcolumn("SELECT qrcid FROM " . tablename('qrcode') . " WHERE acid = :acid and model=2 ORDER BY qrcid DESC LIMIT 1", array(':acid' => $acid));
                         $barcode['action_info']['scene']['scene_id'] = intval($sceneid) + 1;
                         if ($barcode['action_info']['scene']['scene_id'] > 100000) {
                             return error(-1, '抱歉,永久二维码已经生成最大数量,请先删除一些。');
                         }
                         $barcode['action_name'] = 'QR_LIMIT_SCENE';
                         $result = $uniacccount->barCodeCreateFixed($barcode);
                         if (is_error($result)) {
                             return error(-1, "公众平台返回接口错误. <br />错误代码为: {$result['errorcode']} <br />错误信息为: {$result['message']}");
                         }
                         $qrimg = "https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket=" . $result['ticket'];
                         $ims_qrcode = array('uniacid' => $_W['uniacid'], 'acid' => $_W['acid'], 'qrcid' => $barcode['action_info']['scene']['scene_id'], "model" => 2, "name" => "EWEI_SHOP_POSTER_QRCODE", "keyword" => 'EWEI_SHOP_POSTER', "expire" => 0, "createtime" => time(), "status" => 1, 'url' => $result['url'], "ticket" => $result['ticket']);
                         pdo_insert('qrcode', $ims_qrcode);
                         $qr = array('acid' => $acid, 'openid' => $member['openid'], 'type' => 4, 'sceneid' => $barcode['action_info']['scene']['scene_id'], 'ticket' => $result['ticket'], 'qrimg' => $qrimg, 'url' => $result['url']);
                         pdo_insert('ewei_shop_poster_qr', $qr);
                         $qr['id'] = pdo_insertid();
                         $qr['current_qrimg'] = $qrimg;
                     } else {
                         $qr['current_qrimg'] = "https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket=" . $qr['ticket'];
                     }
                     return $qr;
                 }
             }
         }
     }
 }
开发者ID:ChainBoy,项目名称:wxfx,代码行数:70,代码来源:model.php


示例20: payResult


//.........这里部分代码省略.........
         $smsSetting = pdo_fetch("SELECT * FROM " . tablename($this->table_sms_setting) . " WHERE weid=:weid AND storeid=:storeid LIMIT 1", array(':weid' => $weid, ':storeid' => $storeid));
         $sendInfo = array();
         if (!empty($smsSetting)) {
             if ($smsSetting['sms_enable'] == 1 && !empty($smsSetting['sms_mobile'])) {
                 //模板
                 if (empty($smsSetting['sms_business_tpl'])) {
                     $smsSetting['sms_business_tpl'] = '您有新的订单:[sn],收货人:[name],电话:[tel],请及时确认订单!';
                 }
                 //订单号
                 $smsSetting['sms_business_tpl'] = str_replace('[sn]', $order['ordersn'], $smsSetting['sms_business_tpl']);
                 //用户名
                 $smsSetting['sms_business_tpl'] = str_replace('[name]', $order['username'], $smsSetting['sms_business_tpl']);
                 //就餐时间
                 $smsSetting['sms_business_tpl'] = str_replace('[date]', $order['meal_time'], $smsSetting['sms_business_tpl']);
                 //电话
                 $smsSetting['sms_business_tpl'] = str_replace('[tel]', $order['tel'], $smsSetting['sms_business_tpl']);
                 $smsSetting['sms_business_tpl'] = str_replace('[totalnum]', $order['totalnum'], $smsSetting['sms_business_tpl']);
                 $smsSetting['sms_business_tpl'] = str_replace('[totalprice]', $order['totalprice'], $smsSetting['sms_business_tpl']);
                 $smsSetting['sms_business_tpl'] = str_replace('[address]', $order['address'], $smsSetting['sms_business_tpl']);
                 $smsSetting['sms_business_tpl'] = str_replace('[remark]', $order['remark'], $smsSetting['sms_business_tpl']);
                 $smsSetting['sms_business_tpl'] = str_replace('[goods]', $goods_str, $smsSetting['sms_business_tpl']);
                 $sendInfo['username'] = $smsSetting['sms_username'];
                 $sendInfo['pwd'] = $smsSetting['sms_pwd'];
                 $sendInfo['mobile'] = $smsSetting['sms_mobile'];
                 $sendInfo['content'] = $smsSetting['sms_business_tpl'];
                 //debug
                 if ($data['status'] == 1) {
                     if ($order['issms'] == 0) {
                         pdo_update($this->table_order, array('issms' => 1), array('id' => $orderid));
                         $return_result_code = $this->_sendSms($sendInfo);
                         $smsStatus = $this->sms_status[$return_result_code];
                     }
                 }
             }
         }
         $store = pdo_fetch("SELECT * FROM " . tablename($this->table_stores) . " WHERE weid=:weid AND id=:id LIMIT 1", array(':weid' => $weid, ':id' => $storeid));
         if (!empty($emailSetting) && !empty($emailSetting['email'])) {
             $email_tpl = str_replace('[store]', $store['title'], $email_tpl);
             $email_tpl = str_replace('[sn]', $order['ordersn'], $email_tpl);
             $email_tpl = str_replace('[name]', $order['username'], $email_tpl);
             //用户名
             $email_tpl = str_replace('[name]', $order['username'], $email_tpl);
             //就餐时间
             $email_tpl = str_replace('[mealtime]', $order['meal_time'], $email_tpl);
             //电话
             $email_tpl = str_replace('[tel]', $order['tel'], $email_tpl);
             $email_tpl = str_replace('[tables]', $order['tables'], $email_tpl);
             $email_tpl = str_replace('[goods]', $goods_str, $email_tpl);
             $email_tpl = str_replace('[totalnum]', $order['totalnum'], $email_tpl);
             $email_tpl = str_replace('[totalprice]', $order['totalprice'], $email_tpl);
             $email_tpl = str_replace('[address]', $order['address'], $email_tpl);
             $email_tpl = str_replace('[remark]', $order['remark'], $email_tpl);
             if ($emailSetting['email_host'] == 'smtp.qq.com' || $emailSetting['email_host'] == 'smtp.gmail.com') {
                 $secure = 'ssl';
                 $port = '465';
             } else {
                 $secure = 'tls';
                 $port = '25';
             }
             $mail_config = array();
             $mail_config['host'] = $emailSetting['email_host'];
             $mail_config['secure'] = $secure;
             $mail_config['port'] = $port;
             $mail_config['username'] = $emailSetting['email_user'];
             $mail_config['sendmail'] = $emailSetting['email_send'];
             $mail_config['password'] = $emailSetting['email_pwd'];
             $mail_config['mailaddress'] = $emailSetting['email'];
             $mail_config['subject'] = '订单提醒';
             $mail_config['body'] = $email_tpl;
             if ($data['status'] == 1) {
                 if ($order['isemail'] == 0) {
                     pdo_update($this->table_order, array('isemail' => 1), array('id' => $orderid));
                     $result = $this->sendmail($mail_c 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP WeUtility类代码示例发布时间:2022-05-23
下一篇:
PHP WatchedItem类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap