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

PHP pdo_fetchcolumn函数代码示例

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

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



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

示例1: doMobileranking

 public function doMobileranking()
 {
     global $_W, $_GPC;
     $uniacid = $_W['uniacid'];
     $userinfo = $this->userinfo;
     $openid = $userinfo['mk_openid'];
     $score = $_GPC['score'];
     $id = $_GPC['id'];
     $reply = pdo_fetch("SELECT * FROM " . tablename($this->table_reply) . " WHERE id = :id", array(':id' => $id));
     $user = pdo_fetch("SELECT * FROM " . tablename($this->table_user) . " where uniacid={$uniacid} and openid='{$openid}' and rid ={$reply['rid']}");
     $userall = pdo_fetchall("SELECT * FROM " . tablename($this->table_user) . " where uniacid={$uniacid} and rid ={$reply['rid']} ORDER BY asnum desc LIMIT 0,10");
     $usernum = pdo_fetchcolumn("SELECT count(*) FROM " . tablename($this->table_user) . " where uniacid={$uniacid} and rid ={$reply['rid']}");
     $maxpage = intval($usernum / 10 + 1);
     $usernuma = pdo_fetchall("SELECT * FROM " . tablename($this->table_user) . " where uniacid={$uniacid} and rid ={$reply['rid']} ORDER BY asnum desc ");
     $i = 0;
     $mingci = 0;
     foreach ($usernuma as $key => $value) {
         $i++;
         if ($openid == $value['openid']) {
             $mingci = $i;
             break;
         }
     }
     include $this->template('ranking');
 }
开发者ID:wisemyth,项目名称:weizan,代码行数:25,代码来源:site.php


示例2: respond

 public function respond()
 {
     global $_W;
     $rid = $this->rule;
     $sql = "SELECT * FROM " . tablename('sns') . " WHERE `rid`=:rid LIMIT 1";
     $row = pdo_fetch($sql, array(':rid' => $rid));
     if (empty($row['id'])) {
         return array();
     }
     $lastvisit = TIMESTAMP;
     $user = pdo_fetch("SELECT id,nickname FROM " . tablename('fans') . " WHERE from_user ='{$this->message['from']}'  LIMIT 1");
     $data = array('uid' => $user['id'], 'lastvisit' => $lastvisit, 'type' => 'sns', 'weid' => $_W['weid']);
     /*
     $zt = pdo_fetch("SELECT lastvisit FROM ".tablename('fans_status')." WHERE uid ={$user['id']}  LIMIT 1");
     if(!$zt){
     pdo_insert('fans_status', $data);
     }
     else
     {
     	unset($data['uid']);
     	pdo_update('fans_status', $data,array('uid'=>$user['id']));
     }
     */
     $title = pdo_fetchcolumn("SELECT name FROM " . tablename('rule') . " WHERE id = :rid LIMIT 1", array(':rid' => $rid));
     $url = create_url('mobile/module/list', array('name' => 'sns', 'type' => $row['type'], 'id' => $rid, 'weid' => $_W['weid']));
     $news = array();
     $news[] = array('title' => $title, 'description' => $row['description'], 'picurl' => $_W['attachurl'] . $row['picture'], 'url' => $url);
     return $this->respNews($news);
     //print_r($user['nickname']);exit;
     //return $this->respText($user['nickname'].'<a href="'.$url.'">点此进入微吧,进行互动交流吧</a>');
 }
开发者ID:alextiannus,项目名称:wormwood_wechat,代码行数:31,代码来源:processor.php


示例3: doMobileMy

 public function doMobileMy()
 {
     global $_W, $_GPC;
     checkauth();
     $rid = $_GPC['rid'];
     $from_user = $_W['fans']['from_user'];
     $list = pdo_fetchall("SELECT * FROM " . tablename('weizp_album') . " WHERE rid=:rid AND from_user=:from_user", array('rid' => $rid, 'from_user' => $from_user));
     foreach ($list as $k => $v) {
         foreach ($v as $sk => $sv) {
             if ($sk == 'images') {
                 $tmp = unserialize($sv);
                 $images = array();
                 foreach ($tmp as $ssv) {
                     $images[]['id'] = $ssv;
                     $images[]['file'] = pdo_fetchcolumn("SELECT file FROM " . tablename('weizp_images') . "WHERE id='{$ssv}'");
                 }
                 $sv = $images;
             }
             $v[$sk] = $sv;
         }
         $list[$k] = $v;
     }
     //var_dump($list);
     include $this->template('my');
 }
开发者ID:alextiannus,项目名称:wormwood_wechat,代码行数:25,代码来源:site.php


