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


PHP pdo_fetchcolumn函数代码示例

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


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


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