本文整理汇总了PHP中mysqld_selectall函数的典型用法代码示例。如果您正苦于以下问题:PHP mysqld_selectall函数的具体用法?PHP mysqld_selectall怎么用?PHP mysqld_selectall使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了mysqld_selectall函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: updateOrderStock
function updateOrderStock($id, $minus = true)
{
$ordergoods = mysqld_selectall("SELECT * FROM " . table('shop_order_goods') . " WHERE orderid='{$id}'");
foreach ($ordergoods as $item) {
$goods = mysqld_select("SELECT * FROM " . table('shop_goods') . " WHERE id='" . $item['goodsid'] . "'");
if ($minus) {
//属性
if (!empty($item['optionid'])) {
mysqld_query("update " . table('shop_goods_option') . " set stock=stock-:stock where id=:id", array(":stock" => $item['total'], ":id" => $item['optionid']));
}
$data = array();
if ($goods['totalcnf'] != 1) {
$data['total'] = $goods['total'] - $item['total'];
}
$data['sales'] = $goods['sales'] + $item['total'];
mysqld_update('shop_goods', $data, array('id' => $item['goodsid']));
} else {
//属性
if (!empty($item['optionid'])) {
mysqld_query("update " . table('shop_goods_option') . " set stock=stock+:stock where id=:id", array(":stock" => $item['total'], ":id" => $item['optionid']));
}
$data = array();
if ($goods['totalcnf'] != 1) {
$data['total'] = $goods['total'] + $item['total'];
}
$data['sales'] = $goods['sales'] - $item['total'];
mysqld_update('shop_goods', $data, array('id' => $item['goodsid']));
}
}
}
示例2: setOrderCredit
public function setOrderCredit($openid, $id, $minus = true, $remark = '')
{
$order = mysqld_selectall("SELECT * FROM " . table('shop_order') . " WHERE id='{$id}'");
if (!empty($order['credit'])) {
if ($minus) {
member_credit($openid, $order['credit'], 'addcredit', $remark);
} else {
member_credit($openid, $order['credit'], 'usecredit', $remark);
}
}
}
示例3: mysqld_selectcolumn
if ($rule['keywords'] != $_GP['keywords']) {
$count = mysqld_selectcolumn('SELECT count(id) FROM ' . table('weixin_rule') . " WHERE keywords = :keywords", array(':keywords' => $_GP['keywords']));
if ($count > 0) {
message('触发关键字' . $_GP['keywords'] . "已存在!");
}
}
if (!empty($_FILES['thumb']['tmp_name'])) {
file_delete($_GP['thumb_old']);
$upload = file_upload($_FILES['thumb']);
if (is_error($upload)) {
message($upload['message'], '', 'error');
}
$thumb = $upload['path'];
}
$data = array('title' => $_GP['title'], 'ruletype' => $_GP['ruletype'], 'keywords' => $_GP['keywords'], 'description' => $_GP['description'], 'url' => $_GP['url']);
if (!empty($thumb)) {
$data['thumb'] = $thumb;
}
mysqld_update('weixin_rule', $data, array('id' => $_GP['id']));
message('修改成功!', 'refresh', 'success');
}
}
include page('rule_detail');
exit;
}
if ($operation == 'delete' && !empty($_GP['id'])) {
mysqld_delete('weixin_rule', array('id' => $_GP['id']));
message('删除成功!', 'refresh', 'success');
}
$list = mysqld_selectall('SELECT * FROM ' . table('weixin_rule'));
include page('rule');
示例4: mysqld_selectall
<?php
$list = mysqld_selectall("select * from " . table('user'));
include page('listuser');
示例5: table
$sql = $sql . "ALTER TABLE " . table('shop_goods') . " ADD COLUMN `isjingping` int(1) DEFAULT '0' COMMENT '精品';";
}
if (!mysqld_fieldexists('shop_order', 'hasbonus')) {
$sql = $sql . "ALTER TABLE " . table('shop_order') . " ADD COLUMN `hasbonus` int(1) DEFAULT '0' COMMENT '是否使用优惠券';";
}
if (!mysqld_fieldexists('shop_order', 'bonusprice')) {
$sql = $sql . "ALTER TABLE " . table('shop_order') . " ADD COLUMN `bonusprice` decimal(10,2) DEFAULT '0.00' COMMENT '优惠券抵消金额';";
}
if (!mysqld_fieldexists('member_paylog', 'account_fee')) {
$sql = $sql . "ALTER TABLE " . table('member_paylog') . " ADD COLUMN `account_fee` decimal(10,2) NOT NULL COMMENT '账户剩余积分或余额';";
}
mysqld_batch($sql);
clear_theme_cache();
if (intval(SYSTEM_VERSION) <= 20150724) {
mysqld_update('shop_dispatch', array('express' => 'cac'), array('sendtype' => 1, 'express' => ''));
$shop_dispatchs = mysqld_selectall("select * from " . table('shop_dispatch') . " group by express");
foreach ($shop_dispatchs as $shop_dispatch) {
$express_code = $shop_dispatch['express'];
$shop_dispatch_area = mysqld_select("SELECT * FROM " . table('shop_dispatch_area') . " WHERE dispatchid=:dispatchid and provance=:provance and city=:city and area=:area limit 1", array('dispatchid' => $shop_dispatch['id'], 'country' => '中国', 'provance' => $shop_dispatch['provance'], 'city' => $shop_dispatch['city'], 'area' => $shop_dispatch['area']));
if (empty($shop_dispatch_area['id'])) {
mysqld_insert("shop_dispatch_area", array('dispatchid' => $shop_dispatch['id'], 'country' => '中国', 'provance' => $shop_dispatch['provance'], 'city' => $shop_dispatch['city'], 'area' => $shop_dispatch['area']));
}
$dispatch = mysqld_select("SELECT * FROM " . table('dispatch') . " WHERE code=:code limit 1", array(':code' => $express_code));
if (empty($dispatch['id'])) {
if (file_exists(WEB_ROOT . '/system/modules/plugin/dispatch/' . $express_code . '/lang.php')) {
require WEB_ROOT . '/system/modules/plugin/dispatch/' . $express_code . '/lang.php';
$data = array('code' => $express_code, 'name' => $_LANG['dispatch_' . $express_code . '_name'], 'desc' => $_LANG['dispatch_' . $express_code . '_desc'], 'enabled' => '1', 'sendtype' => $_LANG['dispatch_' . $express_code . '_sendtype']);
mysqld_insert('dispatch', $data);
}
}
}
示例6: array
$condition .= " AND isnew = 1";
$sorturl .= "&isnew=1";
}
if (!empty($_GP['ishot'])) {
$condition .= " AND ishot = 1";
$sorturl .= "&ishot=1";
}
if (!empty($_GP['isdiscount'])) {
$condition .= " AND isdiscount = 1";
$sorturl .= "&isdiscount=1";
}
if (!empty($_GP['istime'])) {
$condition .= " AND istime = 1 ";
$sorturl .= "&istime=1";
}
$children = array();
$category = mysqld_selectall("SELECT * FROM " . table('shop_category') . " WHERE deleted=0 and enabled=1 ORDER BY parentid ASC, displayorder DESC", array(), 'id');
foreach ($category as $index => $row) {
if (!empty($row['parentid'])) {
$children[$row['parentid']][$row['id']] = $row;
unset($category[$index]);
}
}
$list = mysqld_selectall("SELECT * FROM " . table('shop_goods') . " WHERE deleted=0 AND status = '1' {$condition} ORDER BY {$sortfield} ");
$total = mysqld_selectcolumn('SELECT COUNT(*) FROM ' . table('shop_goods') . " WHERE deleted=0 AND status = '1' {$condition}");
$pager = pagination($total, $pindex, $psize, $url = '', $context = array('before' => 0, 'after' => 0, 'ajaxcallback' => ''));
$id = $profile['id'];
if ($profile['status'] == 0) {
$profile['flag'] = 0;
}
include themePage('goodlist');
示例7: intval
<?php
$op = $_GP['op'] ? $_GP['op'] : 'display';
$status = intval($_GP['status']);
if ($op == 'display') {
$list = mysqld_selectall("SELECT teller.*,member.realname,member.mobile,member.outgoldinfo FROM " . table('gold_teller') . " teller left join " . table('member') . " member on teller.openid=member.openid where teller.status=:status order by teller.createtime desc", array('status' => $status));
include page('outchargegold');
exit;
}
if ($op == 'post') {
$id = intval($_GP['id']);
if (intval($_GP['tostatus']) == -1) {
$gold_teller = mysqld_select("SELECT teller.* FROM " . table('gold_teller') . " teller where teller.status=0 and id=:id", array(':id' => $id));
if (!empty($gold_teller['openid'])) {
member_gold($gold_teller['openid'], $gold_teller['fee'], 'addgold', '余额审核拒绝后返回账户' . $gold_teller['fee'] . '元');
}
}
mysqld_update('gold_teller', array('status' => intval($_GP['tostatus'])), array('id' => $id));
message("审核完成!", 'refresh', 'success');
}
示例8: elseif
} elseif ($operation == 'default') {
$id = intval($_GP['id']);
mysqld_update('shop_address', array('isdefault' => 0), array('openid' => $openid));
mysqld_update('shop_address', array('isdefault' => 1), array('id' => $id));
message(1, '', 'ajax');
} elseif ($operation == 'detail') {
$id = intval($_GP['id']);
$row = mysqld_select("SELECT id, realname, mobile, province, city, area, address FROM " . table('shop_address') . " WHERE id = :id", array(':id' => $id));
message($row, '', 'ajax');
} elseif ($operation == 'remove') {
$id = intval($_GP['id']);
if (!empty($id)) {
$address = mysqld_select("select isdefault from " . table('shop_address') . " where id='{$id}' and openid='" . $openid . "' limit 1 ");
if (!empty($address)) {
//修改成不直接删除,而设置deleted=1
mysqld_update("shop_address", array("deleted" => 1, "isdefault" => 0), array('id' => $id, 'openid' => $openid));
if ($address['isdefault'] == 1) {
//如果删除的是默认地址,则设置是新的为默认地址
$maxid = mysqld_selectcolumn("select max(id) as maxid from " . table('shop_address') . " where openid='" . $openid . "' limit 1 ");
if (!empty($maxid)) {
mysqld_update('shop_address', array('isdefault' => 1), array('id' => $maxid, 'openid' => $openid));
die(json_encode(array("result" => 1, "maxid" => $maxid)));
}
}
}
}
die(json_encode(array("result" => 1, "maxid" => 0)));
} else {
$address = mysqld_selectall("SELECT * FROM " . table('shop_address') . " WHERE deleted=0 and openid = :openid", array(':openid' => $openid));
include themePage('address');
}
示例9: in
$condition = $condition . ' and openid in (select alifans.openid from ' . table('alipay_alifans') . ' alifans where alifans.nickname like :alipayname)';
$conditiondata[':alipayname'] = '%' . $_GP['alipayname'] . '%';
}
$status = 1;
if (empty($_GP['showstatus']) || $_GP['showstatus'] == 1) {
$status = 1;
}
if ($_GP['showstatus'] == -1) {
$status = 0;
}
if (!empty($_GP['rank_level'])) {
$rank_model = mysqld_select("SELECT * FROM " . table('rank_model') . "where rank_level=" . intval($_GP['rank_level']));
if (!empty($rank_model['rank_level'])) {
$condition = $condition . " and experience>=" . $rank_model['experience'];
$rank_model2 = mysqld_select("SELECT * FROM " . table('rank_model') . "where rank_level>" . $rank_model['rank_level'] . ' order by rank_level limit 1');
if (!empty($rank_model2['rank_level'])) {
if (intval($rank_model['experience']) < intval($rank_model2['experience'])) {
$condition = $condition . " and experience<" . $rank_model2['experience'];
}
}
}
}
$rank_model_list = mysqld_selectall("SELECT * FROM " . table('rank_model') . " order by rank_level");
$list = mysqld_selectall('SELECT * FROM ' . table('member') . " where 1=1 and `istemplate`=0 and `status`={$status} {$condition} " . " LIMIT " . ($pindex - 1) * $psize . ',' . $psize, $conditiondata);
$total = mysqld_selectcolumn('SELECT COUNT(*) FROM ' . table('member') . " where 1=1 and `istemplate`=0 {$condition} ", $conditiondata);
$pager = pagination($total, $pindex, $psize);
foreach ($list as $index => $item) {
$list[$index]['weixin'] = mysqld_selectall("SELECT * FROM " . table('weixin_wxfans') . " WHERE openid = :openid", array(':openid' => $item['openid']));
$list[$index]['alipay'] = mysqld_selectall("SELECT * FROM " . table('alipay_alifans') . " WHERE openid = :openid", array(':openid' => $item['openid']));
}
include page('list');
示例10: mysqld_selectall
<?php
// +----------------------------------------------------------------------
// | WE CAN DO IT JUST FREE
// +----------------------------------------------------------------------
// | Copyright (c) 2015 http://www.baijiacms.com All rights reserved.
// +----------------------------------------------------------------------
// | Author: 百家威信 <QQ:2752555327> <http://www.baijiacms.com>
// +----------------------------------------------------------------------
$allrule = mysqld_selectall('SELECT * FROM ' . table('rule'));
$account = mysqld_select('SELECT * FROM ' . table('user') . " WHERE id=:id", array(':id' => $_CMS['account']['id']));
$menurule = array();
$userRule = mysqld_selectall('SELECT * FROM ' . table('user_rule') . " WHERE uid=:uid", array(':uid' => $_CMS['account']['id']));
foreach ($allrule as $item) {
foreach ($userRule as $rule) {
if ($item['modname'] == $rule['modname'] && $item['moddo'] == $rule['moddo']) {
$menurule[] = $item['modname'] . "-" . $item['moddo'];
}
}
}
$username = $_CMS['account']['username'];
$settings = globaSetting();
$modulelist = mysqld_selectall("SELECT *,'' as menus FROM " . table('modules') . " order by displayorder");
foreach ($modulelist as $index => $module) {
$modulelist[$index]['menus'] = mysqld_selectall("SELECT * FROM " . table('modules_menu') . " WHERE `module`=:module ", array(':module' => $module['name']));
}
include page('main');
示例11: message
if (empty($order['id'])) {
message("未找到相关订单");
}
if ($_GP['isok'] == '1' && $order['paytypecode'] == 'weixin') {
message('支付成功!', WEBSITE_ROOT . mobile_url('myorder'), 'success');
}
if ($order['paytype'] != 3 && $order['status'] > 0 && !($order['paytype'] == 3 && $order['status'] == 1)) {
message('抱歉,您的订单已经付款或是被关闭,请重新进入付款!', mobile_url('myorder'), 'error');
}
$ordergoods = mysqld_selectall("SELECT goodsid,optionid,total FROM " . table('shop_order_goods') . " WHERE orderid = '{$orderid}'");
if (!empty($ordergoods)) {
$goodsids = array();
foreach ($ordergoods as $gooditem) {
$goodsids[] = $gooditem['goodsid'];
}
$goods = mysqld_selectall("SELECT id, title, thumb, marketprice, total,credit FROM " . table('shop_goods') . " WHERE id IN ('" . implode("','", $goodsids) . "')");
}
$goodtitle = '';
if (!empty($goods)) {
foreach ($goods as $row) {
if (empty($goodtitle)) {
$goodtitle = $row['title'];
}
$_optionid = $ordergoods[$row['id']]['optionid'];
$optionidtitle = '';
if (!empty($_optionid)) {
$optionidtitle = mysqld_select("select title from " . table("shop_goods_option") . " where id=:id", array('id' => $_optionid));
$optionidtitle = $optionidtitle['title'];
}
$goodsstr .= "{$row['title']} {$optionidtitle} X{$ordergoods[$row['id']]['total']}\n";
}
示例12: indexexists
public function indexexists($tablename, $indexname)
{
if (!empty($indexname)) {
$indexs = mysqld_selectall("SHOW INDEX FROM " . $this->table($tablename));
if (!empty($indexs) && is_array($indexs)) {
foreach ($indexs as $row) {
if ($row['Key_name'] == $indexname) {
return true;
}
}
}
}
return false;
}
示例13: mysqld_delete
<?php
$operation = !empty($_GP['op']) ? $_GP['op'] : 'display';
if ($operation == 'delete') {
mysqld_delete('addon10_scene_page', array("id" => intval($_GP['id'])));
message("删除成功!", "refresh", "success");
}
$scene_page_list = mysqld_selectall("SELECT * FROM " . table('addon10_scene_page') . " where list_id=:list_id", array("list_id" => intval($_GP['listid'])));
$scene = mysqld_select("SELECT * FROM " . table('addon10_scene_list') . " where id='" . intval($_GP['listid']) . "' ");
if (!empty($scene['id'])) {
$theme = $scene['theme'];
}
$list_id = intval($_GP['listid']);
include addons_page('themes/' . $theme . '/scene_page_list');
示例14: message
if (is_error($upload)) {
message($upload['message'], '', 'error');
}
$data['thumb'] = $upload['path'];
}
mysqld_insert('addon8_article', $data);
message("添加成功", create_url('site', array('name' => 'addon8', 'do' => 'article', 'op' => 'post', 'id' => mysqld_insertid())), "success");
} else {
$data = array('createtime' => time(), 'pcate' => intval($_GP['pcate']), 'ccate' => intval($_GP['ccate']), 'iscommend' => intval($_GP['iscommend']), 'ishot' => intval($_GP['ishot']), 'mobileTheme' => intval($_GP['mobileTheme']), 'title' => $_GP['title'], 'readcount' => intval($_GP['readcount']), 'description' => $_GP['description'], 'content' => htmlspecialchars_decode($_GP['content']), 'displayorder' => intval($_GP['displayorder']));
if (!empty($_GP['thumb_del'])) {
$data['thumb'] = '';
}
if (!empty($_FILES['thumb']['tmp_name'])) {
file_delete($_GP['thumb_old']);
$upload = file_upload($_FILES['thumb']);
if (is_error($upload)) {
message($upload['message'], '', 'error');
}
$data['thumb'] = $upload['path'];
}
mysqld_update('addon8_article', $data, array('id' => $_GP['id']));
message("修改成功", "refresh", "success");
}
}
include addons_page('article');
exit;
}
$article_list = mysqld_selectall("SELECT * FROM " . table('addon8_article') . " order by displayorder desc");
$category_pcate = mysqld_selectall("SELECT * FROM " . table('addon8_article_category') . " where parentid=0 ", array(), 'id');
$category_ccate = mysqld_selectall("SELECT * FROM " . table('addon8_article_category') . " where parentid!=0 ", array(), 'id');
include addons_page('article_list');
示例15: get_member_account
<?php
$member = get_member_account(false);
$member = member_get($member['openid']);
if (empty($member['openid'])) {
$member = get_member_account(false);
$member['createtime'] = time();
}
$is_login = is_login_account();
$weixinfans = get_weixin_fans_byopenid($member['openid'], $member['openid']);
if (!empty($weixinfans) && !empty($weixinfans['avatar'])) {
$avatar = $weixinfans['avatar'];
}
if ($is_login) {
$fansindex_menu_list = mysqld_selectall("SELECT * FROM " . table('shop_diymenu') . " where menu_type='fansindex' order by torder desc");
}
include themePage('fansindex');