示例4: payResult

 public function payResult($params)
 {
     load()->model('mc');
     $status = pdo_fetchcolumn("SELECT status FROM " . tablename('mc_credits_recharge') . " WHERE tid = :tid", array(':tid' => $params['tid']));
     if (empty($status)) {
         $fee = $params['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') {
             $setting = uni_setting($_W['uniacid'], array('creditbehaviors'));
             $credit = $setting['creditbehaviors']['currency'];
             if (empty($credit)) {
                 message('站点积分行为参数配置错误,请联系服务商', '', 'error');
             } else {
                 $paydata = array('wechat' => '微信', 'alipay' => '支付宝');
                 $record[] = $params['user'];
                 $record[] = '用户通过' . $paydata[$params['type']] . '充值' . $fee;
                 mc_credit_update($params['user'], $credit, $fee, $record);
             }
         }
     }
     if ($params['from'] == 'return') {
         if ($params['result'] == 'success') {
             message('支付成功!', '../../app/' . url('mc/home'), 'success');
         } else {
             message('支付失败!', '../../app/' . url('mc/home'), 'error');
         }
     }
 }
开发者ID:6662680,项目名称:qday_wx,代码行数:33,代码来源:site.php


示例5: receive

 public function receive()
 {
     global $_W, $_GPC;
     load()->model('mc');
     load()->func('communication');
     $event = $this->message['event'];
     $openid = $this->message['from'];
     $f_log = pdo_fetch("SELECT * FROM " . tablename('mc_mapping_fans') . " WHERE `uniacid` = '{$_W['uniacid']}' AND `openid` = '{$openid}'");
     if ($f_log['uid'] != 0) {
         pdo_update('hx_subscribe_data', array('uid' => $f_log['uid']), array('openid' => $openid));
         $uid = $f_log['uid'];
     } else {
         $default_groupid = pdo_fetchcolumn('SELECT groupid FROM ' . tablename('mc_groups') . ' WHERE uniacid = :uniacid AND isdefault = 1', array(':uniacid' => $_W['uniacid']));
         $data = array('uniacid' => $_W['uniacid'], 'email' => md5($openid) . '@qdaygroup.com', 'salt' => random(8), 'groupid' => $default_groupid, 'createtime' => TIMESTAMP);
         $data['password'] = md5($message['from'] . $data['salt'] . $_W['config']['setting']['authkey']);
         pdo_insert('mc_members', $data);
         $uid = pdo_insertid();
         pdo_update('mc_mapping_fans', array('uid' => $uid), array('openid' => $openid));
         pdo_update('hx_subscribe_data', array('uid' => $uid), array('openid' => $openid));
     }
     $credit_type = isset($this->module['config']['credit_type']) ? $this->module['config']['credit_type'] : 'credit1';
     $credit_subscribe = isset($this->module['config']['credit_subscribe']) ? $this->module['config']['credit_subscribe'] : 5;
     $credit_lever_1 = isset($this->module['config']['credit_lever_1']) ? $this->module['config']['credit_lever_1'] : 2;
     $credit_lever_2 = isset($this->module['config']['credit_lever_2']) ? $this->module['config']['credit_lever_2'] : 1;
     if ($event == 'subscribe') {
         $s_log = pdo_fetch("SELECT * FROM " . tablename('hx_subscribe_data') . " WHERE `uniacid`='{$_W['uniacid']}' AND `openid`='{$openid}'");
         if (empty($s_log)) {
             //如果没记录
             $insert = array('uniacid' => $_W['uniacid'], 'openid' => $openid, 'uid' => $uid, 'from_uid' => '0', 'sn' => time(), 'follow' => '1', 'article_id' => '0', 'shouyi' => $credit_subscribe, 'createtime' => TIMESTAMP);
             pdo_insert('hx_subscribe_data', $insert);
             mc_credit_update($uid, $credit_type, $credit_subscribe, array('1', '关注增加积分'));
         } else {
             //如果有记录
             if ($s_log['follow'] != 1) {
                 //如果记录未关注
                 $insert = array('follow' => '1');
                 pdo_update('hx_subscribe_data', $insert, array('id' => $s_log['id']));
                 mc_credit_update($uid, $credit_type, $credit_subscribe, array('1', '关注增加积分'));
             }
             if (!empty($s_log['from_uid'])) {
                 //如果来源ID不为空
                 $from_user = pdo_fetch("SELECT * FROM " . tablename('hx_subscribe_data') . " WHERE `uniacid`='{$_W['uniacid']}' AND `uid`='{$s_log['from_uid']}'");
                 if (!empty($from_user)) {
                     $data = array('shouyi' => $from_user['shouyi'] + $credit_lever_1, 'zjrs' => $from_user['zjrs'] + 1);
                     pdo_update('hx_subscribe_data', $data, array('id' => $from_user['id']));
                     mc_credit_update($s_log['from_uid'], $credit_type, $credit_lever_1, array('1', '推荐一级关注增加积分'));
                     if (!empty($from_user['from_uid'])) {
                         $from_user_2 = pdo_fetch("SELECT * FROM " . tablename('hx_subscribe_data') . " WHERE `uniacid`='{$_W['uniacid']}' AND `uid`='{$from_user['from_uid']}'");
                         if (!empty($from_user_2)) {
                             $data2 = array('shouyi' => $from_user_2['shouyi'] + $credit_lever_2, 'jjrs' => $from_user_2['jjrs'] + 1);
                             pdo_update('hx_subscribe_data', $data2, array('id' => $from_user_2['id']));
                             mc_credit_update($from_user['from_uid'], $credit_type, $credit_lever_2, array('1', '推荐二级关注增加积分'));
                         }
                     }
                 }
             }
         }
         //pdo_update('hx_subscribe_data',array('follow'=>1),array('openid'=>$openid));
     }
 }
