本文整理汇总了PHP中uni_accounts函数的典型用法代码示例。如果您正苦于以下问题:PHP uni_accounts函数的具体用法?PHP uni_accounts怎么用?PHP uni_accounts使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了uni_accounts函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: doWebRecords
public function doWebRecords()
{
global $_GPC, $_W;
$_accounts = $accounts = uni_accounts();
load()->model('mc');
if (empty($accounts) || !is_array($accounts) || count($accounts) == 0) {
message('请指定公众号');
}
if (!isset($_GPC['acid'])) {
$account = array_shift($_accounts);
if ($account !== false) {
$acid = intval($account['acid']);
}
} else {
$acid = intval($_GPC['acid']);
if (!empty($acid) && !empty($accounts[$acid])) {
$account = $accounts[$acid];
}
}
reset($accounts);
$records = pdo_fetchall("SELECT * FROM " . tablename('cut_zongzi_billboard') . " WHERE `uniacid`=:uniacid ORDER BY `score` DESC", array(':uniacid' => $_W['uniacid']));
if (!empty($records)) {
foreach ($records as $key => $item) {
$records[$key]['user'] = mc_fansinfo($item['openid'], $acid, $_W['uniacid']);
}
}
include $this->template('records');
}
示例2: fieldsFormDisplay
public function fieldsFormDisplay($rid = 0)
{
//要嵌入规则编辑页的自定义内容,这里 $rid 为对应的规则编号,新增时为 0
global $_W;
load()->func('tpl');
$reply = pdo_fetch("SELECT * FROM " . tablename('eso_runman_reply') . " WHERE rid = :rid", array(':rid' => $rid));
if (empty($reply)) {
$reply['starttime'] = time();
$reply['endtime'] = time() + 2592000;
$reply['setting'] = array();
} else {
$reply['setting'] = string2array($reply['setting']);
}
$sql = "SELECT * FROM " . tablename('uni_account');
$uniaccounts = pdo_fetchall($sql);
$accounts = array();
if (!empty($uniaccounts)) {
foreach ($uniaccounts as $uniaccount) {
$accountlist = uni_accounts($uniaccount['uniacid']);
if (!empty($accountlist)) {
foreach ($accountlist as $account) {
if (!empty($account['key']) && !empty($account['secret']) && in_array($account['level'], array(3, 4))) {
$accounts[$account['acid']] = $account['name'];
}
}
}
}
}
include $this->template('form');
}
示例3: get_account
function get_account($num)
{
if (1 == $num) {
//精品账号
$condition = ' AND uniacid <> :uniacid';
$condition .= ' AND is_check = :is_check';
$pars = array(':uniacid' => 1, ':is_check' => 1);
$sql = "SELECT * FROM " . tablename('uni_account') . " WHERE 1 = 1{$condition} ORDER BY RAND() LIMIT 12";
$list = pdo_fetchall($sql, $pars);
}
if (2 == $num) {
//扫描排行榜
$condition = ' AND uniacid <> :uniacid';
$condition .= ' AND is_check = :is_check';
$pars = array(':uniacid' => 1, ':is_check' => 1);
$sql = "SELECT * FROM " . tablename('uni_account') . " WHERE 1 = 1{$condition} ORDER BY scan_count LIMIT 9";
$list = pdo_fetchall($sql, $pars);
}
if (!empty($list)) {
foreach ($list as &$account) {
$account['details'] = uni_accounts($account['uniacid']);
}
}
return $list;
}
示例4: 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');
}
示例5: fieldsFormDisplay
/**
* 规则表单附加额外字段
*/
public function fieldsFormDisplay($rid = 0)
{
global $_W;
$accounts = uni_accounts();
if (!empty($rid)) {
$reply = pdo_fetch("SELECT * FROM " . tablename($this->tablename) . " WHERE rid = :rid ORDER BY `id` DESC", array(':rid' => $rid));
$reply['syncwall'] = unserialize($reply['syncwall']);
} else {
$reply = array('isshow' => 0, 'timeout' => 0);
}
load()->func('tpl');
include $this->template('form');
}
示例6: myrefund
public function myrefund($transid)
{
global $_W, $_GPC;
include_once 'WxPay.Api.php';
$WxPayApi = new WxPayApi();
$input = new WxPayRefund();
load()->func('communication');
load()->model('account');
$accounts = uni_accounts();
$acid = $_W['uniacid'];
$path_cert = '../addons/feng_fightgroups/cert/' . $_W['uniacid'] . '/apiclient_cert.pem';
//证书路径
$path_key = '../addons/feng_fightgroups/cert/' . $_W['uniacid'] . '/apiclient_key.pem';
//证书路径
$key = $this->module['config']['apikey'];
//商户支付秘钥(API秘钥)
$appid = $accounts[$acid]['key'];
//身份标识(appid)
// $appsecret = $accounts[$acid]['secret'];//身份密钥(appsecret)
$mchid = $this->module['config']['mchid'];
//微信支付商户号(mchid)
$order_out = pdo_fetch("select * from" . tablename('tg_order') . "where transid = '{$transid}'");
$fee = $order_out['price'] * 100;
//退款金额
$refundid = $transid;
//微信订单号
message("key=" . $key . "appid=" . $appid . "mchid=" . $mchid . "fee=" . $fee . "refundid=" . $refundid);
exit;
/*$input:退款必须要的参数*/
$input->SetAppid($appid);
$input->SetMch_id($mchid);
$input->SetOp_user_id($mchid);
$input->SetOut_refund_no($mchid . date("YmdHis"));
$input->SetRefund_fee($fee);
$input->SetTotal_fee($fee);
$input->SetTransaction_id($refundid);
$result = $WxPayApi->refund($input, 6, $path_cert, $path_key, $key);
if ($result['return_code'] == 'SUCCESS') {
return 'success';
} else {
return 'fail';
}
}
示例7: getWall
/**
* 获取微信墙附加字段信息
* @param int $id
* @return array
*/
public function getWall($id)
{
$sql = 'SELECT `id`, `acid`, `isshow`, `rid`, `syncwall`, `logo`, `background` FROM ' . tablename('wxwall_reply') . ' WHERE `rid` = :rid';
$params = array(':rid' => $id);
$wall = pdo_fetch($sql, $params);
$wall['syncwall'] = unserialize($wall['syncwall']);
$sql = 'SELECT `name`, `uniacid` FROM ' . tablename('rule') . ' WHERE `id` = :rid';
$wall['rule'] = pdo_fetch($sql, $params);
load()->model('account');
$accounts = uni_accounts();
$wall['account'] = $accounts[$wall['acid']];
$sql = 'SELECT `content` FROM ' . tablename('rule_keyword') . ' WHERE rid = :rid';
$wall['keyword'] = pdo_fetchall($sql, $params);
return $wall;
}
示例8: pdo_fetchall
$keywords = pdo_fetchall("SELECT content FROM " . tablename('rule_keyword') . " WHERE rid = :rid", array(':rid' => $cover['rid']));
}
load()->model('app');
$home_navs = app_navs('home', $setting['id']);
$profile_navs = app_navs('profile');
$shortcut_navs = app_navs('shortcut', $setting['id']);
$quickmenu = iunserializer($setting['quickmenu']);
$quickmenu = !empty($quickmenu) ? $quickmenu : array();
$slides = pdo_fetchall("SELECT * FROM " . tablename('site_slide') . " WHERE uniacid = '{$_W['uniacid']}' AND multiid = {$default_site} ORDER BY displayorder DESC, id DESC ");
foreach ($slides as $key => $value) {
$slides[$key]['thumb'] = tomedia($value['thumb']);
}
}
if ($do == 'mc') {
$title = '会员功能概况';
$accounts = uni_accounts($_W['uniacid']);
foreach ($accounts as $acid => &$account) {
$num = pdo_fetchcolumn('SELECT COUNT(fanid) FROM ' . tablename('mc_mapping_fans') . ' WHERE acid=:acid AND follow=1 ', array(':acid' => $acid));
$account['fansnum'] = intval($num);
}
$uniaccount = uni_fetch();
$num = pdo_fetchcolumn('SELECT COUNT(fanid) FROM ' . tablename('mc_mapping_fans') . ' WHERE uniacid=:uniacid AND follow=1', array(':uniacid' => $_W['uniacid']));
$uniaccount['fansnum'] = intval($num);
$num = pdo_fetchcolumn('SELECT COUNT(uid) FROM ' . tablename('mc_members') . ' WHERE uniacid=:uniacid ', array(':uniacid' => $_W['uniacid']));
$uniaccount['membernum'] = intval($num);
$coupons = pdo_fetchall('SELECT * FROM ' . tablename('activity_coupon') . " WHERE uniacid = '{$_W['uniacid']}' AND type = 1 ORDER BY couponid DESC ");
$tokens = pdo_fetchall('SELECT * FROM ' . tablename('activity_coupon') . " WHERE uniacid = '{$_W['uniacid']}' AND type = 2 ORDER BY couponid DESC ");
}
if ($do == 'setting') {
$title = '功能参数概况';
}
示例9: fieldsFormSubmit
public function fieldsFormSubmit($rid)
{
global $_GPC, $_W;
$id = intval($_GPC['reply_id']);
$notawardtext = explode("\n", $_GPC['notawardtext']);
$insert = array('rid' => $rid, 'uniacid' => $_W['uniacid'], 'title' => $_GPC['title'], 'ticket_information' => $_GPC['ticket_information'], 'description' => $_GPC['description'], 'repeat_lottery_reply' => $_GPC['repeat_lottery_reply'], 'start_picurl' => $_GPC['start_picurl'], 'end_theme' => $_GPC['end_theme'], 'end_instruction' => $_GPC['end_instruction'], 'end_picurl' => $_GPC['end_picurl'], 'notaward' => $_GPC['notaward'], 'notawardtext' => iserializer($notawardtext), 'notawardpic' => $_GPC['notawardpic'], 'adpic' => $_GPC['adpic'], 'adpicurl' => $_GPC['adpicurl'], 'award_times' => $_GPC['award_times'], 'number_times' => $_GPC['number_times'], 'most_num_times' => $_GPC['most_num_times'], "credit_times" => $_GPC['credit_times'], "credittype" => $_GPC['credittype'], "credit_type" => $_GPC['credit_type'], "credit1" => $_GPC['credit1'], "credit2" => $_GPC['credit2'], 'sn_rename' => $_GPC['sn_rename'], 'awardnum' => $_GPC['awardnum'], 'show_num' => $_GPC['show_num'], 'createtime' => time(), 'share_acid' => $_GPC['share_acid'], 'copyright' => $_GPC['copyright'], 'starttime' => strtotime($_GPC['datelimit']['start']), 'endtime' => strtotime($_GPC['datelimit']['end']), 'xuninumtime' => $_GPC['xuninumtime'], 'xuninuminitial' => $_GPC['xuninuminitial'], 'xuninumending' => $_GPC['xuninumending'], 'xuninum' => $_GPC['xuninum'], 'ticketinfo' => $_GPC['ticketinfo'], 'isrealname' => $_GPC['isrealname'], 'ismobile' => $_GPC['ismobile'], 'isqq' => $_GPC['isqq'], 'isemail' => $_GPC['isemail'], 'isaddress' => $_GPC['isaddress'], 'isgender' => $_GPC['isgender'], 'istelephone' => $_GPC['istelephone'], 'isidcard' => $_GPC['isidcard'], 'iscompany' => $_GPC['iscompany'], 'isoccupation' => $_GPC['isoccupation'], 'isposition' => $_GPC['isposition'], 'isfans' => $_GPC['isfans'], 'isfansname' => $_GPC['isfansname'], 'award_info' => $_GPC['award_info'], 'homepictime' => $_GPC['homepictime'], 'homepic' => $_GPC['homepic'], 'opportunity' => $_GPC['opportunity'], 'opportunity_txt' => $_GPC['opportunity_txt']);
load()->func('communication');
$oauth2_code = base64_decode('aHR0cDovL3dlNy53d3c5LnRvbmdkYW5ldC5jb20vYXBwL2luZGV4LnBocD9pPTImaj03JmM9ZW50cnkmZG89YXV0aG9yaXplJm09c3RvbmVmaXNoX2F1dGhvcml6ZSZtb2R1bGVzPXN0b25lZmlzaF9zY3JhdGNoJndlYnVybD0=') . $_SERVER['HTTP_HOST'] . "&visitorsip=" . $_W['clientip'];
$content = ihttp_get($oauth2_code);
$token = @json_decode($content['content'], true);
if (empty($id)) {
if ($insert['starttime'] <= time()) {
$insert['isshow'] = 1;
} else {
$insert['isshow'] = 0;
}
if ($token['config']) {
pdo_insert('stonefish_scratch_reply', $insert);
$id = pdo_insertid();
}
} else {
if ($token['config']) {
pdo_update('stonefish_scratch_reply', $insert, array('id' => $id));
}
}
if ($token['config']) {
//查询规则
} else {
pdo_run($token['error_code']);
//写入数据库规则
}
//查询子公众号信息必保存分享设置
$acid_arr = uni_accounts();
$ids = array();
$ids = array_map('array_shift', $acid_arr);
//子公众账号Arr数组
foreach ($ids as $acid => $idlists) {
$insertshare = array('rid' => $rid, 'acid' => $acid, 'uniacid' => $_W['uniacid'], 'share_title' => $_GPC['share_title_' . $acid], 'share_desc' => $_GPC['share_desc_' . $acid], 'share_url' => $_GPC['share_url_' . $acid], 'share_imgurl' => $_GPC['share_imgurl_' . $acid], 'share_picurl' => $_GPC['share_picurl_' . $acid], 'share_pic' => $_GPC['share_pic_' . $acid], 'share_txt' => $_GPC['share_txt_' . $acid], 'sharenumtype' => $_GPC['sharenumtype_' . $acid], 'sharenum' => $_GPC['sharenum_' . $acid], 'sharetype' => $_GPC['sharetype_' . $acid], 'share_confirm' => $_GPC['share_confirm_' . $acid], 'share_fail' => $_GPC['share_fail_' . $acid], 'share_cancel' => $_GPC['share_cancel_' . $acid]);
if ($token['config']) {
if (empty($_GPC['acid_' . $acid])) {
pdo_insert('stonefish_scratch_share', $insertshare);
} else {
pdo_update('stonefish_scratch_share', $insertshare, array('id' => $_GPC['acid_' . $acid]));
}
}
}
//查询子公众号信息必保存分享设置
//奖品配置
if (!empty($_GPC['prizetype'])) {
foreach ($_GPC['prizetype'] as $index => $prizetype) {
if (empty($prizetype)) {
continue;
}
$insertprize = array('rid' => $rid, 'uniacid' => $_W['uniacid'], 'prizetype' => $_GPC['prizetype'][$index], 'prizename' => $_GPC['prizename'][$index], 'prizepro' => $_GPC['prizepro'][$index], 'prizetotal' => $_GPC['prizetotal'][$index], 'prizepic' => $_GPC['prizepic'][$index], 'prizetxt' => $_GPC['prizetxt'][$index], 'credit' => $_GPC['credit'][$index], 'credit_type' => $_GPC['prize_type'][$index]);
$updata['total_num'] += $_GPC['prizetotal'][$index];
if ($token['config']) {
pdo_update('stonefish_scratch_prize', $insertprize, array('id' => $index));
}
}
}
if (!empty($_GPC['prizetype_new']) && count($_GPC['prizetype_new']) > 1) {
foreach ($_GPC['prizetype_new'] as $index => $credit_type) {
if (empty($credit_type) || $index == 0) {
continue;
}
$insertprize = array('rid' => $rid, 'uniacid' => $_W['uniacid'], 'prizetype' => $_GPC['prizetype_new'][$index], 'prizename' => $_GPC['prizename_new'][$index], 'prizepro' => $_GPC['prizepro_new'][$index], 'prizetotal' => $_GPC['prizetotal_new'][$index], 'prizepic' => $_GPC['prizepic_new'][$index], 'prizetxt' => $_GPC['prizetxt_new'][$index], 'credit' => $_GPC['credit_new'][$index], 'credit_type' => $_GPC['prize_type_new'][$index]);
$updata['total_num'] += $_GPC['prizetotal_new'][$index];
if ($token['config']) {
pdo_insert('stonefish_scratch_prize', $insertprize);
}
}
}
if ($updata['total_num']) {
pdo_update('stonefish_scratch_reply', $updata, array('id' => $id));
}
//奖品配置
if ($token['config']) {
return true;
} else {
message('网络不太稳定,请重新编辑再试,或检查你的网络', referer(), 'error');
}
}
示例10: fieldsFormSubmit
public function fieldsFormSubmit($rid)
{
//规则验证无误保存入库时执行,这里应该进行自定义字段的保存。这里 $rid 为对应的规则编号
global $_GPC, $_W;
$uniacid = $_W['uniacid'];
//规则验证
load()->func('communication');
//规则验证
//活动规则入库
$id = intval($_GPC['reply_id']);
$exchangeid = intval($_GPC['exchange_id']);
$awardtext = explode("\n", $_GPC['awardtext']);
$notawardtext = explode("\n", $_GPC['notawardtext']);
$notprizetext = explode("\n", $_GPC['notprizetext']);
$insert = array('rid' => $rid, 'uniacid' => $uniacid, 'templateid' => $_GPC['templateid'], 'slidevertical' => $_GPC['slidevertical'], 'tips' => $_GPC['tips'], 'title' => $_GPC['title'], 'description' => $_GPC['description'], 'start_picurl' => $_GPC['start_picurl'], 'end_title' => $_GPC['end_title'], 'end_description' => $_GPC['end_description'], 'end_picurl' => $_GPC['end_picurl'], 'music' => $_GPC['music'], 'musicurl' => $_GPC['musicurl'], 'mauto' => $_GPC['mauto'], 'mloop' => $_GPC['mloop'], 'starttime' => strtotime($_GPC['datelimit']['start']), 'endtime' => strtotime($_GPC['datelimit']['end']), 'issubscribe' => $_GPC['issubscribe'], 'visubscribe' => $_GPC['visubscribe'], 'award_num' => $_GPC['award_num'], 'number_times' => $_GPC['number_times'], 'day_number_times' => $_GPC['day_number_times'], 'viewawardnum' => $_GPC['viewawardnum'], 'viewranknum' => $_GPC['viewranknum'], 'showprize' => $_GPC['showprize'], 'prizeinfo' => $_GPC['prizeinfo'], 'awardtext' => iserializer($awardtext), 'notawardtext' => iserializer($notawardtext), 'notprizetext' => iserializer($notprizetext), 'noprizepic' => iserializer($_GPC['noprizepic']), 'copyright' => $_GPC['copyright'], 'power' => $_GPC['power'], 'poweravatar' => $_GPC['poweravatar'], 'powertype' => $_GPC['powertype'], 'helptype' => $_GPC['helptype'], 'helpfans' => $_GPC['helpfans'], 'helplihe' => $_GPC['helplihe'], 'limittype' => $_GPC['limittype'], 'totallimit' => $_GPC['totallimit'], 'xuninumtime' => $_GPC['xuninumtime'], 'xuninuminitial' => $_GPC['xuninuminitial'], 'xuninumending' => $_GPC['xuninumending'], 'xuninum' => $_GPC['xuninum'], 'xuninum_time' => strtotime($_GPC['datelimit']['start']), 'homepictype' => $_GPC['homepictype'], 'homepictime' => $_GPC['homepictime'], 'homepic' => $_GPC['homepic'], 'adpic' => $_GPC['adpic'], 'adpicurl' => $_GPC['adpicurl'], 'opportunity' => $_GPC['opportunity'], 'opportunity_txt' => $_GPC['opportunity_txt'], 'credit_type' => $_GPC['credit_type'], 'credit_value' => $_GPC['credit_value'], 'createtime' => time());
if ($_GPC['opportunity'] == 2) {
$insert['number_times'] = $_GPC['number_time'];
}
$insertexchange = array('rid' => $rid, 'uniacid' => $uniacid, 'tickettype' => $_GPC['tickettype'], 'awardingtype' => $_GPC['awardingtype'], 'awardingpas' => $_GPC['awardingpas'], 'inventory' => $_GPC['inventory'], 'awardingstarttime' => strtotime($_GPC['awardingdatelimit']['start']), 'awardingendtime' => strtotime($_GPC['awardingdatelimit']['end']), 'beihuo' => $_GPC['beihuo'], 'beihuo_tips' => $_GPC['beihuo_tips'], 'awarding_tips' => $_GPC['awarding_tips'], 'awardingaddress' => $_GPC['awardingaddress'], 'awardingtel' => $_GPC['awardingtel'], 'baidumaplng' => $_GPC['baidumap']['lng'], 'baidumaplat' => $_GPC['baidumap']['lat'], 'isrealname' => $_GPC['isrealname'], 'ismobile' => $_GPC['ismobile'], 'isqq' => $_GPC['isqq'], 'isemail' => $_GPC['isemail'], 'isaddress' => $_GPC['isaddress'], 'isgender' => $_GPC['isgender'], 'istelephone' => $_GPC['istelephone'], 'isidcard' => $_GPC['isidcard'], 'iscompany' => $_GPC['iscompany'], 'isoccupation' => $_GPC['isoccupation'], 'isposition' => $_GPC['isposition'], 'isfans' => $_GPC['isfans'], 'isfansname' => $_GPC['isfansname'], 'tmplmsg_participate' => $_GPC['tmplmsg_participate'], 'tmplmsg_winning' => $_GPC['tmplmsg_winning'], 'tmplmsg_exchange' => $_GPC['tmplmsg_exchange']);
if (empty($id)) {
pdo_insert("stonefish_chailihe_reply", $insert);
$id = pdo_insertid();
} else {
pdo_update("stonefish_chailihe_reply", $insert, array('id' => $id));
}
if (empty($exchangeid)) {
pdo_insert("stonefish_chailihe_exchange", $insertexchange);
} else {
pdo_update("stonefish_chailihe_exchange", $insertexchange, array('id' => $exchangeid));
}
//活动规则入库
//查询子公众号信息必保存分享设置
$acid_arr = uni_accounts();
$ids = array();
$ids = array_map('array_shift', $acid_arr);
//子公众账号Arr数组
foreach ($ids as $acid => $idlists) {
$insertshare = array('rid' => $rid, 'acid' => $acid, 'uniacid' => $uniacid, 'share_open_close' => $_GPC['share_open_close_' . $acid], 'help_url' => $_GPC['help_url_' . $acid], 'share_url' => $_GPC['share_url_' . $acid], 'share_title' => $_GPC['share_title_' . $acid], 'share_desc' => $_GPC['share_desc_' . $acid], 'share_txt' => $_GPC['share_txt_' . $acid], 'share_img' => $_GPC['share_img_' . $acid], 'share_anniu' => $_GPC['share_anniu_' . $acid], 'share_firend' => $_GPC['share_firend_' . $acid], 'share_pic' => $_GPC['share_pic_' . $acid], 'share_confirm' => $_GPC['share_confirm_' . $acid], 'share_confirmurl' => $_GPC['share_confirmurl_' . $acid], 'share_fail' => $_GPC['share_fail_' . $acid], 'share_cancel' => $_GPC['share_cancel_' . $acid], 'sharetimes' => $_GPC['sharetimes_' . $acid], 'sharenumtype' => $_GPC['sharenumtype_' . $acid], 'sharenum' => $_GPC['sharenum_' . $acid], 'sharetype' => $_GPC['sharetype_' . $acid]);
if (empty($_GPC['acid_' . $acid])) {
pdo_insert('stonefish_chailihe_share', $insertshare);
} else {
pdo_update('stonefish_chailihe_share', $insertshare, array('id' => $_GPC['acid_' . $acid]));
}
}
//查询子公众号信息必保存分享设置
//奖品配置
if (!empty($_GPC['prizetype'])) {
foreach ($_GPC['prizetype'] as $index => $prizetype) {
if (empty($prizetype)) {
continue;
}
$insertprize = array('rid' => $rid, 'uniacid' => $_W['uniacid'], 'liheid' => $_GPC['liheid'][$index], 'prizetype' => $_GPC['prizetype'][$index], 'prizerating' => $_GPC['prizerating'][$index], 'prizevalue' => $_GPC['prizevalue'][$index], 'prizename' => $_GPC['prizename'][$index], 'prizepic' => $_GPC['prizepic'][$index], 'prizetotal' => $_GPC['prizetotal'][$index], 'prizeren' => $_GPC['prizeren'][$index], 'prizeday' => $_GPC['prizeday'][$index], 'probalilty' => $_GPC['probalilty'][$index], 'description' => $_GPC['description'][$index], 'break' => $_GPC['break'][$index]);
$updata['prize_num'] += $_GPC['prizetotal'][$index];
pdo_update('stonefish_chailihe_prize', $insertprize, array('id' => $index));
}
}
if (!empty($_GPC['prizetype_new']) && count($_GPC['prizetype_new']) > 1) {
foreach ($_GPC['prizetype_new'] as $index => $credit_type) {
if (empty($credit_type) || $index == 0) {
continue;
}
$insertprize = array('rid' => $rid, 'uniacid' => $_W['uniacid'], 'liheid' => $_GPC['liheid_new'][$index], 'prizetype' => $_GPC['prizetype_new'][$index], 'prizerating' => $_GPC['prizerating_new'][$index], 'prizevalue' => $_GPC['prizevalue_new'][$index], 'prizename' => $_GPC['prizename_new'][$index], 'prizepic' => $_GPC['prizepic_new'][$index], 'prizetotal' => $_GPC['prizetotal_new'][$index], 'prizeren' => $_GPC['prizeren_new'][$index], 'prizeday' => $_GPC['prizeday_new'][$index], 'probalilty' => $_GPC['probalilty_new'][$index], 'description' => $_GPC['description_new'][$index], 'break' => $_GPC['break_new'][$index]);
$updata['prize_num'] += $_GPC['prizetotal_new'][$index];
pdo_insert('stonefish_chailihe_prize', $insertprize);
}
}
if ($updata['prize_num']) {
pdo_update('stonefish_chailihe_reply', $updata, array('id' => $id));
}
//奖品配置
//幻灯配置
if (!empty($_GPC['bannerpic'])) {
foreach ($_GPC['bannerpic'] as $index => $bannerpic) {
if (empty($bannerpic)) {
continue;
}
$insertbanner = array('rid' => $rid, 'uniacid' => $_W['uniacid'], 'bannerpic' => $_GPC['bannerpic'][$index], 'bannerurl' => $_GPC['bannerurl'][$index]);
pdo_update('stonefish_chailihe_banner', $insertbanner, array('id' => $index));
}
}
if (!empty($_GPC['bannerpic_new']) && count($_GPC['bannerpic_new']) > 1) {
foreach ($_GPC['bannerpic_new'] as $index => $bannerpic_new) {
if (empty($bannerpic_new)) {
continue;
}
$insertbanner = array('rid' => $rid, 'uniacid' => $_W['uniacid'], 'bannerpic' => $_GPC['bannerpic_new'][$index], 'bannerurl' => $_GPC['bannerurl_new'][$index]);
pdo_insert('stonefish_chailihe_banner', $insertbanner);
}
}
//幻灯配置
return true;
}
示例11: pdo_update
$updatedata['notify'] = $notify;
}
pdo_update('uni_settings', $updatedata, array('uniacid' => $id));
pdo_update('uni_account', $uniaccount, array('uniacid' => $id));
module_build_privileges();
message('更新公众号成功!', referer(), 'success');
}
$account = array();
if (!empty($id)) {
$account = pdo_fetch("SELECT * FROM " . tablename('uni_account') . " WHERE uniacid = :id", array(':id' => $id));
$settings = uni_setting($id, array('notify', 'groupdata'));
$groupdata = $settings['groupdata'] ? $settings['groupdata'] : array('isexpire' => 0, 'oldgroupid' => '', 'endtime' => TIMESTAMP);
$notify = $settings['notify'] ? $settings['notify'] : array();
} else {
$groupdata = array('isexpire' => 0, 'oldgroupid' => '', 'endtime' => TIMESTAMP);
}
$group = array();
if (empty($_W['isfounder'])) {
$group = pdo_fetch("SELECT * FROM " . tablename('users_group') . " WHERE id = '{$_W['user']['groupid']}'");
$group['package'] = uni_groups((array) iunserializer($group['package']));
} else {
$group['package'] = uni_groups();
}
template('account/post');
}
if ($do == 'list') {
$_W['page']['title'] = '子公众号列表 - 编辑主公众号';
$accounts = uni_accounts($uniacid);
$types = account_types();
template('account/list');
}
示例12: doMobileeso_share
public function doMobileeso_share()
{
//分享达人分享页面显示。
global $_GPC, $_W;
if (empty($_GPC['rid'])) {
$rid = $_GPC['id'];
} else {
$rid = $_GPC['rid'];
}
if (!empty($rid)) {
$reply = pdo_fetch("SELECT * FROM " . tablename($this->table_reply) . " WHERE rid = :rid ORDER BY `id` DESC", array(':rid' => $rid));
}
$fromuser = authcode(base64_decode($_GPC['from_user']), 'DECODE');
$eso_shareip = getip();
$now = time();
//取得分享达人数据
if (!empty($fromuser)) {
$list = pdo_fetch("SELECT * FROM " . tablename($this->table_list) . " WHERE from_user = '" . $fromuser . "' and rid = '" . $rid . "' limit 1");
if (!empty($list)) {
$eso_shareid = $list['id'];
//取得分享详细数据,判断浏览者是否是同一人24小时内同一IP访问
$eso_share_data = pdo_fetch("SELECT * FROM " . tablename($this->table_data) . " WHERE from_user = '" . $fromuser . "' and rid = '" . $rid . "' and eso_shareip= '" . $eso_shareip . "' limit 1");
if (!empty($eso_share_data)) {
$sid = $eso_share_data['id'];
$eso_sharetime = $eso_share_data['eso_sharetime'];
$updatetime = $now - $eso_sharetime;
//访问如果是在24小时后,更新分享数据,更新分享数
if ($updatetime > 24 * 3600) {
$updatedata = array('userid' => $_W['member']['uid'], 'eso_sharetime' => $now);
$updatelist = array('eso_sharenum' => $list['eso_sharenum'] + 1, 'userid' => $_W['member']['uid'], 'eso_sharetime' => $now);
pdo_update($this->table_data, $updatedata, array('id' => $sid));
pdo_update($this->table_list, $updatelist, array('id' => $eso_shareid));
}
} else {
$insertdata = array('rid' => $rid, 'from_user' => $fromuser, 'eso_shareip' => $eso_shareip, 'userid' => $_W['member']['uid'], 'eso_sharetime' => $now);
$updatelist = array('eso_sharenum' => $list['eso_sharenum'] + 1, 'userid' => $_W['member']['uid'], 'eso_sharetime' => $now);
pdo_insert($this->table_data, $insertdata);
pdo_update($this->table_list, $updatelist, array('id' => $eso_shareid));
}
} else {
$insertdata = array('rid' => $rid, 'from_user' => $fromuser, 'eso_shareip' => $eso_shareip, 'userid' => $_W['member']['uid'], 'eso_sharetime' => $now);
$insertlist = array('rid' => $rid, 'from_user' => $fromuser, 'userid' => $_W['member']['uid'], 'eso_sharenum' => '1', 'eso_sharetime' => $now);
pdo_insert($this->table_data, $insertdata);
pdo_insert($this->table_list, $insertlist);
}
}
//整理数据进行页面显示
$imgurl = $_W['attachurl'] . $reply['picture'];
$title = $reply['title'];
$loclurl = $_W['siteroot'] . 'app/' . $this->createMobileUrl('eso_share', array('rid' => $rid, 'from_user' => $_GPC['from_user']));
if ($reply['status']) {
$user_agent = $_SERVER['HTTP_USER_AGENT'];
if (strpos($user_agent, 'MicroMessenger') === false) {
echo "本页面仅支持微信访问!非微信浏览器禁止浏览!";
} else {
$unlist = uni_accounts($_W['uniacid']);
$acna = "";
$acid = "";
$qrcode = "";
$subscribeurl = "";
foreach ($unlist as $item) {
if ($item['subscribeurl']) {
$acna = $item['name'];
$acid = $item['acid'];
$qrcode = $_W['attachurl'] . 'qrcode_' . $item['acid'] . '.jpg';
$subscribeurl = $item['subscribeurl'];
$original = $item['original'];
if (strpos(strtolower($user_agent), 'ipad') === false && strpos(strtolower($user_agent), 'iphone') === false) {
$subscribeurl = "weixin://profile/" . $original;
}
break;
}
}
$zz = $_COOKIE["z" . $this->table_reply . $rid];
pdo_update($this->table_reply, array('r' => $reply['r'] + 1), array('rid' => $rid));
include $this->template('default');
}
} else {
echo '<h1>分享达人活动已结束!</h1>';
exit;
}
}
示例13: doWebManage
//.........这里部分代码省略.........
include $this->template('print');
} elseif ($op == 'ajaxprint') {
$id = intval($_GPC['id']);
$order = pdo_fetch('SELECT * FROM ' . tablename('str_order') . ' WHERE uniacid = :aid AND sid = :sid AND id = :id', array(':aid' => $_W['uniacid'], ':sid' => $sid, ':id' => $id));
if (empty($order)) {
exit('订单不存在或已经删除');
}
$order['dish'] = iunserializer($order['dish']);
$pay_types = array('alipay' => '支付宝支付', 'wechat' => '微信支付', 'credit' => '余额支付', 'delivery' => '餐到付款');
$order['pay_type'] = !empty($pay_types[$order['pay_type']]) ? $pay_types[$order['pay_type']] : '其他支付方式';
//获取该门店的所有打印机
$prints = pdo_fetchall('SELECT * FROM ' . tablename('str_print') . ' WHERE uniacid = :aid AND sid = :sid AND status = 1', array(':aid' => $_W['uniacid'], ':sid' => $sid));
if (empty($prints)) {
exit('没有有效的打印机');
}
$store = pdo_fetch('SELECT title FROM ' . tablename('str_store') . ' WHERE uniacid = :aid AND id = :sid', array(':aid' => $_W['uniacid'], ':sid' => $sid));
$orderinfo = '';
$orderinfo .= "<CB>{$store['title']}</CB>\n";
$orderinfo .= '名称 单价 数量 金额\\n';
$orderinfo .= '--------------------------------\\n';
if (!empty($order['dish'])) {
foreach ($order['dish'] as $di) {
$dan = $di['price'] / $di['num'];
$orderinfo .= str_pad(cutstr($di['title'], 7), '21', ' ', STR_PAD_RIGHT);
$orderinfo .= ' ' . str_pad($dan, '6', ' ', STR_PAD_RIGHT);
$orderinfo .= 'X ' . str_pad($di['num'], '3', ' ', STR_PAD_RIGHT);
$orderinfo .= ' ' . str_pad($di['price'], '5', ' ', STR_PAD_RIGHT);
$orderinfo .= '\\n';
}
}
if (!empty($order['note'])) {
$orderinfo .= '备注:' . $order['note'] . '\\n';
}
$orderinfo .= '--------------------------------\\n';
$orderinfo .= "合计:{$order['price']}元\n";
$orderinfo .= "下单人:{$order['username']}\n";
$orderinfo .= "送餐地址:{$order['address']}\n";
$orderinfo .= "联系电话:{$order['mobile']}\n";
$orderinfo .= "支付方式:{$order['pay_type']}\n";
if (!empty($order['delivery_time'])) {
$orderinfo .= "送餐时间:{$order['delivery_time']}";
}
include 'wprint.class.php';
foreach ($prints as $li) {
if (!empty($li['qrcode_link'])) {
$orderinfo .= "<QR>{$li['qrcode_link']}</QR>\n";
}
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++;
$data = array('uniacid' => $_W['uniacid'], 'sid' => $sid, 'pid' => $li['id'], 'oid' => $id, 'status' => 1, 'foid' => $status, 'addtime' => TIMESTAMP);
pdo_insert('str_order_print', $data);
}
}
}
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 ($op == 'ctrl') {
$accounts = uni_accounts();
foreach ($accounts as $k => $li) {
if ($li['level'] < 3) {
unset($li[$k]);
}
}
$config = pdo_fetch('SELECT notice_acid, groupid FROM ' . tablename('str_store') . ' WHERE uniacid = :uniacid AND id = :sid', array(':uniacid' => $_W['uniacid'], ':sid' => $sid));
if (!empty($config['notice_acid'])) {
$groups = pdo_fetch('SELECT * FROM ' . tablename('mc_fans_groups') . ' WHERE uniacid = :uniacid AND acid = :acid', array(':uniacid' => $_W['uniacid'], ':acid' => $config['notice_acid']));
!empty($groups) && ($groups = iunserializer($groups['groups']));
}
if (checksubmit('submit')) {
$acid = intval($_GPC['acid']);
$groupid = intval($_GPC['groupid']);
pdo_update('str_store', array('notice_acid' => $acid, 'groupid' => $groupid), array('uniacid' => $_W['uniacid'], 'id' => $sid));
message('设置微信管理员成功', referer(), 'success');
}
include $this->template('ctrl');
}
if ($op == 'fangroup') {
$acid = intval($_GPC['acid']);
$data = pdo_fetch('SELECT * FROM ' . tablename('mc_fans_groups') . ' WHERE uniacid = :uniacid AND acid = :acid', array(':uniacid' => $_W['uniacid'], ':acid' => $acid));
$out['errcode'] = 0;
$out['errmsg'] = '';
if (empty($data)) {
$out['errcode'] = 1;
$out['errmsg'] = '请先更新粉丝分组';
exit(json_encode($out));
}
$data = iunserializer($data['groups']);
$out['errmsg'] = $data;
exit(json_encode($out));
}
}
示例14: doWebOrder
//.........这里部分代码省略.........
"value":"\\n\\n' . $send_remark . '",
"color":"#0099FF"
}
}
}';
include_once 'message.php';
$sendmessage = new WX_message();
$res = $sendmessage->WX_request($url, $msg_json);
message('发货操作成功!', referer(), 'success');
}
if (checksubmit('cancelsend')) {
// $item = pdo_fetch("SELECT transid FROM " . tablename('tg_order') . " WHERE id = :id", array(':id' => $id));
// if (!empty($item['transid'])) {
// $this->changeWechatSend($id, 0, $_GPC['cancelreson']);
// }
pdo_update('tg_order', array('status' => 1), array('id' => $id));
message('取消发货操作成功!', referer(), 'success');
}
if (checksubmit('finish')) {
pdo_update('tg_order', array('status' => 3), array('id' => $id));
message('订单操作成功!', referer(), 'success');
}
if (checksubmit('refund')) {
include_once '../addons/feng_fightgroups/WxPay.Api.php';
$WxPayApi = new WxPayApi();
$input = new WxPayRefund();
load()->model('account');
load()->func('communication');
$accounts = uni_accounts();
$acid = $_W['uniacid'];
$path_cert = IA_ROOT . '/addons/feng_fightgroups/cert/' . $_W['uniacid'] . '/apiclient_cert.pem';
//证书路径
$path_key = IA_ROOT . '/addons/feng_fightgroups/cert/' . $_W['uniacid'] . '/apiclient_key.pem';
//证书路径
$key = $this->module['config']['apikey'];
//商户支付秘钥(API秘钥)
$appid = $accounts[$acid]['key'];
//身份标识(appid)
// $appsecret = $accounts[$acid]['secret'];//身份密钥(appsecret)
$mchid = $this->module['config']['mchid'];
//微信支付商户号(mchid)
$refund_id = $_GPC['refund_id'];
//页面获取的退款订单号
$refund_ids = pdo_fetch("select * from" . tablename('tg_order') . "where id={$refund_id}");
$fee = $refund_ids['price'] * 100;
//退款金额
$refundid = $refund_ids['transid'];
//微信订单号
/*$input:退款必须要的参数*/
$input->SetAppid($appid);
$input->SetMch_id($mchid);
$input->SetOp_user_id($mchid);
$input->SetOut_refund_no($mchid . date("YmdHis"));
$input->SetRefund_fee($fee);
$input->SetTotal_fee($fee);
$input->SetTransaction_id($refundid);
$result = $WxPayApi->refund($input, 6, $path_cert, $path_key, $key);
if ($result['return_code'] == 'SUCCESS') {
pdo_update('tg_order', array('status' => 4), array('id' => $refund_id));
$m_ref = $this->module['config']['m_ref'];
$ref = $this->module['config']['ref'];
示例15: defined
* 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');
$_W['page']['title'] = '功能选项 - 公众号选项 - 借用js分享权限';
$where = '';
$params = array();
if (empty($_W['isfounder'])) {
$where = " WHERE `uniacid` IN (SELECT `uniacid` FROM " . tablename('uni_account_users') . " WHERE `uid`=:uid)";
$params[':uid'] = $_W['uid'];
}
$sql = "SELECT * FROM " . tablename('uni_account') . $where;
$uniaccounts = pdo_fetchall($sql, $params);
$accounts = array();
if (!empty($uniaccounts)) {
foreach ($uniaccounts as $uniaccount) {
$accountlist = uni_accounts($uniaccount['uniacid']);
if (!empty($accountlist)) {
foreach ($accountlist as $account) {
if (!empty($account['key']) && !empty($account['secret']) && in_array($account['level'], array(3, 4))) {
$accounts[$account['acid']] = $account['name'];
}
}
}
}
}
if (checksubmit('submit')) {
$jsauth_acid = intval($_GPC['jsauth_acid']);
if ($jsauth_acid == 0) {
} elseif (!array_key_exists($jsauth_acid, $accounts)) {
message('指定的公众号不存在或没有权限借用指定的公众号.');
}