本文整理汇总了PHP中tablename函数的典型用法代码示例。如果您正苦于以下问题:PHP tablename函数的具体用法?PHP tablename怎么用?PHP tablename使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了tablename函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: receive
public function receive()
{
global $_W;
$type = $this->message['type'];
//这里定义此模块进行消息订阅时的, 消息到达以后的具体处理过程, 请查看WORMWOOD文档来编写你的代码
if ($type != "text" && $type != "image" && $type != "voice") {
return;
}
$file = IA_ROOT . '/source/modules/mechat/function.php';
if (!file_exists($file)) {
return array();
}
include_once $file;
$sql = "SELECT * FROM " . tablename($this->tablename) . " WHERE `weid`=:weid";
$row = pdo_fetch($sql, array(':weid' => $_W['weid']));
if ($row) {
$pdata = array("ToUserName" => $this->message['tousername'], "FromUserName" => $this->message['fromusername'], "CreateTime" => $this->message['createtime'], "MsgType" => $this->message['msgtype'], "Content" => $this->message['content'], "MsgId" => $this->message['msgid']);
if ($type == "voice") {
$pdata["MsgType"] = "text";
$pdata["Content"] = "系统:微信公众号粉丝发送语音消息,系统暂不能接收请客服处理。";
}
$dat = array('unit' => $row["name"], 'msg' => json_encode($pdata));
$dat2 = iunserializer($row["cdata"]);
$actoken = account_mechat_token(array("weid" => $_W['weid'], "access_token" => $dat2["access_token"], "appid" => $dat2["appid"], "appsecret" => $dat2["appsecret"]));
$url = sprintf($this->gateway['mechat_receive'], $actoken);
$content = ihttp_post($url, $dat);
}
}
开发者ID:alextiannus,项目名称:wormwood_wechat,代码行数:28,代码来源:receiver.php
示例2: respond
public function respond()
{
global $_W;
$content = $this->message['content'];
$reply = pdo_fetch('SELECT * FROM ' . tablename('cover_reply') . ' WHERE `rid`=:rid', array(':rid' => $this->rule));
if (!empty($reply)) {
load()->model('module');
$module = module_fetch($reply['module']);
if (empty($module) && !in_array($reply['module'], array('site', 'mc', 'card'))) {
return '';
}
$url = $reply['url'];
if (empty($reply['url'])) {
$entry = pdo_fetch("SELECT eid FROM " . tablename('modules_bindings') . " WHERE module = :module AND do = :do", array(':module' => $reply['module'], ':do' => $reply['do']));
$url = url('entry', array('eid' => $entry['eid']));
}
if (!strexists($url, '&j=') && !empty($_W['acid'])) {
$url = str_replace("?i={$_W['uniacid']}&", "?i={$_W['uniacid']}&j={$_W['acid']}&", $url);
}
$news = array();
$news[] = array('title' => $reply['title'], 'description' => $reply['description'], 'picurl' => $reply['thumb'], 'url' => $url);
return $this->respNews($news);
}
return '';
}
开发者ID:6662680,项目名称:qday_wx,代码行数:25,代码来源:processor.php
示例3: respond
public function respond()
{
global $_W;
$content = $this->message['content'];
$foods = pdo_fetchall("SELECT * FROM " . tablename('jufeng_wcy_foods') . " WHERE weid = '{$_W['uniacid']}' AND title LIKE '%{$content}%' ");
$pcate = pdo_fetchall("SELECT * FROM " . tablename('jufeng_wcy_category') . " WHERE weid = '{$_W['uniacid']}' AND parentid = '0' AND name LIKE '%{$content}%' ");
$news[] = array('title' => '在线订餐', 'description' => '方便快捷,价格优惠', 'picurl' => '../addons/jufeng_wcy/images/dc.jpg', 'url' => $this->createMobileUrl('dianjia'));
$foodsnum = count($foods);
$pcatenum = count($pcate);
if ($foodsnum == 0 && $pcatenum == 0) {
$news[] = array('title' => '直接回复你想吃的,可搜索菜品和餐馆哦');
$news[] = array('title' => '没有关于【' . $content . '】的菜品或餐馆');
}
if ($pcatenum < 9) {
$printnum = $pcatenum;
} else {
$printnum = 9;
}
for ($i = 0; $i < $printnum; $i++) {
$news[] = array('title' => "【" . $pcate[$i]['name'] . "】——" . "热度:" . $pcate[$i]['total'], 'description' => "", 'picurl' => $_W['attachurl'] . $pcate[$i]['thumb'], 'url' => $this->createMobileUrl('list', array('pcate' => $pcate[$i]['id'])));
}
$printnum = 9 - $printnum;
if ($foodsnum < $printnum) {
$printnum = $foodsnum;
}
for ($i = 0; $i < $printnum; $i++) {
$dianjia = pdo_fetch("SELECT * FROM " . tablename('jufeng_wcy_category') . " WHERE weid = '{$_W['uniacid']}' AND id = '{$foods[$i]['pcate']}'");
$news[] = array('title' => "【" . $foods[$i]['title'] . "】——" . $dianjia['name'], 'description' => "菜品热度:" . $foods[$i]['hits'], 'picurl' => $_W['attachurl'] . $foods[$i]['thumb'], 'url' => $this->createMobileUrl('list', array('pcate' => $foods[$i]['pcate'])));
}
return $this->respNews($news);
}
开发者ID:6662680,项目名称:qday_wx,代码行数:31,代码来源:processor.php
示例4: fieldsFormDisplay
public function fieldsFormDisplay($rid = 0)
{
//要嵌入规则编辑页的自定义内容,这里 $rid 为对应的规则编号,新增时为 0
global $_W;
$reply = pdo_fetch("SELECT * FROM " . tablename('game2048_reply') . " WHERE rid = :rid", array(':rid' => $rid));
include $this->template('form');
}
开发者ID:alextiannus,项目名称:wormwood_wechat,代码行数:7,代码来源:module.php
示例5: site_category
function site_category($params = array())
{
global $_GPC, $_W;
extract($params);
if (!isset($parentid)) {
$condition = "";
} else {
$condition = " AND parentid = '{$parentid}'";
}
$category = array();
$result = pdo_fetchall("SELECT * FROM " . tablename('article_category') . " WHERE weid = '{$_W['weid']}' {$condition} ORDER BY parentid ASC, displayorder ASC, id ASC ");
if (!isset($parentid)) {
if (!empty($result)) {
foreach ($result as $row) {
if (empty($row['parentid'])) {
$category[$row['id']] = $row;
} else {
$category[$row['parentid']]['children'][$row['id']] = $row;
}
}
}
} else {
$category = $result;
}
return $category;
}
开发者ID:yunsite,项目名称:my-we7,代码行数:26,代码来源:model.php
示例6: respond
public function respond() {
global $_W;
$rid = $this->rule;
$sql = "SELECT id FROM " . tablename('news_reply') . " WHERE `rid`=:rid AND parentid = 0 ORDER BY RAND()";
$main = pdo_fetch($sql, array(':rid' => $rid));
if (empty($main['id'])) {
return array();
}
$sql = "SELECT * FROM " . tablename('news_reply') . " WHERE id = :id OR parentid = :parentid ORDER BY parentid ASC, id ASC LIMIT 8";
$commends = pdo_fetchall($sql, array(':id'=>$main['id'], ':parentid'=>$main['id']));
$news = array();
foreach($commends as $c) {
$row = array();
$row['title'] = $c['title'];
$row['description'] = $c['description'];
!empty($c['thumb']) && $row['picurl'] = $_W['attachurl'] . trim($c['thumb'], '/');
$row['url'] = empty($c['url']) ? $_W['siteroot'] . create_url('index/module', array('do' => 'detail', 'name' => 'news', 'id' => $c['id'])) : $c['url'];
$news[] = $row;
}
$r['FromUserName'] = $this->message['to'];
$r['ToUserName'] = $this->message['from'];
$r['MsgType'] = 'news';
$r['ArticleCount'] = count($news);
$r['Articles'] = array();
foreach ($news as $row) {
$r['Articles'][] = array(
'Title' => $row['title'],
'Description' => $row['description'],
'PicUrl' => $row['picurl'],
'Url' => $row['url'],
'TagName' => 'item',
);
}
return $r;
}
开发者ID:royalwang,项目名称:saivi,代码行数:35,代码来源:processor.php
示例7: 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('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 displayorder DESC, 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/hdetail', array('name' => 'shouse', 'id' => $row['id'], 'weid' => $_W['weid']));
}
}
return $result;
}
开发者ID:alextiannus,项目名称:wormwood_wechat,代码行数:33,代码来源:model.php
示例8: getMember
private function getMember()
{
global $_W;
$sql = 'SELECT `lastupdate`, `isblacklist`, `rid` FROM ' . tablename('wxwall_members') . ' WHERE `from_user` =
:from_user AND `rid` = :rid';
$params = array(':from_user' => $_W['openid'], ':rid' => $this->rule);
$member = pdo_fetch($sql, $params);
// 获取粉丝头像
$account = WeAccount::create($_W['acid']);
$fansInfo = $account->fansQueryInfo($_W['openid']);
if (empty($member)) {
$member = array('from_user' => $_W['openid'], 'rid' => $this->rule, 'isjoin' => 1, 'lastupdate' => TIMESTAMP, 'isblacklist' => 0);
if (!is_error($fansInfo)) {
$member['avatar'] = rtrim($fansInfo['headimgurl'], '0') . '132';
}
pdo_insert('wxwall_members', $member);
} else {
if (!is_error($fansInfo)) {
$member['avatar'] = rtrim($fansInfo['headimgurl'], '0') . '132';
}
$member['lastupdate'] = TIMESTAMP;
$params = array('from_user' => $_W['openid'], 'rid' => $this->rule);
pdo_update('wxwall_members', $member, $params);
}
return $member;
}
开发者ID:aspnmy,项目名称:weizan,代码行数:26,代码来源:processor.php
示例9: respond
public function respond()
{
global $_W;
$content = $this->message['content'];
//这里定义此模块进行消息处理时的具体过程, 请查看WORMWOOD文档来编写你的代码
$isfill = pdo_fetchcolumn("SELECT isfill FROM " . tablename('feng_testingreply') . " WHERE rid =:rid AND testingid = '0'", array(':rid' => $this->rule));
$reply = pdo_fetchall("SELECT * FROM " . tablename('feng_testingreply') . " WHERE rid = :rid", array(':rid' => $this->rule));
if (!empty($reply)) {
foreach ($reply as $row) {
$ids[$row['testingid']] = $row['testingid'];
}
$article = pdo_fetchall("SELECT id,title,photo,smalltext FROM " . tablename('feng_testing') . " WHERE id IN (" . implode(',', $ids) . ")", array(), 'id');
}
if ($isfill && ($count = 8 - count($reply)) > 0) {
$articlefill = pdo_fetchall("SELECT id,title,photo,smalltext FROM " . tablename('feng_testing') . " 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[]['testingid'] = $row['id'];
}
unset($articlefill);
}
}
if (!empty($reply)) {
$response = array();
foreach ($reply as $row) {
$row = $article[$row['testingid']];
if (!empty($row)) {
$response[] = array('title' => $row['title'], 'description' => $row['description'], 'picurl' => $row['thumb'], 'url' => $this->buildSiteUrl($this->createMobileUrl('detail', array('id' => $row['id']))));
}
}
}
return $this->respNews($response);
}
开发者ID:alextiannus,项目名称:wormwood_wechat,代码行数:34,代码来源:processor.php
示例10: __buildSiteUrl
function __buildSiteUrl($url)
{
global $_W, $engine;
$mapping = array('[from]' => $engine->message['from'], '[to]' => $engine->message['to'], '[uniacid]' => $_W['uniacid']);
$url = str_replace(array_keys($mapping), array_values($mapping), $url);
$pass = array();
$pass['openid'] = $engine->message['from'];
$pass['acid'] = $_W['acid'];
$sql = 'SELECT `fanid`,`salt`,`uid` FROM ' . tablename('mc_mapping_fans') . ' WHERE `acid`=:acid AND `openid`=:openid';
$params = array();
$params[':acid'] = $_W['acid'];
$params[':openid'] = $pass['openid'];
$fan = pdo_fetch($sql, $params);
if (empty($fan) || !is_array($fan) || empty($fan['salt'])) {
$fan = array('salt' => '');
}
$pass['time'] = TIMESTAMP;
$pass['hash'] = md5("{$pass['openid']}{$pass['time']}{$fan['salt']}{$_W['config']['setting']['authkey']}");
$auth = base64_encode(json_encode($pass));
$vars = array();
$vars['uniacid'] = $_W['uniacid'];
$vars['__auth'] = $auth;
$vars['forward'] = base64_encode($url);
return $_W['siteroot'] . 'app/' . url('auth/forward', $vars);
}
开发者ID:zhang19960118,项目名称:html11,代码行数:25,代码来源:common.func.php
示例11: 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
示例12: reply_kaquanDetail
private function reply_kaquanDetail($card_id)
{
$sql = "SELECT card_detail FROM " . tablename($this->tb_cards) . " WHERE card_id = :card_id";
$param[':card_id'] = $card_id;
$card_detail = pdo_fetch($sql, $param);
return $card_detail['card_detail'];
}
开发者ID:hanxiansen,项目名称:vh_xiaoka,代码行数:7,代码来源:processor.php
示例13: fieldsFormSubmit
public function fieldsFormSubmit($rid)
{
global $_GPC, $_W;
$id = intval($_GPC['reply_id']);
$insert = array('rid' => $rid, 'weid' => $this->weid, 'title' => $_GPC['title'], 'kptime' => strtotime($_GPC['kptime']), 'rztime' => strtotime($_GPC['rztime']), 'kfs' => $_GPC['kfs'], 'price' => $_GPC['price'], 'lpaddress' => $_GPC['lpaddress'], 'sltel' => $_GPC['sltel'], 'zxtel' => $_GPC['zxtel'], 'news_title' => $_GPC['news_title'], 'news_icon' => $_GPC['news_icon'], 'news_content' => $_GPC['news_content'], 'share_title' => $_GPC['share_title'], 'share_icon' => $_GPC['share_icon'], 'share_content' => $_GPC['share_content'], 'order_title' => $_GPC['order_title'], 'order_remark' => $_GPC['order_remark'], 'cover_img' => $_GPC['cover_img'], 'overview_img' => $_GPC['overview_img'], 'intro_img' => $_GPC['intro_img'], 'dt_img' => $_GPC['dt_img'], 'dt_intro' => htmlspecialchars_decode($_GPC['dt_intro']), 'intro' => htmlspecialchars_decode($_GPC['intro']), 'createtime' => TIMESTAMP);
if (empty($id)) {
$id = pdo_insert($this->table_hosue, $insert);
} else {
pdo_update($this->table_hosue, $insert, array('id' => $id));
}
///说明项处理
$house_ids = $_GPC['house_ids'];
$house_names = $_GPC['house_iname'];
$house_conents = $_GPC['house_icontent'];
$house_sorts = $_GPC['house_sort'];
pdo_query("delete from " . tablename($this->table_house_item) . " where hid=:hid", array(":hid" => $id));
if (is_array($house_ids)) {
foreach ($house_ids as $key => $value) {
$value = intval($value);
$d = array("rid" => $rid, "hid" => $id, "iname" => $house_names[$key], "icontent" => $house_conents[$key], "sort" => $house_sorts[$key]);
pdo_insert($this->table_house_item, $d);
}
}
return true;
}
开发者ID:aspnmy,项目名称:weizan,代码行数:25,代码来源:module.php
示例14: respond
public function respond()
{
global $_W;
load()->func('compat.biz');
$rid = $this->rule;
$sql = "SELECT * FROM " . tablename('bm_top_reply') . " WHERE `rid`=:rid LIMIT 1";
$row = pdo_fetch($sql, array(':rid' => $rid));
if (empty($row['id'])) {
return $this->respText("系统升级中,请稍候!");
}
$desc = $row['desc'];
//描述
$n = $row['n'];
//粉丝基数
$fromuser = $this->message['from'];
$num = mc_fansinfo($fromuser);
$numx = $n + $num['fanid'];
$name = $_W['account']['name'];
//公众号名称
$str = str_replace('{name}', $name, $desc);
$str = str_replace('{numx}', $numx, $str);
if ($row['pictype'] == 1) {
//$str = "嗨,欢迎关注【".$name."】,您是第".$numx."位关注人!\n".$desc."\n <a href='".$url."'>".$urltext."</a>";
return $this->respText($str);
} else {
$response['FromUserName'] = $this->message['to'];
$response['ToUserName'] = $this->message['from'];
$response['MsgType'] = 'news';
$response['ArticleCount'] = 1;
$response['Articles'] = array();
$response['Articles'][] = array('Title' => $row['title'], 'Description' => $str, 'PicUrl' => !strexists($row['picurl'], 'http://') ? $_W['attachurl'] . $row['picurl'] : $row['picurl'], 'Url' => $row['urlx'], 'TagName' => 'item');
return $response;
}
}
开发者ID:ChainBoy,项目名称:wxfx,代码行数:34,代码来源:processor.php
示例15: getCategory
public function getCategory()
{
global $_W;
$shopset = m('common')->getSysset('shop');
$allcategory = array();
$category = pdo_fetchall("SELECT * FROM " . tablename('ewei_shop_category') . " WHERE uniacid=:uniacid and enabled=1 ORDER BY parentid ASC, displayorder DESC", array(':uniacid' => $_W['uniacid']));
$category = set_medias($category, array('thumb', 'advimg'));
foreach ($category as $c) {
if (empty($c['parentid'])) {
$children = array();
foreach ($category as $c1) {
if ($c1['parentid'] == $c['id']) {
if (intval($shopset['catlevel']) == 3) {
$children2 = array();
foreach ($category as $c2) {
if ($c2['parentid'] == $c1['id']) {
$children2[] = $c2;
}
}
$c1['children'] = $children2;
}
$children[] = $c1;
}
}
$c['children'] = $children;
$allcategory[] = $c;
}
}
return $allcategory;
}
开发者ID:ChainBoy,项目名称:wxfx,代码行数:30,代码来源:shop.php
示例16: doMobileshow
public function doMobileshow()
{
global $_W, $_GPC;
$rid = $_GPC['id'];
$sql = "SELECT * FROM " . tablename($this->tablename_log) . " WHERE `rid`=:rid";
$info = pdo_fetchall($sql, array(':rid' => $rid));
$sql = "SELECT * FROM " . tablename($this->tablename) . " WHERE `rid`=:rid LIMIT 1";
$quiz = pdo_fetch($sql, array(':rid' => $rid));
$sql = "SELECT * FROM " . tablename($this->tablename_question) . " WHERE `id`=:id";
$q = pdo_fetch($sql, array(':id' => $quiz['qid']));
//var_dump($q);
$arr = array();
foreach ($info as $key => $value) {
$arr[] = $info[$key]['chk_answer'];
}
$per = array_count_values($arr);
ksort($per);
//var_dump($per);
$total_count = sizeof($info);
$config = $this->get_config($q);
//foreach($per as $key => $value){
//$str .= '选项'.$key.'次数'.$value;
//}
//var_dump($str);
//var_dump($per);
include $this->template('show');
}
开发者ID:alextiannus,项目名称:wormwood_wechat,代码行数:27,代码来源:site.php
示例17: 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
示例18: getGroupName
public function getGroupName($uid = 0)
{
$uid = $uid ?: v('user.uid');
$sql = "SELECT title,id FROM " . tablename('member') . " m JOIN " . tablename('member_group') . " g ON m.group_id = g.id WHERE m.uid={$uid}";
$d = Db::query($sql);
return $d ? $d[0] : NULL;
}
开发者ID:houdunwang,项目名称:hdcms,代码行数:7,代码来源:Member.php
示例19: member_single
/**
* 获取单条用户信息,如果查询参数多于一个字段,则查询满足所有字段的用户
* PS:密码字段不要加密
* @param array $member 要查询的用户字段,可以包括 uid, username, password, status
* @param bool 是否要同时获取状态信息
* @return array 完整的用户信息
*/
function member_single($member)
{
$sql = 'SELECT * FROM ' . tablename('members') . " WHERE 1";
$params = array();
if (!empty($member['uid'])) {
$sql .= ' AND `uid`=:uid';
$params[':uid'] = intval($member['uid']);
}
if (!empty($member['username'])) {
$sql .= ' AND `username`=:username';
$params[':username'] = $member['username'];
}
if (!empty($member['email'])) {
$sql .= ' AND `email`=:email';
$params[':email'] = $member['email'];
}
if (!empty($member['status'])) {
$sql .= " AND `status`=:status";
$params[':status'] = intval($member['status']);
}
$sql .= " LIMIT 1";
$record = pdo_fetch($sql, $params);
if (!$record) {
return false;
}
if (!empty($member['password'])) {
$password = member_hash($member['password'], $record['salt']);
if ($password != $record['password']) {
return false;
}
}
return $record;
}
开发者ID:yunsite,项目名称:my-we7,代码行数:40,代码来源:member.mod.php
示例20: doWebWelcome
public function doWebWelcome()
{
global $_W;
$sql = 'select pretype,count(*) as num from ' . tablename('chips');
$sql .= ' where projguid=:projguid and deleted=0 group by pretype ';
$cnt = pdo_fetchall($sql, array(':projguid' => $_W['project']['projguid']), 'pretype');
$status = array(0 => '登记', 1 => '付款', 2 => '无交款');
$count = array(0 => 0);
foreach ($status as $k => $v) {
$count[$k + 1] = 0;
if (isset($cnt[$k])) {
$count[$k + 1] = $cnt[$k]['num'];
}
$count[0] += $count[$k];
}
// 诚意金统计
$sql = "select count(*) as num, sum(premoney) as total from " . tablename('chips');
$sql .= ' where premoney>0 and projguid=:projguid and deleted=0';
$premoney = pdo_fetch($sql, array(':projguid' => $_W['project']['projguid']));
// 认购统计
$sql = "select count(*) as num, coalesce(SUM(ordermoney),0) as total from " . tablename('chips');
$sql .= ' where ordermoney>0 and projguid=:projguid and deleted=0';
$ordermoney = pdo_fetch($sql, array(':projguid' => $_W['project']['projguid']));
include $this->template('welcome');
}
开发者ID:ruige123456,项目名称:dataMining,代码行数:25,代码来源:site.php
注:本文中的tablename函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论