开发者ID:6662680,项目名称:qday_wx,代码行数:60,代码来源:receiver.php


示例6: fieldsFormSubmit

 public function fieldsFormSubmit($rid)
 {
     //规则验证无误保存入库时执行,这里应该进行自定义字段的保存。这里 $rid 为对应的规则编号
     global $_GPC, $_W;
     $currentprompt = trim($_GPC['currentprompt']) ? trim($_GPC['currentprompt']) : '当前数字是 {LUCKYNUM}!';
     $awardprompt = trim($_GPC['awardprompt']) ? trim($_GPC['awardprompt']) : '恭喜您,当前数字是 {LUCKYNUM},获得 {AWARD} 奖品!';
     $data = array('rid' => $rid, 'uniacid' => $_W['uniacid'], 'luckynumstart' => $_GPC['luckynumstart'], 'luckynumfilter' => $_GPC['luckynumfilter'], 'show_instruction' => $_GPC['show_instruction'], 'time_instruction' => $_GPC['time_instruction'], 'limit_instruction' => $_GPC['limit_instruction'], 'end_instruction' => $_GPC['end_instruction'], 'awardnum_instruction' => $_GPC['awardnum_instruction'], 'award_instruction' => $_GPC['award_instruction'], 'starttime' => strtotime($_GPC['datelimit']['start']), 'endtime' => strtotime($_GPC['datelimit']['end']), 'limittype' => $_GPC['limittype'], 'awardnum' => $_GPC['awardnum'], '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'], 'currentprompt' => $currentprompt, 'awardprompt' => $awardprompt, 'sponsors1' => $_GPC['sponsors1'], 'sponsors1link' => $_GPC['sponsors1link'], 'sponsors2' => $_GPC['sponsors2'], 'sponsors2link' => $_GPC['sponsors2link'], 'sponsors3' => $_GPC['sponsors3'], 'sponsors3link' => $_GPC['sponsors3link'], 'sponsors4' => $_GPC['sponsors4'], 'sponsors4link' => $_GPC['sponsors4link'], 'sponsors5' => $_GPC['sponsors5'], 'sponsors5link' => $_GPC['sponsors5link'], 'ruletext' => $_GPC['ruletext'], 'title' => $_GPC['title'], 'shareimg' => $_GPC['shareimg'], 'sharetitle' => $_GPC['sharetitle'], 'sharedesc' => $_GPC['sharedesc']);
     $id = pdo_fetchcolumn("SELECT id FROM " . tablename('stonefish_luckynum') . " WHERE rid = :rid", array(':rid' => $rid));
     //if ($_GPC['shouquan']==$_GPC['we7_ValidCode_server']){
     if (empty($id)) {
         $data['isshow'] = 1;
         pdo_insert('stonefish_luckynum', $data);
     } else {
         pdo_update('stonefish_luckynum', $data, array('id' => $id));
     }
     //}
     //update
     if (!empty($_GPC['award_number'])) {
         foreach ($_GPC['award_number'] as $key => $val) {
             $update_data = array('numbers' => $_GPC['award_number'][$key], 'title' => $_GPC['award_title'][$key], 'description' => $_GPC['award_desc'][$key]);
             //if ($_GPC['shouquan']==$_GPC['we7_ValidCode_server']){
             pdo_update($this->tablename, $update_data, array('id' => $key));
             //}
         }
     }
     //insert
     if (!empty($_GPC['newaward_number'])) {
         foreach ($_GPC['newaward_number'] as $key => $val) {
             $new_data = array('rid' => $rid, 'uniacid' => $_W['uniacid'], 'numbers' => $_GPC['newaward_number'][$key], 'title' => $_GPC['newaward_title'][$key], 'description' => $_GPC['newaward_desc'][$key], 'dateline' => $_W['timestamp']);
             //if ($_GPC['shouquan']==$_GPC['we7_ValidCode_server']){
             pdo_insert($this->tablename, $new_data);
             //}
         }
     }
 }
开发者ID:eduNeusoft,项目名称:weixin,代码行数:35,代码来源:module.php


