本文整理汇总了PHP中mysqld_update函数的典型用法代码示例。如果您正苦于以下问题:PHP mysqld_update函数的具体用法?PHP mysqld_update怎么用?PHP mysqld_update使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了mysqld_update函数的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: member_create_qq
function member_create_qq($qq_openid, $avatar = '', $nickname = '', $gender = 0)
{
if (!empty($qq_openid)) {
$qq_fans = mysqld_select("SELECT * FROM " . table('qq_qqfans') . " WHERE qq_openid=:qq_openid ", array(':qq_openid' => $qq_openid));
if (empty($qq_fans['qq_openid'])) {
$row = array('nickname' => $nickname, 'gender' => intval($gender), 'qq_openid' => $qq_openid, 'avatar' => $avatar, 'createtime' => TIMESTAMP);
mysqld_insert('qq_qqfans', $row);
} else {
$row = array('nickname' => $nickname, 'gender' => intval($gender), 'avatar' => $avatar);
mysqld_update('qq_qqfans', $row, array('qq_openid' => $qq_openid));
}
}
}
示例3: foreach
<?php
$operation = !empty($_GP['op']) ? $_GP['op'] : 'display';
if ($operation == 'delete') {
if (checksubmit('submit')) {
foreach ($_GP['check'] as $k) {
mysqld_update('bonus_user', array('deleted' => 1), array('bonus_id' => intval($k)));
}
message("批量删除成功!", "refresh", "success");
}
mysqld_update('bonus_user', array('deleted' => 1), array('bonus_id' => intval($_GP['id'])));
message("删除成功!", "refresh", "success");
}
$pindex = max(1, intval($_GP['page']));
$psize = 20;
$bonus_user_list = mysqld_selectall("SELECT user.*,member.mobile mobile,member.realname,orders.ordersn FROM " . table('bonus_user') . " user left join " . table('member') . " member on member.openid=user.openid left join " . table('shop_order') . " orders on orders.id=user.order_id where user.deleted=0 and user.bonus_type_id=:bonus_type_id order by user.bonus_id desc LIMIT " . ($pindex - 1) * $psize . ',' . $psize, array(":bonus_type_id" => $_GP['id']));
$total = mysqld_selectcolumn("SELECT count(user.bonus_id) FROM " . table('bonus_user') . " user left join " . table('member') . " member on member.openid=user.openid left join " . table('shop_order') . " orders on orders.id=user.order_id where user.deleted=0 and user.bonus_type_id=:bonus_type_id", array(":bonus_type_id" => $_GP['id']));
$pager = pagination($total, $pindex, $psize);
include page('bonus_view');
示例4: mysqld_select
<?php
$code = $_GP['code'];
require WEB_ROOT . '/system/modules/plugin/dispatch/' . $code . '/lang.php';
$item = mysqld_select("SELECT * FROM " . table('dispatch') . " WHERE code = :code", array(':code' => $code));
if (empty($item['id'])) {
$data = array('code' => $code, 'name' => $_LANG['dispatch_' . $code . '_name'], 'desc' => $_LANG['dispatch_' . $code . '_desc'], 'enabled' => '1', 'sendtype' => $_LANG['dispatch_' . $code . '_sendtype']);
mysqld_insert('dispatch', $data);
} else {
$data = array('name' => $_LANG['dispatch_' . $code . '_name'], 'desc' => $_LANG['dispatch_' . $code . '_desc'], 'enabled' => '1', 'sendtype' => $_LANG['dispatch_' . $code . '_sendtype']);
mysqld_update('dispatch', $data, array('code' => $code));
}
message("操作成功", create_url('site', array('name' => 'modules', 'do' => 'dispatch', 'op' => 'display')));
示例5: get_member_account
<?php
$member_account = get_member_account();
$openid = $member['openid'];
$order = mysqld_select("SELECT * FROM " . table('shop_order') . " WHERE id=:id limit 1", array(':id' => $orderid));
$getmember = member_get($openid);
if ($getmember['gold'] >= $order['price']) {
$usegold = member_gold($openid, $order['price'], 'usegold', "消费金额:" . $order['price'] . ",订单编号:" . $order['ordersn']);
if ($usegold) {
mysqld_update('shop_order', array('status' => '1', 'paytype' => '1'), array('id' => $orderid));
message('订单提交成功,收货后请验货!', WEBSITE_ROOT . mobile_url('myorder'), 'success');
} else {
message('付款失败!', WEBSITE_ROOT . mobile_url('myorder'), 'error');
}
} else {
message('余额不足,无法完成付款!', WEBSITE_ROOT . mobile_url('myorder'), 'error');
}
示例6: array
<?php
$pay_submit_data = array('delivery_pay_desc' => htmlspecialchars_decode($_GP['delivery_pay_desc']));
mysqld_update('payment', array('order' => $_GP['pay_order'], 'configs' => serialize($pay_submit_data)), array('code' => 'delivery'));
mysqld_update('payment', array('enabled' => '1'), array('code' => 'delivery'));
示例7: mysqld_update
$this->setOrderCredit($openid, $order['id'], true, '订单:' . $order['ordersn'] . '收货新增积分');
}
mysqld_update('shop_order', array('status' => 3, 'updatetime' => time()), array('id' => $orderid, 'openid' => $openid));
message('确认收货完成!', mobile_url('myorder', array('status' => intval($_GP['fromstatus']))), 'success');
} else {
if ($op == 'detail') {
$orderid = intval($_GP['orderid']);
$item = mysqld_select("SELECT * FROM " . table('shop_order') . " WHERE openid = '" . $openid . "' and id='{$orderid}' limit 1");
if (empty($item)) {
message('抱歉,您的订单不存或是已经被取消!', mobile_url('myorder'), 'error');
}
if ($item['hasbonus']) {
$bonuslist = mysqld_selectall("SELECT bonus_user.*,bonus_type.type_name FROM " . table('bonus_user') . " bonus_user left join " . table('bonus_type') . " bonus_type on bonus_type.type_id=bonus_user.bonus_type_id WHERE bonus_user.order_id=:order_id", array(":order_id" => $orderid));
}
if ($item['paytype'] != $this->getPaytypebycode($item['paytypecode'])) {
mysqld_update('shop_order', array('paytype' => $this->getPaytypebycode($item['paytypecode'])), array('id' => $orderid, 'openid' => $openid));
$item = mysqld_select("SELECT * FROM " . table('shop_order') . " WHERE openid = '" . $openid . "' and id='{$orderid}' limit 1");
}
$goodsid = mysqld_selectall("SELECT goodsid,total FROM " . table('shop_order_goods') . " WHERE orderid = '{$orderid}'", array(), 'goodsid');
$goods = mysqld_selectall("SELECT g.id, g.title, g.thumb, g.marketprice,o.total,o.optionid FROM " . table('shop_order_goods') . " o left join " . table('shop_goods') . " g on o.goodsid=g.id " . " WHERE o.orderid='{$orderid}'");
foreach ($goods as &$g) {
//属性
$option = mysqld_select("select * from " . table("shop_goods_option") . " where id=:id limit 1", array(":id" => $g['optionid']));
if ($option) {
$g['title'] = "[" . $option['title'] . "]" . $g['title'];
$g['marketprice'] = $option['marketprice'];
}
}
unset($g);
$dispatch = mysqld_select("select id,dispatchname,sendtype from " . table('shop_dispatch') . " where id=:id limit 1", array(":id" => $item['dispatch']));
$payments = mysqld_selectall("select * from " . table("payment") . " where enabled=1 order by `order` desc");
示例8: 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');
}
示例9: mysqld_update
<?php
// if(empty($_GP['weixin_appId'])||empty($_GP['weixin_appSecret']))
// {
// message("微信公众号appid或者appsecret不能空!");
// }
// $cfg = array(
// 'weixin_appId' => $_GP['weixin_appId'],
// 'weixin_appSecret' => $_GP['weixin_appSecret']
// );
// refreshSetting($cfg);
mysqld_update('thirdlogin', array('enabled' => 1), array('code' => 'weixin'));
示例10: mysqld_update
<?php
mysqld_update('thirdlogin', array('enabled' => 0), array('code' => 'weixin'));
mysqld_update('payment', array('enabled' => 0), array('code' => 'weixin'));
?>
示例11: mysqld_selectall
$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";
}
}
$paytypecode = $order['paytypecode'];
if (!empty($_GP['paymentcode'])) {
$paytypecode = $_GP['paymentcode'];
}
$payment = mysqld_select("select * from " . table("payment") . " where enabled=1 and `code`=:code ", array('code' => $paytypecode));
if (empty($payment['id'])) {
message("未找到付款方式,付款失败");
}
if ($order['paytypecode'] != $paytypecode) {
$paytype = $this->getPaytypebycode($paytypecode);
mysqld_update('shop_order', array('paytypecode' => $payment['code'], 'paytypename' => $payment['name'], 'paytype' => $paytype), array('id' => $orderid));
}
require WEB_ROOT . '/system/modules/plugin/payment/' . $paytypecode . '/payaction.php';
exit;
示例12: mysqld_update
<?php
$code = $_GP['code'];
mysqld_update('dispatch', array('enabled' => 0), array('code' => $code));
message('关闭成功!', 'refresh', 'success');
示例13: member_gold
function member_gold($openid, $fee, $type, $remark)
{
$member = member_get($openid);
if (!empty($member['openid'])) {
if (!is_numeric($fee) || $fee < 0) {
message("输入数字非法,请重新输入");
}
if ($type == 'addgold') {
$data = array('remark' => $remark, 'type' => $type, 'fee' => $fee, 'account_fee' => $member['gold'] + $fee, 'createtime' => TIMESTAMP, 'openid' => $openid);
mysqld_insert('member_paylog', $data);
mysqld_update('member', array('gold' => $member['gold'] + $fee), array('openid' => $openid));
return true;
}
if ($type == 'usegold') {
if ($member['gold'] >= $fee) {
$data = array('remark' => $remark, 'type' => $type, 'fee' => $fee, 'account_fee' => $member['gold'] - $fee, 'createtime' => TIMESTAMP, 'openid' => $openid);
mysqld_insert('member_paylog', $data);
mysqld_update('member', array('gold' => $member['gold'] - $fee), array('openid' => $openid));
return true;
}
}
}
return false;
}
示例14: do_process
public function do_process()
{
global $_GP, $_CMS;
$settings = globaSetting();
$configdata = $settings['weixintoken'];
$token = $configdata;
if (!$this->checkSign($token)) {
exit('Access Denied');
}
if (strtolower($_SERVER['REQUEST_METHOD']) == 'get') {
ob_clean();
ob_start();
exit($_GET['echostr']);
}
if (strtolower($_SERVER['REQUEST_METHOD']) == 'post') {
$postStr = $GLOBALS["HTTP_RAW_POST_DATA"];
$message = $this->requestParse($postStr);
if (empty($message)) {
exit('Request Failed');
}
if ($message['type'] == 'text' || $message['type'] == 'CLICK') {
$key = $message['content'];
if ($message['type'] == 'CLICK') {
$key = $message['eventkey'];
}
if (!empty($key)) {
$reply = mysqld_select('SELECT * FROM ' . table('weixin_rule') . " WHERE keywords = :keywords", array(':keywords' => $key));
}
if (empty($reply['id']) && !empty($key) && strpos($key, 'hx') == 0 && strpos($key, 'x') == 1 && !empty(strstr($key, 'hx'))) {
if ($_CMS['addons_bj_hx']) {
//扩展模块代码
$newkey = str_replace('hx', '', $key);
$item = mysqld_select("SELECT * FROM " . table('shop_order') . " WHERE ordersn = :ordersn\t", array(':ordersn' => $newkey));
if (empty($item)) {
return $this->respText('抱歉,核销订单不存在或被取消', $message);
}
if ($item['status'] == 3) {
return $this->respText('抱歉,核销订单已核销完成,不能重复核销!', $message);
}
$from_user = $message['from'];
$weixin_wxfans = mysqld_select('SELECT * FROM ' . table('weixin_wxfans') . " WHERE weixin_openid = :weixin_openid", array(':weixin_openid' => $from_user));
$str = $this->verifyorder($weixin_wxfans['openid'], $newkey);
return $this->respText($str, $message);
}
} else {
if ($_CMS['addons_bj_tbk']) {
//扩展模块代码
if (empty($reply['id']) && !empty($key)) {
$from_user = $message['from'];
$spread = mysqld_select("SELECT * FROM " . table('bj_tbk_qrcode') . " where weixinkey=:weixinkey limit 1", array(':weixinkey' => $key));
if (!empty($spread['id'])) {
$weixin_wxfans = mysqld_select('SELECT * FROM ' . table('weixin_wxfans') . " WHERE weixin_openid = :weixin_openid", array(':weixin_openid' => $from_user));
if (!empty($weixin_wxfans['openid'])) {
$bj_tbk_member_relect = mysqld_select('SELECT * FROM ' . table('bj_tbk_member_relect') . " WHERE openid = :openid", array(':openid' => $weixin_wxfans['openid']));
//if(empty($bj_tbk_member_relect['isagent']))
//{
// return $this->respText('您还不是代理无法生成二维码',$message);
//}
$qrcodecache = mysqld_select("SELECT * FROM " . table('bj_tbk_qrcode_cache') . " where qrcodeid=:qrcodeid and from_user=:from_user limit 1", array(':qrcodeid' => $spread['id'], ':from_user' => $from_user));
if (empty($qrcodecache['id']) || empty($qrcodecache['qr_url']) || empty($qrcodecache['media_id']) || empty($qrcodecache['id']) || !empty($qrcodecache['expiretime']) && $qrcodecache['expiretime'] <= TIMESTAMP) {
$media_id = bj_tbk_qrcode($qrcodecache, $spread, $from_user, $weixin_wxfans['openid'], true, 'media_id');
return $this->respImage($media_id, $message);
// $this->sendcustomIMG($from_user,$media_id);
exit;
} else {
return $this->respImage($qrcodecache['media_id'], $message);
}
} else {
return $this->respText('您还不是会员无法生成二维码', $message);
}
}
}
}
}
}
if ($message['type'] == 'subscribe') {
$reply = mysqld_select('SELECT * FROM ' . table('weixin_rule') . " WHERE keywords = :keywords", array(':keywords' => subscribe_key));
if (!empty($message['eventkey']) && strlen($message['eventkey']) > 8) {
$eventkey = substr($message['eventkey'], 8);
} else {
$eventkey = $message['eventkey'];
}
if (!empty($message['from']) && !empty($eventkey)) {
bj_tbk_base_shareinfo('', $eventkey, $message['from'], '', 1);
}
mysqld_update('weixin_wxfans', array('follow' => 1), array('weixin_openid' => $message['from']));
}
if ($message['type'] == 'unsubscribe') {
mysqld_update('weixin_wxfans', array('follow' => 0), array('weixin_openid' => $message['from']));
}
if (empty($reply['id'])) {
$reply = mysqld_select('SELECT * FROM ' . table('weixin_rule') . " WHERE keywords = :keywords", array(':keywords' => default_key));
}
if ($reply['ruletype'] == 1) {
$reply['content'] = htmlspecialchars_decode($reply['description']);
$reply['content'] = str_replace(array('<br>', ' '), array("\n", ' '), $reply['content']);
$reply['content'] = strip_tags($reply['content'], '<a>');
return $this->respText($reply['content'], $message);
}
if ($reply['ruletype'] == 2) {
//.........这里部分代码省略.........
示例15: 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');