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

PHP pdo_get函数代码示例

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

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



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

示例1: cron_run

function cron_run($id)
{
    global $_W;
    $cron = pdo_get('core_cron', array('uniacid' => $_W['uniacid'], 'id' => $id));
    if (empty($cron)) {
        return false;
    }
    $extra = array();
    $extra['Host'] = $_SERVER['HTTP_HOST'];
    load()->func('communication');
    $urlset = parse_url($_W['siteurl']);
    $urlset = pathinfo($urlset['path']);
    $response = ihttp_request('http://127.0.0.1/' . $urlset['dirname'] . '/' . url('cron/entry', array('id' => $cron['cloudid'])), array(), $extra);
    $response = json_decode($response['content'], true);
    if (is_error($response['message'])) {
        return $response['message'];
    } else {
        cron_setnexttime($cron);
        $cron_new = pdo_get('core_cron', array('uniacid' => $_W['uniacid'], 'id' => $id));
        if (empty($cron_new)) {
            return true;
        }
        if ($cron_new['status'] != $cron['status'] || $cron_new['lastruntime'] != $cron['lastruntime'] || $cron_new['nextruntime'] != $cron['nextruntime']) {
            load()->model('cloud');
            $cron_new['id'] = $cron_new['cloudid'];
            $status = cloud_cron_update($cron_new);
            if (is_error($status)) {
                return $status;
            }
        }
    }
    return true;
}
开发者ID:aspnmy,项目名称:weizan,代码行数:33,代码来源:cron.func.php


示例2: card_credit_set

function card_credit_set()
{
    global $_W;
    $set = array();
    $set = pdo_get('mc_card_credit_set', array('uniacid' => $_W['uniacid']));
    if (!empty($set)) {
        $set['sign'] = iunserializer($set['sign']);
        $set['share'] = iunserializer($set['share']);
    }
    return $set;
}
开发者ID:aspnmy,项目名称:weizan,代码行数:11,代码来源:card.mod.php


示例3: clerk_check

function clerk_check()
{
    global $_W;
    if (empty($_W['openid'])) {
        return error(-1, '获取粉丝openid失败');
    }
    $data = pdo_get('activity_coupon_password', array('uniacid' => $_W['uniacid'], 'openid' => $_W['fans']['from_user']));
    if (empty($data)) {
        return error(-1, '不是操作店员');
    }
    return $data;
}
开发者ID:aspnmy,项目名称:weizan,代码行数:12,代码来源:clerk.mod.php


示例4: card_member

function card_member($uid = 0)
{
    global $_W;
    $uid = intval($uid);
    if ($uid <= 0) {
        $uid = $_W['member']['uid'];
    }
    $data = pdo_get('mc_card_members', array('uniacid' => $_W['uniacid'], 'uid' => $uid));
    if (empty($data)) {
        return error(-1, '会员还没有领取会员卡');
    }
    return $data;
}
开发者ID:eduNeusoft,项目名称:weixin,代码行数:13,代码来源:card.mod.php


示例5: defined

<?php

/**
 * [WeEngine System] Copyright (c) 2014 WE7.CC
 * WeEngine is NOT a free software, it under the license terms, visited http://www.we7.cc/ for more details.
 */