示例7: doWebWishlist

 public function doWebWishlist()
 {
     global $_GPC, $_W;
     $rid = intval($_GPC['rid']);
     if (empty($rid)) {
         message('抱歉,传递的参数错误!', '', 'error');
     }
     $where = '';
     $params = array(':rid' => $rid, ':weid' => $_W['uniacid']);
     if (isset($_GPC['status'])) {
         $where .= ' and status=:status';
         $params[':status'] = $_GPC['status'];
     }
     if (!empty($_GPC['keywords'])) {
         $where .= 'AND `dream` LIKE :keywords';
         $params[':keywords'] = "%{$_GPC['keywords']}%";
     }
     $total = pdo_fetchcolumn("SELECT count(*) FROM " . tablename('dream_wish') . " WHERE rid = :rid and weid=:weid " . $where . "", $params);
     $pindex = max(1, intval($_GPC['page']));
     $psize = 5;
     $pager = pagination($total, $pindex, $psize);
     $start = ($pindex - 1) * $psize;
     $limit .= " LIMIT {$start},{$psize}";
     $list = pdo_fetchall("SELECT a.* FROM " . tablename('dream_wish') . " a WHERE a.rid = :rid and a.weid=:weid  " . $where . " ORDER BY a.id DESC " . $limit, $params);
     //一些参数的显示
     $reply = pdo_fetch("SELECT * FROM " . tablename($this->tablename) . " WHERE rid = :rid", array(':rid' => $rid));
     $viewnum = $reply['viewnum'];
     $dreamnum = $reply['dreamnum'];
     include $this->template('wishlist');
 }
开发者ID:aspnmy,项目名称:weizan,代码行数:30,代码来源:site.php


示例8: doMobiledelcomment

 public function doMobiledelcomment()
 {
     global $_W, $_GPC;
     $cid = $_GPC['cid'];
     //$comment=$_GPC['cont'];
     //将ajax写入comment
     $uniacid = $_W['uniacid'];
     // 		$openid=$_W['openid'];
     // 		$ulist=$this->auth($uniacid,$openid);
     //var_dump($ulist);
     // 		$data=array(
     // 			'uniacid'=>$uniacid,
     // 			'tid'=>$tid,
     // 			'comment'=>$comment,
     // 			'nickname'=>$ulist['nickname'],
     // 			'cuid'=>$ulist['uid'],
     // 			'createtime'=>TIMESTAMP
     // 		);
     // 		pdo_insert('enjoy_circle_comment',$data);
     $data['tid'] = pdo_fetchcolumn("select tid from " . tablename('enjoy_circle_comment') . " where cid=" . $cid . "");
     //删除评论
     $res = pdo_delete('enjoy_circle_comment', array('uniacid' => $uniacid, 'cid' => $cid));
     if ($res > 0) {
         echo json_encode($data);
     }
 }
开发者ID:aspnmy,项目名称:weizan,代码行数:26,代码来源:site.php


示例9: travel_article_search

function travel_article_search($cid, $type = '', $psize = 20, $orderby = 'id DESC')
{
    global $_GPC, $_W;
    $pindex = max(1, intval($_GPC['page']));
    $result = array();
    $condition = " WHERE weid = '{$_W['weid']}' AND ";
    if (!empty($cid)) {
        $category = pdo_fetch("SELECT parentid FROM " . tablename('article_category') . " WHERE id = '{$cid}'");
        if (!empty($category['parentid'])) {
            $condition .= "ccate = '{$cid}'";
        } else {
            $condition .= "pcate = '{$cid}'";
        }
    }
    if (!empty($cid) && !empty($type)) {
        $condition .= " OR ";
    }
    if (!empty($type)) {
        $type = explode(',', $type);
        foreach ($type as $item) {
            $condition .= "type LIKE '%{$item},%'";
        }
    }
    $sql = "SELECT * FROM " . tablename('travel') . $condition . ' ORDER BY ' . $orderby;
    $result['list'] = pdo_fetchall($sql . " LIMIT " . ($pindex - 1) * $psize . ',' . $psize);
    $total = pdo_fetchcolumn('SELECT COUNT(*) FROM ' . tablename('travel') . $condition);
    $result['pager'] = pagination($total, $pindex, $psize);
    return $result;
}
开发者ID:alextiannus,项目名称:wormwood_wechat,代码行数:29,代码来源:model.php


示例10: doWebList

 public function doWebList()
 {
     //这个操作被定义用来呈现 管理中心导航菜单
     global $_W, $_GPC;
     $pindex = max(1, intval($_GPC['page']));
     $psize = 20;
     $condition = '';
     if (!empty($_GPC['keyword'])) {
         $condition .= " AND title LIKE '%{$_GPC['keyword']}%'";
     }
     if (!empty($_GPC['createtime'])) {
         $c_s = strtotime($_GPC['createtime']['start']);
         $c_e = strtotime($_GPC['createtime']['end']);
         $condition .= " AND createtime >= '{$c_s}' AND createtime <= '{$c_e}'";
     }
     if (empty($_GPC['createtime'])) {
         $c_s = time() - 86400 * 30;
         $c_e = time() + 84400;
     }
     $list = pdo_fetchall("SELECT * FROM " . tablename('hx_pictorial') . " WHERE weid = '{$_W['uniacid']}' {$condition} ORDER BY displayorder DESC, id DESC LIMIT " . ($pindex - 1) * $psize . ',' . $psize);
     $total = pdo_fetchcolumn('SELECT COUNT(*) FROM ' . tablename('hx_pictorial') . " WHERE weid = '{$_W['uniacid']}' {$condition}");
     $pager = pagination($total, $pindex, $psize);
     if (!empty($list)) {
         foreach ($list as &$row) {
             $row['total'] = pdo_fetchcolumn("SELECT COUNT(*) FROM " . tablename('hx_pictorial_photo') . " WHERE pictorialid = :pictorialid", array(':pictorialid' => $row['id']));
         }
     }
     load()->func('tpl');
     include $this->template('list');
 }
开发者ID:wisemyth,项目名称:weizan,代码行数:30,代码来源:site.php


示例11: dolist

 public function dolist()
 {
     global $_GPC, $_W;
     checklogin();
     $weid = intval($_W['weid']);
     if (checksubmit('verify') && !empty($_GPC['select'])) {
         pdo_update('message_list', array('isshow' => 1, 'create_time' => TIMESTAMP), " id  IN  ('" . implode("','", $_GPC['select']) . "')");
         message('审核成功!', create_url('site/module', array('do' => 'list', 'name' => 'message', 'weid' => $weid, 'page' => $_GPC['page'])));
     }
     if (checksubmit('delete') && !empty($_GPC['select'])) {
         pdo_delete('message_list', " id  IN  ('" . implode("','", $_GPC['select']) . "')");
         message('删除成功!', create_url('site/module', array('do' => 'list', 'name' => 'message', 'weid' => $weid, 'page' => $_GPC['page'])));
     }
     $isshow = isset($_GPC['isshow']) ? intval($_GPC['isshow']) : 0;
     $pindex = max(1, intval($_GPC['page']));
     $psize = 20;
     $message = pdo_fetch("SELECT id, isshow, weid FROM " . tablename('message_reply') . " WHERE weid = '{$weid}' LIMIT 1");
     $list = pdo_fetchall("SELECT * FROM " . tablename('message_list') . " WHERE weid = '{$message['weid']}' AND isshow = '{$isshow}' ORDER BY create_time DESC LIMIT " . ($pindex - 1) * $psize . ",{$psize}");
     if (!empty($list)) {
         $total = pdo_fetchcolumn('SELECT COUNT(*) FROM ' . tablename('message_list') . " WHERE weid = '{$message['weid']}' AND isshow = '{$isshow}'");
         $pager = pagination($total, $pindex, $psize);
         foreach ($list as &$row) {
             $row['content'] = emotion($row['content']);
             $userids[] = $row['from_user'];
         }
         unset($row);
     }
     include $this->template('list');
 }
开发者ID:alextiannus,项目名称:wormwood_wechat,代码行数:29,代码来源:module.php


示例12: respond

 public function respond()
 {
     global $_W;
     $content = $this->message['content'];
     $from_user = $this->message['from'];
     $isfill = pdo_fetchcolumn("SELECT isfill FROM " . tablename('xc_article_article_reply') . " WHERE rid =:rid AND articleid = '0'", array(':rid' => $this->rule));
     $reply = pdo_fetchall("SELECT * FROM " . tablename('xc_article_article_reply') . " WHERE rid = :rid", array(':rid' => $this->rule));
     if (!empty($reply)) {
         foreach ($reply as $row) {
             $ids[$row['articleid']] = $row['articleid'];
         }
         $article = pdo_fetchall("SELECT id, title, thumb, content, description, linkurl FROM " . tablename('xc_article_article') . " WHERE id IN (" . implode(',', $ids) . ")", array(), 'id');
     }
     if ($isfill && ($count = 8 - count($reply)) > 0) {
         $articlefill = pdo_fetchall("SELECT id, title, thumb, content, description, linkurl FROM " . tablename('xc_article_article') . " WHERE weid = '{$_W['weid']}' AND id NOT IN (" . implode(',', $ids) . ") ORDER BY id DESC LIMIT {$count}", array(), 'id');
         if (!empty($articlefill)) {
             foreach ($articlefill as $row) {
                 $article[$row['id']] = $row;
                 $reply[]['articleid'] = $row['id'];
             }
             unset($articlefill);
         }
     }
     if (!empty($reply)) {
         $response = array();
         foreach ($reply as $row) {
             $row = $article[$row['articleid']];
             if (!empty($row)) {
                 $response[] = array('title' => htmlspecialchars_decode($row['title']), 'description' => htmlspecialchars_decode($row['description']), 'picurl' => $row['thumb'], 'url' => $this->buildSiteUrl($this->createMobileUrl('detail', array('id' => $row['id'], 'shareby' => $from_user, 'track_type' => 'click', 'linkurl' => $row['linkurl']))));
             }
         }
     }
     return $this->respNews($response);
 }