defined('IN_IA') or exit('Access Denied');
uni_user_permission_check('mc_group');
$dos = array('display', 'post', 'delete', 'set');
$do = in_array($do, $dos) ? $do : 'display';
cache_delete("uniaccount:{$_W['uniacid']}");
if ($do == 'display') {
    $_W['page']['title'] = '会员组列表 - 会员组 - 会员中心';
    $setting = pdo_get('uni_settings', array('uniacid' => $_W['uniacid']), array('grouplevel'));
    if (checksubmit('submit')) {
        $grouplevel = intval($_GPC['grouplevel']);
        pdo_update('uni_settings', array('grouplevel' => $grouplevel), array('uniacid' => $_W['uniacid']));
        cache_delete("unisetting:{$_W['uniacid']}");
        foreach ($_GPC['credit'] as $key => $value) {
            $key = intval($key);
            $data['title'] = trim($_GPC['title'][$key]);
            $data['credit'] = intval($_GPC['credit'][$key]);
            pdo_update('mc_groups', $data, array('groupid' => $key, 'uniacid' => $_W['uniacid']));
            unset($data);
        }
        message('用户组更新成功!', referer(), 'success');
    }
    $list = pdo_fetchall("SELECT * FROM " . tablename('mc_groups') . " WHERE uniacid = :uniacid ORDER BY isdefault DESC,credit ASC", array(':uniacid' => $_W['uniacid']));
    $count = pdo_fetchall('SELECT groupid,COUNT(*) AS num FROM ' . tablename('mc_members') . ' WHERE uniacid = :uniacid GROUP BY groupid', array(':uniacid' => $_W['uniacid']), 'groupid');
}
if ($do == 'post') {
开发者ID:zhang19960118,项目名称:html11,代码行数:31,代码来源:group.ctrl.php


示例6: defined

<?php

/**
 * [WeEngine System] Copyright (c) 2014 WE7.CC
 * WeEngine is NOT a free software, it under the license terms, visited http://www.we7.cc/ for more details.
 */
defined('IN_IA') or exit('Access Denied');
$dos = array('display', 'detail');
$do = in_array($do, $dos) ? $do : 'display';
if ($do == 'display') {
    $profile = mc_fetch($_W['member']['uid'], array('nickname', 'avatar', 'mobile', 'groupid'));
    $mcgroups = mc_groups();
    $profile['group'] = $mcgroups[$profile['groupid']];
    $stores = pdo_fetchall('SELECT * FROM ' . tablename('activity_stores') . ' WHERE uniacid = :uniacid', array(':uniacid' => $_W['uniacid']));
}
if ($do == 'detail') {
    $id = intval($_GPC['id']);
    $store = pdo_get('activity_stores', array('uniacid' => $_W['uniacid'], 'id' => $id));
    if (empty($store)) {
        message('门店不存在或已删除', referer(), 'error');
    }
    $store['photo_list'] = iunserializer($store['photo_list']);
    $store['category'] = iunserializer($store['category']);
}
template('mc/store');
开发者ID:zhang19960118,项目名称:html11,代码行数:25,代码来源:store.ctrl.php


示例7: exit

        if (empty($user)) {
            exit(json_encode(array('valid' => true)));
        } else {
            exit(json_encode(array('valid' => false)));
        }
    }
    if (checksubmit('form')) {
        $realname = trim($_GPC['realname']) ? trim($_GPC['realname']) : message('姓名不能为空');
        $mobile = trim($_GPC['mobile']) ? trim($_GPC['mobile']) : message('手机不能为空');
        $user = pdo_get('mc_members', array('uniacid' => $_W['uniacid'], 'mobile' => $mobile));
        if (!empty($user)) {
            message('手机号被占用');
        }
        $email = trim($_GPC['email']);
        if (!empty($email)) {
            $user = pdo_get('mc_members', array('uniacid' => $_W['uniacid'], 'email' => $email));
            if (!empty($user)) {
                message('邮箱被占用');
            }
        }
        $salt = random(8);
        $data = array('uniacid' => $_W['uniacid'], 'realname' => $realname, 'mobile' => $mobile, 'email' => $email, 'salt' => $salt, 'password' => md5(trim($_GPC['password']) . $salt . $_W['config']['setting']['authkey']), 'credit1' => intval($_GPC['credit1']), 'credit2' => intval($_GPC['credit2']), 'groupid' => intval($_GPC['groupid']), 'createtime' => TIMESTAMP);
        pdo_insert('mc_members', $data);
        $uid = pdo_insertid();
        message('添加会员成功,将进入编辑页面', url('mc/member/post', array('uid' => $uid)), 'success');
    }
}
if ($do == 'group') {
    if ($_W['isajax']) {
        $id = intval($_GPC['id']);
        $group = $_W['account']['groups'][$id];
开发者ID:wisemyth,项目名称:weizan,代码行数:31,代码来源:member.ctrl.php


示例8: receive

 public function receive()
 {
     global $_W;
     if ($this->message['event'] == 'subscribe' && !empty($this->message['ticket'])) {
         $sceneid = $this->message['scene'];
         $acid = $this->acid;
         $uniacid = $this->uniacid;
         $row = pdo_fetch("SELECT id, name, acid FROM " . tablename('qrcode') . " WHERE uniacid = :aid AND acid = :acid AND qrcid = :qrcid", array(':aid' => $uniacid, ':acid' => $acid, ':qrcid' => $sceneid));
         if (empty($row)) {
             $row = pdo_fetch("SELECT id, name, acid FROM " . tablename('qrcode') . " WHERE uniacid = :aid AND acid = :acid AND scene_str = :scene_str", array(':aid' => $uniacid, ':acid' => $acid, ':scene_str' => $sceneid));
         }
         $insert = array('uniacid' => $_W['uniacid'], 'acid' => $row['acid'], 'qid' => $row['id'], 'openid' => $this->message['from'], 'type' => 1, 'qrcid' => intval($sceneid), 'scene_str' => $sceneid, 'name' => $row['name'], 'createtime' => TIMESTAMP);
         pdo_insert('qrcode_stat', $insert);
     } elseif ($this->message['event'] == 'SCAN') {
         $sceneid = $this->message['scene'];
         $acid = $this->acid;
         $uniacid = $this->uniacid;
         $row = pdo_fetch("SELECT id, name, acid FROM " . tablename('qrcode') . " WHERE uniacid = :aid AND acid = :acid AND qrcid = :qrcid", array(':aid' => $uniacid, ':acid' => $acid, ':qrcid' => $sceneid));
         if (empty($row)) {
             $row = pdo_fetch("SELECT id, name, acid FROM " . tablename('qrcode') . " WHERE uniacid = :aid AND acid = :acid AND scene_str = :scene_str", array(':aid' => $uniacid, ':acid' => $acid, ':scene_str' => $sceneid));
         }
         $insert = array('uniacid' => $_W['uniacid'], 'acid' => $row['acid'], 'qid' => $row['id'], 'openid' => $this->message['from'], 'type' => 2, 'qrcid' => intval($sceneid), 'scene_str' => $sceneid, 'name' => $row['name'], 'createtime' => TIMESTAMP);
         pdo_insert('qrcode_stat', $insert);
     }
     $stat_setting = uni_setting($_W['uniacid'], 'stat');
     $stat_setting = $stat_setting['stat'];
     if (!is_array($stat_setting) || empty($stat_setting)) {
         $stat_setting = array();
         $stat_setting['msg_maxday'] = 0;
         $stat_setting['msg_history'] = 1;
         $stat_setting['use_ratio'] = 1;
     }
     if (!empty($stat_setting['msg_maxday']) && $stat_setting['msg_maxday'] > 0) {
         pdo_delete('stat_msg_history', " createtime < " . TIMESTAMP . ' - ' . $stat_setting['msg_maxday'] * 86400);
     }
     if ($stat_setting['msg_history']) {
         switch ($this->message['type']) {
             case 'text':
                 $content = iserializer(array('content' => $this->message['content'], 'original' => $this->message['original'], 'redirection' => $this->message['redirection'], 'source' => $this->message['source']));
                 break;
             case 'image':
                 $content = $this->message['url'];
                 break;
             case 'voice':
                 $content = iserializer(array('media' => $this->message['media'], 'format' => $this->message['format']));
                 break;
             case 'video':
                 $content = iserializer(array('media' => $this->message['media'], 'thumb' => $this->message['thumb']));
                 break;
             case 'location':
                 $content = iserializer(array('x' => $this->message['location_x'], 'y' => $this->message['location_y']));
                 break;
             case 'link':
                 $content = iserializer(array('title' => $this->message['title'], 'description' => $this->message['description'], 'url' => $this->message['url']));
                 break;
             case 'subscribe':
                 $content = iserializer(array('scene' => $this->message['scene'], 'ticket' => $this->message['ticket']));
                 break;
             case 'qr':
                 $content = iserializer(array('scene' => $this->message['scene'], 'ticket' => $this->message['ticket']));
                 break;
             case 'click':
                 $content = $this->message['content'];
                 break;
             case 'view':
                 $content = $this->message['url'];
                 break;
             case 'trace':
                 $content = iserializer(array('location_x' => $this->message['location_x'], 'location_y' => $this->message['location_y'], 'precision' => $this->message['precision']));
                 break;
             default:
                 $content = $this->message['content'];
         }
         pdo_insert('stat_msg_history', array('uniacid' => $_W['uniacid'], 'module' => $this->params['module'], 'from_user' => $this->message['from'], 'rid' => intval($this->params['rule']), 'kid' => $this->keyword['id'], 'message' => $content, 'type' => $this->message['type'], 'createtime' => $this->message['time']));
     }
     if (!empty($stat_setting['use_ratio'])) {
         if (!empty($this->params['rule'])) {
             $rule_stat_found = pdo_get('stat_rule', array('rid' => $this->params['rule'], 'createtime' => strtotime(date('Y-m-d'))));
             if (empty($rule_stat_found)) {
                 pdo_insert('stat_rule', array('uniacid' => $_W['uniacid'], 'rid' => $this->params['rule'], 'createtime' => strtotime(date('Y-m-d')), 'hit' => 1, 'lastupdate' => $this->message['time']));
             } else {
                 pdo_query("UPDATE " . tablename('stat_rule') . " SET hit = hit + 1, lastupdate = '" . TIMESTAMP . "' WHERE rid = :rid AND createtime = :createtime", array(':rid' => $this->params['rule'], ':createtime' => strtotime(date('Y-m-d'))));
             }
         }
         if (!empty($this->keyword['id'])) {
             $keyword_stat_found = pdo_get('stat_keyword', array('rid' => $this->params['rule'], 'createtime' => strtotime(date('Y-m-d'))));
             if (empty($keyword_stat_found)) {
                 pdo_insert('stat_keyword', array('uniacid' => $_W['uniacid'], 'rid' => $this->params['rule'], 'kid' => $this->keyword['id'], 'createtime' => strtotime(date('Y-m-d')), 'hit' => 1, 'lastupdate' => $this->message['time']));
             } else {
                 pdo_query("UPDATE " . tablename('stat_keyword') . " SET hit = hit + 1, lastupdate = '" . TIMESTAMP . "' WHERE kid = :kid AND createtime = :createtime", array(':kid' => $this->keyword['id'], ':createtime' => strtotime(date('Y-m-d'))));
             }
         }
     }
 }
开发者ID:aspnmy,项目名称:weizan,代码行数:94,代码来源:receiver.php


示例9: exit

    $acc = WeAccount::create();
    $data = $acc->fansSendAll($group, $type, $media['media_id']);
    if (is_error($data)) {
        exit($data['message']);
    }
    $groups = pdo_fetch('SELECT * FROM ' . tablename('mc_fans_groups') . ' WHERE uniacid = :uniacid AND acid = :acid', array(':uniacid' => $_W['uniacid'], ':acid' => $_W['acid']));
    if (!empty($groups)) {
        $groups = iunserializer($groups['groups']);
    }
    $record = array('uniacid' => $_W['uniacid'], 'acid' => $_W['acid'], 'groupname' => $groups[$group]['name'], 'fansnum' => $groups[$group]['count'], 'msgtype' => $type, 'group' => $group, 'attach_id' => $id, 'status' => 0, 'type' => 0, 'sendtime' => TIMESTAMP, 'createtime' => TIMESTAMP);
    pdo_insert('mc_mass_record', $record);
    exit('success');
}
if ($do == 'del') {
    $id = intval($_GPC['id']);
    $media = pdo_get('wechat_attachment', array('uniacid' => $_W['uniacid'], 'id' => $id));
    if (empty($media)) {
        exit('素材不存在或已经删除');
    }
    $media_id = trim($media['media_id']);
    $acc = WeAccount::create();
    $data = $acc->delMaterial($media_id);
    if (is_error($data)) {
        exit($data['message']);
    } else {
        pdo_delete('wechat_attachment', array('uniacid' => $_W['uniacid'], 'id' => $id));
        if ($type == 'image' || $type == 'voice') {
            $path = ATTACHMENT_ROOT . "/{$media['type']}s/{$_W['uniacid']}/material/{$media['$media_id']}";
            @unlink($path);
        } elseif ($type == 'news') {
            pdo_delete('wechat_news', array('uniacid' => $_W['uniacid'], 'attach_id' => $id));
开发者ID:zhang19960118,项目名称:html11,代码行数:31,代码来源:display.ctrl.php


示例10: 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');
$dos = array('use');
$do = in_array($do, $dos) ? $do : 'use';
if ($do == 'use') {
    $id = intval($_GPC['id']);
    $code = trim($_GPC['code']);
    if ($id == 0 || empty($code)) {
        message('参数错误');
    }
    $record = pdo_get('coupon_record', array('acid' => $_W['acid'], 'id' => $id, 'code' => $code));
    if (empty($record)) {
        message('卡券领取记录不存在');
    }
    $card = pdo_get('coupon', array('acid' => $_W['acid'], 'card_id' => $record['card_id']));
    if (empty($card)) {
        message('卡券不存在或已删除');
    }
    $card['date_info'] = iunserializer($card['date_info']);
    if (checksubmit()) {
        load()->classs('coupon');
        $coupon = new coupon($_W['acid']);
        if (is_null($coupon)) {
            message('系统错误');
        }
        $status = $coupon->ConsumeCode(array('code' => $record['code']));
        if (is_error($status)) {
            message($status['message']);
        }
        pdo_update('coupon_record', array('status' => 3, 'clerk_id' => $clerk['id'], 'clerk_name' => $clerk['name']), array('acid' => $_W['acid'], 'code' => $record['code']));
开发者ID:noikiy,项目名称:mygit,代码行数:31,代码来源:wechat.ctrl.php


示例11: exit

if (empty($uniacid_arr)) {
    exit('非法访问');
}
$receiver = trim($_GPC['receiver']);
if ($receiver == '') {
    exit('请输入邮箱或手机号');
} elseif (preg_match(REGULAR_MOBILE, $receiver)) {
    $receiver_type = 'mobile';
} elseif (preg_match("/^\\w+([-+.]\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*\$/", $receiver)) {
    $receiver_type = 'email';
} else {
    exit('您输入的邮箱或手机号格式错误');
}
$table = trim($_GPC['table']);
if (!empty($table)) {
    $isexist = pdo_get($table, array($receiver_type => $receiver, 'uniacid' => $_W['uniacid']));
    if (!empty($isexist)) {
        exit('手机或邮箱已被注册');
    }
}
$sql = 'DELETE FROM ' . tablename('uni_verifycode') . ' WHERE `createtime`<' . (TIMESTAMP - 1800);
pdo_query($sql);
$sql = 'SELECT * FROM ' . tablename('uni_verifycode') . ' WHERE `receiver`=:receiver AND `uniacid`=:uniacid';
$pars = array();
$pars[':receiver'] = $receiver;
$pars[':uniacid'] = $_W['uniacid'];
$row = pdo_fetch($sql, $pars);
$record = array();
if (!empty($row)) {
    if ($row['total'] >= 5) {
        exit('您的操作过于频繁,请稍后再试');
开发者ID:zhang19960118,项目名称:html11,代码行数:31,代码来源:verifycode.ctrl.php


示例12: header

        $drawing->draw();
    }
    header('Content-Type: image/png');
    header('Content-Disposition: inline; filename="barcode.png"');
    $drawing->finish(BCGDrawing::IMG_FORMAT_PNG);
}
if ($do == 'qrcode') {
    require_once '../framework/library/qrcode/phpqrcode.php';
    $errorCorrectionLevel = "L";
    $matrixPointSize = "8";
    $cardsn = $_W['member']['uid'];
    QRcode::png($cardsn, false, $errorCorrectionLevel, $matrixPointSize);
}
if ($do == 'record') {
    $setting = pdo_get('mc_card', array('uniacid' => $_W['uniacid']), array('nums_text', 'times_text'));
    $card = pdo_get('mc_card_members', array('uniacid' => $_W['uniacid'], 'uid' => $_W['member']['uid']));
    $type = trim($_GPC['type']);
    $where = ' WHERE uniacid = :uniacid AND uid = :uid AND type = :type';
    $params = array(':uniacid' => $_W['uniacid'], ':uid' => $_W['member']['uid'], ':type' => $type);
    $pindex = max(1, intval($_GPC['page']));
    $psize = 20;
    $total = pdo_fetchcolumn('SELECT COUNT(*) FROM ' . tablename('mc_card_record') . $where, $params);
    $limit = ' ORDER BY id DESC LIMIT ' . ($pindex - 1) * $psize . ', ' . $psize;
    $data = pdo_fetchall('SELECT * FROM ' . tablename('mc_card_record') . $where . $limit, $params);
    $pager = pagination($total, $pindex, $psize, '', array('before' => 0, 'after' => 0, 'ajaxcallback' => ''));
}
if ($do == 'mobile') {
    $profile = mc_fetch($_W['member']['uid'], array('mobile'));
    $mobile_exist = empty($profile['mobile']) ? 0 : 1;
    if (checksubmit('submit')) {
        if ($mobile_exist == 1) {
开发者ID:zhang19960118,项目名称:html11,代码行数:31,代码来源:bond.ctrl.php


示例13: cron_add

        $status = cron_add($cron);
        if (is_error($status)) {
            $message .= "{$row['time']}的群发任务同步到云服务失败,请手动同步<br>";
            $cron_status = 1;
        } else {
            pdo_update('mc_mass_record', array('cron_id' => $status), array('id' => $insert_id));
        }
    }
    if ($cron_status) {
        message(error(-1000, $message), '', 'ajax');
    }
    message(error(0, 'success'), '', 'ajax');
}
if ($do == 'cron') {
    $id = intval($_GPC['id']);
    $record = pdo_get('mc_mass_record', array('uniacid' => $_W['uniacid'], 'id' => $id));
    if (empty($record)) {
        message('群发任务不存在或已删除', referer(), 'error');
    }
    load()->func('cron');
    $cron = array('uniacid' => $_W['uniacid'], 'name' => date('Y-m-d', $record['sendtime']) . "微信群发任务", 'filename' => 'mass', 'type' => 1, 'lastruntime' => $record['sendtime'], 'extra' => $record['id'], 'module' => 'task', 'status' => 1);
    $status = cron_add($cron);
    if (is_error($status)) {
        message($status['message'], referer(), 'error');
    }
    pdo_update('mc_mass_record', array('cron_id' => $status), array('uniacid' => $_W['uniacid'], 'id' => $id));
    message('同步到云服务成功', referer(), 'success');
}
if ($do == 'send') {
    $_W['page']['title'] = '群发记录-微信群发';
    $pindex = max(1, intval($_GPC['page']));
开发者ID:zhang19960118,项目名称:html11,代码行数:31,代码来源:mass.ctrl.php


示例14: defined

<?php

/**
 * [Weizan System] Copyright (c) 2014 012WZ.COM
 * Weizan is NOT a free software, it under the license terms, visited http://www.012wz.com/ for more details.
 */
defined('IN_IA') or exit('Access Denied');
$dos = array('sign_display', 'sign', 'sign_record', 'recommend', 'notice', 'sign_strategy', 'share');
$do = in_array($do, $dos) ? $do : 'sign_display';
load()->model('user');
load()->model('card');
$notice_count = card_notice_stat();
$setting = pdo_get('mc_card', array('uniacid' => $_W['uniacid']));
if ($do == 'sign_display') {
    $title = '签到-会员卡';
    $credits = mc_credit_fetch($_W['member']['uid']);
    $time = intval($_GPC['e']) ? intval($_GPC['e']) : TIMESTAMP;
    $pretime = strtotime('-1 month', $time);
    $nexttime = strtotime('+1 month', $time);
    $year = date('Y', $time);
    $month = date('m', $time);
    $day = date('d', $time);
    $record = pdo_fetch('SELECT id FROM ' . tablename('mc_card_sign_record') . ' WHERE uniacid = :uniacid AND uid = :uid AND addtime >= :addtime', array(':uniacid' => $_W['uniacid'], ':uid' => $_W['member']['uid'], ':addtime' => strtotime(date('Y-m-d'))));
    $total = pdo_fetchcolumn('SELECT COUNT(*) FROM ' . tablename('mc_card_sign_record') . ' WHERE uniacid = :uniacid AND uid = :uid', array(':uniacid' => $_W['uniacid'], ':uid' => $_W['member']['uid']));
    $month_record = pdo_fetchall('SELECT id,addtime FROM ' . tablename('mc_card_sign_record') . ' WHERE uniacid = :uniacid AND uid = :uid AND addtime >= :starttime AND addtime <= :endtime', array(':uniacid' => $_W['uniacid'], ':uid' => $_W['member']['uid'], ':starttime' => strtotime(date('Y-m', $time)), ':endtime' => strtotime('+1 month', strtotime(date('Y-m', $time)))));
    $flags = array();
    if (!empty($month_record)) {
        foreach ($month_record as $li) {
            $flags[] = date('j', $li['addtime']);
        }
    }
开发者ID:wisemyth,项目名称:weizan,代码行数:31,代码来源:card.ctrl.php


示例15: elseif

     exit;
 }
 if ($account_info['authorizer_info']['service_type_info'] = '0' || $account_info['authorizer_info']['service_type_info'] == '1') {
     if ($account_info['authorizer_info']['verify_type_info'] > -1) {
         $level = '3';
     } else {
         $level = '1';
     }
 } elseif ($account_info['authorizer_info']['service_type_info'] = '2') {
     if ($account_info['authorizer_info']['verify_type_info'] > -1) {
         $level = '4';
     } else {
         $level = '2';
     }
 }
 $account_found = pdo_get('account_wechats', array('account' => $account_info['authorizer_info']['alias']));
 if (!empty($account_found)) {
     message('公众号已经在系统中接入,是否要更改为授权接入方式? <div><a class="btn btn-primary" href="' . url('account/auth/confirm', array('level' => $level, 'auth_refresh_token' => $auth_refresh_token, 'auth_appid' => $auth_appid, 'acid' => $account_found['acid'], 'uniacid' => $account_found['uniacid'])) . '">是</a> &nbsp;&nbsp;<a class="btn btn-default" href="index.php">否</a></div>', '', 'tips');
 }
 $account_insert = array('name' => $account_info['authorizer_info']['nick_name'], 'description' => '', 'groupid' => 0);
 if (!pdo_insert('uni_account', $account_insert)) {
     message('授权登录新建公众号失败,请重试', url('account/display'), 'error');
 }
 $uniacid = pdo_insertid();
 $template = pdo_fetch('SELECT id,title FROM ' . tablename('site_templates') . " WHERE name = 'default'");
 $style_insert = array('uniacid' => $uniacid, 'templateid' => $template['id'], 'name' => $template['title'] . '_' . random(4));
 pdo_insert('site_styles', $style_insert);
 $styleid = pdo_insertid();
 $multi_insert = array('uniacid' => $uniacid, 'title' => $account_insert['name'], 'styleid' => $styleid);
 pdo_insert('site_multi', $multi_insert);
 $multi_id = pdo_insertid();
开发者ID:aspnmy,项目名称:weizan,代码行数:31,代码来源:auth.ctrl.php


示例16: payResult

 public function payResult($params)
 {
     global $_W;
     load()->model('mc');
     $order = pdo_fetch("SELECT * FROM " . tablename('mc_credits_recharge') . " WHERE tid = :tid", array(':tid' => $params['tid']));
     if (empty($order['status'])) {
         $fee = $params['fee'];
         $total_fee = $fee;
         $data = array('status' => $params['result'] == 'success' ? 1 : -1);
         if ($params['type'] == 'wechat') {
             $data['transid'] = $params['tag']['transaction_id'];
             $params['user'] = mc_openid2uid($params['user']);
         }
         pdo_update('mc_credits_recharge', $data, array('tid' => $params['tid']));
         if ($params['result'] == 'success' && $params['from'] == 'notify') {
             $paydata = array('wechat' => '微信', 'alipay' => '支付宝', 'baifubao' => '百付宝', 'unionpay' => '银联');
             if (empty($order['type']) || $order['type'] == 'credit') {
                 $setting = uni_setting($_W['uniacid'], array('creditbehaviors', 'recharge'));
                 $credit = $setting['creditbehaviors']['currency'];
                 if (empty($credit)) {
                     message('站点积分行为参数配置错误,请联系服务商', '', 'error');
                 } else {
                     $recharge = $setting['recharge'];
                     $add_fee = 0;
                     if (!empty($recharge)) {
                         $back = -1;
                         foreach ($recharge as $k => $li) {
                             if ($li['recharge'] <= $fee) {
                                 $back = $k;
                             }
                         }
                         if (!empty($recharge[$back])) {
                             $add_fee = $recharge[$back]['back'];
                             $total_fee = $add_fee + $fee;
                             $add_str = ",满足 充{$recharge[$back]['recharge']}返{$recharge[$back]['back']},返余额{$recharge[$back]['back']}元,本次操作共增加余额{$total_fee}元";
                         }
                     }
                     $record[] = $params['user'];
                     $record[] = '用户通过' . $paydata[$params['type']] . '充值' . $fee . $add_str;
                     mc_credit_update($order['uid'], $credit, $total_fee, $record);
                     $remark = '用户通过' . $paydata[$params['type']] . '充值' . $fee . $add_str;
                     mc_notice_recharge($order['openid'], $order['uid'], $total_fee, '', $remark);
                 }
             }
             if ($order['type'] == 'card_nums') {
                 $member_card = pdo_get('mc_card_members', array('uniacid' => $order['uniacid'], 'uid' => $order['uid']));
                 $total_num = $member_card['nums'] + $order['tag'];
                 pdo_update('mc_card_members', array('nums' => $total_num), array('uniacid' => $order['uniacid'], 'uid' => $order['uid']));
                 $log = array('uniacid' => $order['uniacid'], 'uid' => $order['uid'], 'type' => 'nums', 'fee' => $params['fee'], 'model' => '1', 'tag' => $order['tag'], 'note' => date('Y-m-d H:i') . "通过{$paydata[$params['type']]}充值{$params['fee']}元,返{$order['tag']}次,总共剩余{$total_num}次", 'addtime' => TIMESTAMP);
                 pdo_insert('mc_card_record', $log);
                 $type = pdo_fetchcolumn('SELECT nums_text FROM ' . tablename('mc_card') . ' WHERE uniacid = :uniacid', array(':uniacid' => $order['uniacid']));
                 $total_num = $member_card['nums'] + $order['tag'];
                 mc_notice_nums_plus($order['openid'], $type, $order['tag'], $total_num);
             }
             if ($order['type'] == 'card_times') {
                 $member_card = pdo_get('mc_card_members', array('uniacid' => $order['uniacid'], 'uid' => $order['uid']));
                 if ($member_card['endtime'] > TIMESTAMP) {
                     $endtime = $member_card['endtime'] + $order['tag'] * 86400;
                 } else {
                     $endtime = strtotime($order['tag'] . 'days');
                 }
                 pdo_update('mc_card_members', array('endtime' => $endtime), array('uniacid' => $order['uniacid'], 'uid' => $order['uid']));
                 $log = array('uniacid' => $order['uniacid'], 'uid' => $order['uid'], 'type' => 'times', 'model' => '1', 'fee' => $params['fee'], 'tag' => $order['tag'], 'note' => date('Y-m-d H:i') . "通过{$paydata[$params['type']]}充值{$params['fee']}元,返{$order['tag']}天,充值后到期时间:" . date('Y-m-d', $endtime), 'addtime' => TIMESTAMP);
                 pdo_insert('mc_card_record', $log);
                 $type = pdo_fetchcolumn('SELECT times_text FROM ' . tablename('mc_card') . ' WHERE uniacid = :uniacid', array(':uniacid' => $order['uniacid']));
                 $endtime = date('Y-m-d', $endtime);
                 mc_notice_times_plus($order['openid'], $member_card['cardsn'], $type, $fee, $order['tag'], $endtime);
             }
         }
     }
     if ($order['type'] == 'credit' || $order['type'] == '') {
         $url = murl('mc/home');
     } else {
         $url = murl('mc/bond/mycard');
     }
     if ($params['from'] == 'return') {
         if ($params['result'] == 'success') {
             message('支付成功!', '../../app/' . $url, 'success');
         } else {
             message('支付失败!', '../../app/' . $url, 'error');
         }
     }
 }
开发者ID:noikiy,项目名称:mygit,代码行数:83,代码来源:site.php


示例17: trim

 $op = trim($_GPC['op']) ? trim($_GPC['op']) : 'list';
 if ($op == 'list') {
     $pindex = max(1, intval($_GPC['page']));
     $psize = 30;
     $limit = " ORDER BY id DESC LIMIT " . ($pindex - 1) * $psize . ", {$psize}";
     $addtime = intval($_GPC['addtime']);
     $where = ' WHERE uniacid = :uniacid';
     $param = array(':uniacid' => $_W['uniacid']);
     $total = pdo_fetchcolumn('SELECT COUNT(*) FROM ' . tablename('mc_card_recommend') . " {$where}", $param);
     $recommends = pdo_fetchall('SELECT * FROM ' . tablename('mc_card_recommend') . " {$where} {$limit}", $param);
     $pager = pagination($total, $pindex, $psize);
 }
 if ($op == 'post') {
     $id = intval($_GPC['id']);
     if ($id > 0) {
         $recommend = pdo_get('mc_card_recommend', array('uniacid' => $_W['uniacid'], 'id' => $id));
         if (empty($recommend)) {
             message('推荐不存在或已被删除', referer(), 'error');
         }
     }
     if (checksubmit()) {
         $title = trim($_GPC['title']) ? trim($_GPC['title']) : message('推荐标题不能为空');
         $content = trim($_GPC['url']) ? trim($_GPC['url']) : message('推荐链接不能为空');
         $data = array('uniacid' => $_W['uniacid'], 'title' => $title, 'thumb' => trim($_GPC['thumb']), 'url' => trim($_GPC['url']), 'displayorder' => intval($_GPC['displayorder']), 'addtime' => TIMESTAMP);
         if ($id > 0) {
             pdo_update('mc_card_recommend', $data, array('uniacid' => $_W['uniacid'], 'id' => $id));
         } else {
             pdo_insert('mc_card_recommend', $data);
         }
         message('发布推荐成功', url('mc/card/recommend'), 'success');
     }
开发者ID:zhang19960118,项目名称:html11,代码行数:31,代码来源:card.ctrl.php


示例18: mc_notice_recharge

            if ($num > 0) {
                mc_notice_recharge($openid, $uid, $num, '', "管理员后台操作余额,增加{$value}余额");
            } else {
                mc_notice_credit2($openid, $uid, $num, 0, '', '', "管理员后台操作余额,减少{$value}余额");
            }
        }
    }
    exit('success');
}
if ($do == 'card') {
    load()->model('card');
    $card = card_setting();
    if (empty($card)) {
        exit('公众号未设置会员卡');
    }
    $member = pdo_get('mc_card_members', array('uniacid' => $_W['uniacid'], 'uid' => $user['uid']));
    if (!empty($member)) {
        exit('该会员已领取会员卡');
    }
    $cardsn = $card['format'];
    preg_match_all('/(\\*+)/', $card['format'], $matchs);
    if (!empty($matchs)) {
        foreach ($matchs[1] as $row) {
            $cardsn = str_replace($row, random(strlen($row), 1), $cardsn);
        }
    }
    preg_match('/(\\#+)/', $card['format'], $matchs);
    $length = strlen($matchs[1]);
    $pos = strpos($card['format'], '#');
    $cardsn = str_replace($matchs[1], str_pad($card['snpos']++, $length - strlen($number), '0', STR_PAD_LEFT), $cardsn);
    $record = array('uniacid' => $_W['uniacid'], 'openid' => '', 'uid' => $uid, 'cid' => $card['id'], 'cardsn' => $cardsn, 'status' => '1', 'createtime' => TIMESTAMP, 'endtime' => TIMESTAMP);
开发者ID:zhang19960118,项目名称:html11,代码行数:31,代码来源:trade.ctrl.php


示例19: defined

<?php

/**
 * [WeEngine System] Copyright (c) 2014 WE7.CC
 * WeEngine is NOT a free software, it under the license terms, visited http://www.we7.cc/ for more details.
 */
defined('IN_IA') or exit('Access Denied');
$dos = array('use');
$do = in_array($do, $dos) ? $do : 'use';
if ($do == 'use') {
    $id = intval($_GPC['id']);
    load()->model('activity');
    $token = pdo_get('activity_coupon', array('uniacid' => $_W['uniacid'], 'couponid' => $id));
    if (empty($token)) {
        message('优惠券不存在或已删除', '', 'error');
    }
    $own_func = 'activity_token_owned';
    $use_func = 'activity_token_use';
    if ($token['type'] == 1) {
        $own_func = 'activity_coupon_owned';
        $use_func = 'activity_coupon_use';
    }
    $data = $own_func($uid, array('couponid' => $id, 'used' => 1));
    $data = $data['data'][$id];
    if (empty($data)) {
        message('该会员没有领取该优惠券或领取的优惠券已核销', '', 'error');
    }
    if (checksubmit('submit')) {
        if (!empty($clerk)) {
            $status = $use_func($uid, $id, $clerk['name'], $clerk['id']);
            if (!is_error($status)) {
开发者ID:eduNeusoft,项目名称:weixin,代码行数:31,代码来源:token.ctrl.php


示例20: message

    if (is_error($ret)) {
        message($ret, '', 'ajax');
    } else {
        $menu = json_decode(urldecode(json_encode($menu)), true);
        if (!isset($menu['matchrule'])) {
            $menu['matchrule'] = array();
        }
        $insert = array('uniacid' => $_W['uniacid'], 'menuid' => $ret, 'title' => $post['title'], 'type' => $post['type'], 'sex' => intval($menu['matchrule']['sex']), 'group_id' => isset($menu['matchrule']['group_id']) ? $menu['matchrule']['group_id'] : -1, 'client_platform_type' => intval($menu['matchrule']['client_platform_type']), 'area' => trim($menus['matchrule']['country']) . trim($menu['matchrule']['province']) . trim($menu['matchrule']['city']), 'data' => base64_encode(iserializer($menu)), 'status' => 1, 'createtime' => TIMESTAMP);
        if ($post['type'] == 1) {
            $history = pdo_get('uni_account_menus', array('uniacid' => $_W['uniacid'], 'type' => 2));
            if (empty($history)) {
                $data = $insert;
                $data['type'] = 2;
                $data['status'] = 0;
                pdo_insert('uni_account_menus', $data);
            } else {
                $data = $insert;
                $data['type'] = 2;
                $data['status'] = 0;
                pdo_update('uni_account_menus', $data, array('uniacid' => $_W['uniacid'], 'type' => 2));
            }
            $default = pdo_get('uni_account_menus', array('uniacid' => $_W['uniacid'], 'type' => 1));
            if (!empty($default)) {
                pdo_update('uni_account_menus', $insert, array('uniacid' => $_W['uniacid'], 'type' => 1));
                message(error(0, ''), '', 'ajax');
            }
        }
        pdo_insert('uni_account_menus', $insert);
        message(error(0, ''), '', 'ajax');
    }
}
开发者ID:wisemyth,项目名称:weizan,代码行数:31,代码来源:menu.ctrl.php



注:本文中的pdo_get函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP pdo_insert函数代码示例发布时间:2022-05-15
下一篇:
PHP pdo_fieldexists函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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