开发者ID:eduNeusoft,项目名称:weixin,代码行数:34,代码来源:processor.php


示例13: site_article

function site_article($params = array())
{
    global $_GPC, $_W;
    extract($params);
    $pindex = max(1, intval($_GPC['page']));
    $psize = 20;
    $result = array();
    $condition = " WHERE weid = '{$_W['weid']}'";
    if (!empty($cid)) {
        $category = pdo_fetch("SELECT parentid FROM " . tablename('article_category') . " WHERE id = '{$cid}'");
        if (!empty($category['parentid'])) {
            $condition .= " AND ccate = '{$cid}'";
        } else {
            $condition .= " AND pcate = '{$cid}'";
        }
    }
    if ($iscommend == 'true') {
        $condition .= " AND iscommend = '1'";
    }
    if ($ishot == 'true') {
        $condition .= " AND ishot = '1'";
    }
    $sql = "SELECT * FROM " . tablename('article') . $condition . ' ORDER BY id DESC';
    $result['list'] = pdo_fetchall($sql . " LIMIT " . ($pindex - 1) * $psize . ',' . $psize);
    $total = pdo_fetchcolumn('SELECT COUNT(*) FROM ' . tablename('article') . $condition);
    $result['pager'] = pagination($total, $pindex, $psize);
    if (!empty($result['list'])) {
        foreach ($result['list'] as &$row) {
            $row['url'] = create_url('mobile/module/detail', array('name' => 'site', 'id' => $row['id'], 'weid' => $_W['weid']));
        }
    }
    return $result;
}
开发者ID:yunsite,项目名称:my-we7,代码行数:33,代码来源:model.php


示例14: cache_read

/**
 * 取出缓存的单条数据
 * @param 缓存键名,多个层级或分组请使用:隔开
 * @return mixed
 */
function cache_read($key) {
	$sql = 'SELECT `value` FROM ' . tablename('cache') . ' WHERE `key`=:key';
	$params = array();
	$params[':key'] = $key;
	$val = pdo_fetchcolumn($sql, $params);
	return iunserializer($val);
}
开发者ID:royalwang,项目名称:saivi,代码行数:12,代码来源:cache.mysql.func.php


示例15: doWebList

 public function doWebList()
 {
     global $_GPC, $_W;
     $uniacid = $_W["uniacid"];
     $pindex = max(1, intval($_GPC['page']));
     $psize = 20;
     $where = "";
     $mark = $_GPC['mark'];
     $keyword = $_GPC['keyword'];
     if (!empty($mark)) {
         $where .= " AND mark = '{$mark}'";
     }
     if (!empty($keyword)) {
         $where .= " AND title like '%{$keyword}%'";
     }
     if (!empty($_GPC['Deleteall']) && !empty($_GPC['select'])) {
         foreach ($_GPC['select'] as $k => $v) {
             pdo_delete('hx_dialect_questions', array('id' => $v, 'uniacid' => $_W['uniacid']));
         }
         message('成功删除选中的防伪码!', referer(), 'success');
     }
     if (!empty($_GPC['Frozenall']) && !empty($_GPC['select'])) {
         foreach ($_GPC['select'] as $k => $v) {
             pdo_update('securitys_data', array('status' => 0), array('id' => $v, 'uniacid' => $_W['uniacid']));
         }
         message('成功冻结选中的防伪码!', referer(), 'success');
     }
     $list = pdo_fetchall("SELECT *  from " . tablename('hx_dialect_questions') . " where uniacid='{$uniacid}' {$where} order by id asc LIMIT " . ($pindex - 1) * $psize . ',' . $psize);
     $total = pdo_fetchcolumn("SELECT COUNT(*)  from " . tablename('hx_dialect_questions') . " where uniacid='{$uniacid}' {$where} order by id asc");
     $pager = pagination($total, $pindex, $psize);
     load()->func('tpl');
     include $this->template('list');
 }
开发者ID:aspnmy,项目名称:weizan,代码行数:33,代码来源:site.php


示例16: getShowID

 private function getShowID()
 {
     global $_W;
     $sql = 'select showID from ' . tablename('ice_picWallMain') . ' where uniacid = :uniacid order by showID DESC';
     $result = pdo_fetchcolumn($sql, array('uniacid' => $_W['uniacid']), 0) + 1;
     return $result;
 }
开发者ID:wisemyth,项目名称:weizan,代码行数:7,代码来源:processor.php


示例17: doMobileIndex

 public function doMobileIndex()
 {
     global $_W, $_GPC;
     checkauth();
     $fromuser = fans_require($_W['fans']['from_user'], array('nickname', 'mobile'), '需要完善资料后才能玩.');
     $rid = $_GPC['rid'];
     $follow = fans_search($_W['fans']['from_user'], array('follow'));
     if ($follow['follow'] == 1) {
         if (intval($_GPC['id'])) {
             $score = pdo_fetchcolumn("select score from" . tablename('bj_tgame_user') . "where rid =" . $rid . ".and from_user ='" . $fromuser['from_user'] . "'");
             if ($score < $_GPC['score']) {
                 $update = array('score' => $_GPC['score'], 'realname' => $fromuser['nickname']);
                 $score = $_GPC['score'];
                 pdo_update('bj_tgame_user', $update, array('id' => $_GPC['id'], 'weid' => $_W['weid']));
             }
             message($score, '', 'ajax');
         }
         $from_user = pdo_fetch("select id from_user, rid from" . tablename('bj_tgame_user') . "where from_user ='" . $fromuser['from_user'] . "'");
         if (empty($from_user['from_user'])) {
             $insert = array('id' => $_GPC['id'], 'weid' => $_W['weid'], 'rid' => $rid, 'from_user' => $fromuser['from_user'], 'realname' => $fromuser['nickname'], 'score' => 0);
             pdo_insert('bj_tgame_user', $insert);
         }
         //$from_user = pdo_fetch("select id, rid from".tablename('bj_tgame_user')."where from_user ='".$fromuser['from_user']. "'");
         if ($from_user['rid'] != $rid) {
             $update = array('rid' => $rid);
             pdo_update('bj_tgame_user', $update, array('id' => $from_user['id']));
         }
         $realname = $fromuser['nickname'];
         $user = pdo_fetch("select * from" . tablename('bj_tgame_user') . "where rid =" . $rid . ".and from_user ='" . $fromuser['from_user'] . "'");
     }
     $set = pdo_fetch("select * from" . tablename('bj_tgame_reply') . "where rid =" . $rid);
     include $this->template('index');
 }
开发者ID:alextiannus,项目名称:wormwood_wechat,代码行数:33,代码来源:site.php


示例18: doWebDisplay

 public function doWebDisplay()
 {
     global $_W, $_GPC;
     if (empty($_GPC['do'])) {
         $_GPC['do'] = 'display';
     }
     $pindex = max(1, intval($_GPC['page']));
     $psize = 20;
     $condition = '';
     if (!empty($_GPC['keyword'])) {
         $condition .= " AND title LIKE '%{$_GPC['keyword']}%'";
     }
     if (is_array($_GPC['industry'])) {
         if (!empty($_GPC['industry']['parent'])) {
             $condition .= " AND industry1 = '{$_GPC['industry']['parent']}'";
         }
         if (!empty($_GPC['industry']['child'])) {
             $condition .= " AND industry2 = '{$_GPC['industry']['child']}'";
         }
     }
     $list = pdo_fetchall("SELECT * FROM " . tablename('business') . " WHERE weid = '{$_W['weid']}' {$condition} ORDER BY id DESC LIMIT " . ($pindex - 1) * $psize . ',' . $psize);
     $total = pdo_fetchcolumn('SELECT COUNT(*) FROM ' . tablename('business') . " WHERE weid = '{$_W['weid']}' {$condition}");
     $pager = pagination($total, $pindex, $psize);
     include $this->template('display');
 }
开发者ID:6662680,项目名称:qday_wx,代码行数:25,代码来源:site.php


示例19: all_list

 public function all_list($params = array())
 {
     global $_GPC, $_W;
     extract($params);
     $result = array();
     $pindex = max(1, intval($_GPC['page']));
     $psize = $psize ? $psize : '20';
     $where = "WHERE `uniacid` = :uniacid AND ischeck=:ischeck";
     $paras = array();
     $paras[':uniacid'] = $_W['uniacid'];
     $paras[':ischeck'] = intval($ischeck);
     $sql = "SELECT * FROM " . tablename('qiyue_canvas') . $where . ' ORDER BY createtime DESC, id DESC';
     $result['list'] = pdo_fetchall($sql . " LIMIT " . ($pindex - 1) * $psize . ',' . $psize, $paras);
     $total = pdo_fetchcolumn('SELECT COUNT(*) FROM ' . tablename('qiyue_canvas') . $where, $paras);
     if ($_W['isajax']) {
         $context['ajaxcallback'] = 1;
         $result['pager'] = pagination($total, $pindex, $psize, '', $context);
     } else {
         $result['pager'] = pagination($total, $pindex, $psize);
     }
     if (!empty($result['list'])) {
         foreach ($result['list'] as &$row) {
             $row['url'] = url('mobile/module/index', array('name' => 'site', 'id' => $row['id'], 'weid' => $_W['weid']));
         }
     }
     return $result;
 }
开发者ID:keycoolkui,项目名称:weixinfenxiao,代码行数:27,代码来源:site.php


示例20: receive

 public function receive()
 {
     global $_W, $_GPC;
     $type = $this->message['type'];
     $uniacid = $_W['uniacid'];
     $acid = $_W['acid'];
     $openid = $this->message['from'];
     $event = $this->message['event'];
     $cfg = $this->module['config'];
     file_put_contents(IA_ROOT . '/addons/fm_photosvote/test/fm_test.txt', iserializer($event));
     if ($event == 'unsubscribe') {
         $record = array('updatetime' => TIMESTAMP, 'follow' => '0', 'unfollowtime' => TIMESTAMP);
         pdo_update('mc_mapping_fans', $record, array('openid' => $openid, 'acid' => $acid, 'uniacid' => $uniacid));
         if ($cfg['isopenjsps']) {
             $fmvotelog = pdo_fetchall("SELECT tfrom_user FROM " . tablename('fm_photosvote_votelog') . " WHERE from_user = :from_user and uniacid = :uniacid LIMIT 1", array(':from_user' => $openid, ':uniacid' => $uniacid));
             foreach ($fmvotelog as $log) {
                 $fmprovevote = pdo_fetch("SELECT photosnum,hits FROM " . tablename('fm_photosvote_provevote') . " WHERE from_user = :from_user and uniacid = :uniacid LIMIT 1", array(':from_user' => $log['tfrom_user'], ':uniacid' => $uniacid));
                 pdo_update('fm_photosvote_provevote', array('lasttime' => TIMESTAMP, 'photosnum' => $fmprovevote['photosnum'] - 1, 'hits' => $fmprovevote['hits'] - 1), array('from_user' => $log['tfrom_user'], 'uniacid' => $uniacid));
             }
             pdo_delete('fm_photosvote_votelog', array('from_user' => $openid));
             pdo_delete('fm_photosvote_bbsreply', array('from_user' => $openid));
         }
     } elseif ($event == 'subscribe') {
         if ($cfg['oauthtype'] == 2) {
             $wechats = pdo_fetch("SELECT * FROM " . tablename('account_wechats') . " WHERE uniacid = :uniacid ", array(':uniacid' => $_W['uniacid']));
             $token = iunserializer($wechats['access_token']);
             $arrlog = pdo_fetch("SELECT * FROM " . tablename('mc_mapping_fans') . " WHERE uniacid = :uniacid AND openid = :openid", array(':uniacid' => $_W['uniacid'], ':openid' => $openid));
             $access_token = $token['token'];
             $expire = $token['expire'];
             if (time() >= $expire || empty($access_token)) {
                 $url = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=" . $wechats['key'] . "&secret=" . $wechats['secret'];
                 $html = file_get_contents($url);
                 $arr = json_decode($html, true);
                 $access_token = $arr['access_token'];
                 $record = array();
                 $record['token'] = $access_token;
                 $record['expire'] = time() + 3600;
                 $row = array();
                 $row['access_token'] = iserializer($record);
                 pdo_update('account_wechats', $row, array('uniacid' => $_W['uniacid']));
             }
             $url = "https://api.weixin.qq.com/cgi-bin/user/info?access_token=" . $access_token . "&openid=" . $openid . "&lang=zh_CN";
             $html = file_get_contents($url);
             $re = @json_decode($html, true);
             if (!empty($arrlog)) {
                 $data = array('nickname' => $re['nickname'], 'unionid' => $re['unionid']);
                 pdo_update('mc_mapping_fans', $data, array('openid' => $openid));
             } else {
                 $default_groupid = pdo_fetchcolumn('SELECT groupid FROM ' . tablename('mc_groups') . ' WHERE uniacid = :uniacid AND isdefault = 1', array(':uniacid' => $_W['uniacid']));
                 $nickname = $re['nickname'];
                 $data = array('uniacid' => $_W['uniacid'], 'nickname' => $re['nickname'], 'avatar' => $re['headimgurl'], 'groupid' => $default_groupid, 'createtime' => TIMESTAMP);
                 pdo_insert('mc_members', $data);
                 $id = pdo_insertid();
                 $data = array('nickname' => $re['nickname'], 'unionid' => $re['unionid'], 'uid' => $id);
                 pdo_update('mc_mapping_fans', $data, array('openid' => $openid));
             }
         }
     }
 }
开发者ID:wisemyth,项目名称:weizan,代码行数:59,代码来源:receiver.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP pdo_fieldexists函数代码示例发布时间:2022-05-15
下一篇:
PHP pdo_fetchall函数代码示例发布时间: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