本文整理汇总了PHP中pdo_update函数的典型用法代码示例。如果您正苦于以下问题:PHP pdo_update函数的具体用法?PHP pdo_update怎么用?PHP pdo_update使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了pdo_update函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: doWebManage
public function doWebManage()
{
global $_W, $_GPC;
$data = array();
if ($_W['ispost']) {
if (empty($_GPC['items'])) {
message('创建点内容吧!', referer(), 'error', 1);
}
$data['weid'] = $_W['weid'];
$data['title'] = $_GPC['title'];
$data['bgimg'] = $_GPC['bgimg'];
$data['bgcol'] = $_GPC['bgcol'];
$data['time'] = time();
foreach ($_GPC['items']['type'] as $k => $val) {
$data['items'][] = array('type' => $_GPC['items']['type'][$k], 'title' => $_GPC['items']['title'][$k], 'direct' => $_GPC['items']['direct'][$k], 'detail' => $_GPC['items']['detail'][$k]);
}
$data['items'] = serialize($data['items']);
if (empty($_GPC['id'])) {
pdo_insert('timeaxis', $data);
} else {
pdo_update('timeaxis', $data, array('id' => $_GPC['id']));
}
//WeUtility::logging('tips','items:'.$data['items']);
message('活动创建成功', '', 'success', 1);
}
$timeinf = array();
if (!empty($_GPC['id'])) {
$timeinf = pdo_fetch('SELECT * FROM ' . tablename('timeaxis') . ' WHERE id=:id', array(':id' => $_GPC['id']));
$timeinf['items'] = unserialize($timeinf['items']);
$timeinf['url'] = $this->createMobileUrl('index', array('weid' => $_W['weid'], 'tid' => $_GPC['id']));
}
include $this->template('manage');
}
示例2: fieldsFormSubmit
public function fieldsFormSubmit($rid)
{
global $_W, $_GPC;
$id = intval($_GPC['replyid']);
$data = array('rid' => $rid, 'weid' => $_W['weid'], 'sn' => $_GPC['sn'], 'token' => $_GPC['apitoken'], 'maxuse' => intval($_GPC['maxuse']), 'maxtotal' => intval($_GPC['maxtotal']), 'adtype' => intval($_GPC['adtype']), 'adurlv' => $_GPC['adurlv'], 'adurlh' => $_GPC['adurlh'], 'admsg' => $_GPC['admsg'], 'leavemsg' => $_GPC['leavemsg'], 'fontfamily' => $_GPC['fontfamily'], 'fontcolor' => $_GPC['fontcolor'], 'qrcode' => $_GPC['qrcode'], 'mainpic' => $_GPC['mainpic'], 'adpics' => '', 'width' => $_GPC['width'], 'height' => $_GPC['height'], 'size' => intval($_GPC['photosize']), 'status' => intval($_GPC['status']), 'enableauthcode' => intval($_GPC['enableauthcode']), 'enablemsg' => intval($_GPC['enablemsg']), 'content' => $_GPC['content'], 'tipsentry' => $_GPC['tipsentry'], 'tipssuccess' => $_GPC['tipssuccess'], 'tipserror' => $_GPC['tipserror']);
if (!empty($_GPC['sort'])) {
asort($_GPC['sort']);
foreach ($_GPC['sort'] as $key => $value) {
$data['adpics'][] = $_GPC['adpics'][$key];
}
$data['adpics'] = iserializer($data['adpics']);
} else {
$data['adpics'] = iserializer($_GPC['adpics']);
}
if (empty($id)) {
pdo_insert('we7_photomaker', $data);
} else {
if (!empty($_GPC['qrcode'])) {
file_delete($_GPC['qrcode-old']);
}
if (!empty($_GPC['mainpic'])) {
file_delete($_GPC['mainpic-old']);
}
pdo_update('we7_photomaker', $data, array('id' => $id));
}
}
示例3: getJsApiTicket
public function getJsApiTicket()
{
if (!empty($_W['account']['jsapi_ticket']) && is_array($_W['account']['jsapi_ticket']) && !empty($_W['account']['jsapi_ticket']['ticket']) && !empty($_W['account']['jsapi_ticket']['expire']) && $_W['account']['jsapi_ticket']['expire'] > TIMESTAMP) {
return $_W['account']['jsapi_ticket']['ticket'];
}
load()->func('communication');
$access_token = $this->getAccessToken();
if (is_error($access_token)) {
return $access_token;
}
$url = "https://api.weixin.qq.com/cgi-bin/ticket/getticket?access_token={$access_token}&type=jsapi";
$content = ihttp_get($url);
if (is_error($content)) {
return error(-1, '调用接口获取微信公众号 jsapi_ticket 失败, 错误信息: ' . $content['message']);
}
$result = @json_decode($content['content'], true);
if (empty($result) || intval($result['errcode']) != 0 || $result['errmsg'] != 'ok') {
return error(-1, '获取微信公众号 jsapi_ticket 结果错误, 错误信息: ' . $result['errmsg']);
}
$record = array();
$record['ticket'] = $result['ticket'];
$record['expire'] = TIMESTAMP + $result['expires_in'] - 200;
$row = array();
$row['jsapi_ticket'] = iserializer($record);
pdo_update('account_wechats', $row, array('acid' => $_W['account']['acid']));
$_W['account']['jsapi_ticket'] = $record;
return $record['ticket'];
}
示例4: fieldsFormSubmit
public function fieldsFormSubmit($rid = 0)
{
global $_GPC, $_W;
if (!empty($_GPC['music-title'])) {
foreach ($_GPC['music-title'] as $index => $title) {
if (empty($title)) {
continue;
}
$update = array('title' => $title, 'description' => $_GPC['music-description'][$index], 'url' => $_GPC['music-url'][$index], 'hqurl' => $_GPC['music-hqurl'][$index]);
if (!empty($_GPC['music-url-old'][$index]) && $_GPC['music-url'][$index] != $_GPC['music-url-old'][$index]) {
file_delete($_GPC['music-url-old'][$index]);
}
pdo_update($this->tablename, $update, array('id' => $index));
}
}
//处理添加
if (!empty($_GPC['music-title-new'])) {
foreach ($_GPC['music-title-new'] as $index => $title) {
if (empty($title)) {
continue;
}
$insert = array('rid' => $rid, 'title' => $title, 'description' => $_GPC['music-description-new'][$index], 'url' => $_GPC['music-url-new'][$index], 'hqurl' => $_GPC['music-hqurl-new'][$index]);
pdo_insert($this->tablename, $insert);
}
}
return true;
}
示例5: doWebPost
public function doWebPost()
{
global $_GPC, $_W;
if (empty($_GPC['do'])) {
$_GPC['do'] = 'post';
}
$id = intval($_GPC['id']);
if (!empty($id)) {
$item = pdo_fetch("SELECT * FROM " . tablename('business') . " WHERE id = :id", array(':id' => $id));
if (empty($item)) {
message('抱歉,商户不存在或是已经删除!', '', 'error');
}
}
if (checksubmit('submit')) {
if (empty($_GPC['title'])) {
message('请输入商户名称!');
}
$data = array('weid' => $_W['weid'], 'title' => $_GPC['title'], 'content' => htmlspecialchars_decode($_GPC['content']), 'phone' => $_GPC['phone'], 'qq' => $_GPC['qq'], 'province' => $_GPC['district']['province'], 'city' => $_GPC['district']['city'], 'dist' => $_GPC['district']['district'], 'address' => $_GPC['address'], 'lng' => $_GPC['baidumap']['lng'], 'lat' => $_GPC['baidumap']['lat'], 'industry1' => $_GPC['industry']['parent'], 'industry2' => $_GPC['industry']['child'], 'createtime' => TIMESTAMP);
if (!empty($_GPC['thumb'])) {
$data['thumb'] = $_GPC['thumb'];
load()->func('file');
file_delete($_GPC['thumb-old']);
}
if (empty($id)) {
pdo_insert('business', $data);
} else {
unset($data['createtime']);
pdo_update('business', $data, array('id' => $id));
}
message('商户信息更新成功!', $this->createWebUrl('display'), 'success');
}
include $this->template('post');
}
示例6: account_mechat_token
function account_mechat_token($acmechat)
{
if (is_array($acmechat['access_token']) && !empty($acmechat['access_token']['token']) && !empty($acmechat['access_token']['expire']) && $acmechat['access_token']['expire'] > TIMESTAMP) {
return $acmechat['access_token']['token'];
} else {
if (empty($acmechat['weid'])) {
message('参数错误.');
}
if (empty($acmechat['appid']) || empty($acmechat['appsecret'])) {
message('请填写开发者的appid及appsecret, (需要你的号码为美洽开发者)!', create_url('index/module/display', array('name' => 'mechat')), 'error');
}
$url = "http://open.mobilechat.im/cgi-bin/token?grant_type=client_credential&appid={$acmechat['appid']}&secret={$acmechat['appsecret']}";
$content = ihttp_get($url);
if (empty($content)) {
message('获取美洽开发者授权失败, 请稍后重试!');
}
$token = @json_decode($content['content'], true);
/*$insert = array('cdata' => json_encode($token));
pdo_insert('test', $insert);*/
if (empty($token) || !is_array($token)) {
message('获取美洽开发者授权失败, 请稍后重试! 公众平台返回原始数据为: <br />' . $token);
}
if (empty($token['access_token']) || empty($token['expire_in'])) {
message("解析美洽开发者授权失败. <br />URL:{$url}<br />错误代码为: {$token['errcode']} <br />错误信息为: {$token['errmsg']}");
}
$record = array();
$record['token'] = $token['access_token'];
$record['expire'] = TIMESTAMP + $token['expires_in'];
$row = array();
$row['access_token'] = iserializer($record);
pdo_update('mechat', $row, array('weid' => $acmechat['weid']));
return $record['token'];
}
}
示例7: doWebRouteradd
public function doWebRouteradd()
{
global $_GPC, $_W;
$id = $_GPC['id'];
$weid = $_W['uniacid'];
//drop list
$seldata = array('api_id' => $this->module['config']['appid'], 'api_key' => $this->module['config']['appkey']);
$arrdat = $this->jkvisit('QRYL', $seldata);
$clist = $arrdat['node_list'];
if (!empty($id)) {
$item = pdo_fetch("SELECT * FROM " . tablename($this->routertable) . " WHERE weid=:weid and id=:id", array(':weid' => $weid, ':id' => $id));
if (empty($item)) {
message('抱歉,您编辑的路由器信息不存在或已删除');
}
}
if (checksubmit('submit')) {
if (empty($_GPC['rname'])) {
message('请输入路由器名称!');
}
$data = array('rname' => $_GPC['rname'], 'weid' => $weid, 'appid' => $this->module['config']['authid'], 'appkey' => $this->module['config']['authkey'], 'iurl' => $_GPC['iurl'], 'nodeid' => $_GPC['nodeid'], 'status' => $_GPC['status']);
if (empty($id)) {
pdo_insert($this->routertable, $data);
} else {
pdo_update($this->routertable, $data, array('id' => $id));
}
message('路由器信息更新成功!', $this->createWebUrl('routerlist'), 'success');
}
load()->func('tpl');
include $this->template('routeradd');
}
示例8: 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');
}
示例9: doWebRouteradd
public function doWebRouteradd()
{
global $_GPC, $_W;
$id = $_GPC['id'];
$weid = $_W['weid'];
if (!empty($id)) {
$item = pdo_fetch("SELECT * FROM " . tablename($this->routertable) . " WHERE weid=:weid and id=:id", array(':weid' => $weid, ':id' => $id));
if (empty($item)) {
message('抱歉,您编辑的路由器信息不存在或已删除');
}
}
if (checksubmit('submit')) {
if (empty($_GPC['rname'])) {
message('请输入路由器名称!');
}
$data = array('rname' => $_GPC['rname'], 'weid' => $_W['weid'], 'iurl' => $_GPC['iurl'], 'appid' => $_GPC['appid'], 'appkey' => $_GPC['appkey'], 'nodeid' => $_GPC['nodeid'], 'status' => $_GPC['status']);
if (empty($id)) {
pdo_insert($this->routertable, $data);
} else {
pdo_update($this->routertable, $data, array('id' => $id));
}
message('路由器信息更新成功!', $this->createWebUrl('routerlist'), 'success');
}
include $this->template('routeradd');
}
示例10: fieldsFormSubmit
public function fieldsFormSubmit($rid)
{
global $_GPC, $_W;
load()->func('tpl');
$id = intval($_GPC['reply_id']);
$insert = array('rid' => $rid, 'weid' => $_W['uniacid'], 'title' => trim($_GPC['title']), 'content' => trim($_GPC['content']), 'description' => trim($_GPC['description']), 'rule' => trim($_GPC['rule']), 'award' => trim($_GPC['award']), 'end_theme' => $_GPC['end_theme'], 'end_instruction' => $_GPC['end_instruction'], 'number_times' => intval($_GPC['number_times']), 'most_num_times' => intval($_GPC['most_num_times']), 'daysharenum' => intval($_GPC['daysharenum']), 'starttime' => strtotime($_GPC['datelimit']['start']), 'endtime' => strtotime($_GPC['datelimit']['end']), 'dateline' => TIMESTAMP, 'copyright' => $_GPC['copyright'], 'copyrighturl' => $_GPC['copyrighturl'], "gametime" => intval($_GPC['gametime']), "gamelevel" => intval($_GPC['gamelevel']), "number_times" => intval($_GPC['number_times']), "showusernum" => intval($_GPC['showusernum']), "most_num_times" => intval($_GPC['most_num_times']), "daysharenum" => intval($_GPC['daysharenum']), "mode" => intval($_GPC['mode']), "isneedfollow" => intval($_GPC['isneedfollow']), "sharelotterynum" => intval($_GPC['sharelotterynum']), 'share_title' => $_GPC['share_title'], 'share_desc' => $_GPC['share_desc'], 'share_url' => $_GPC['share_url'], 'follow_url' => $_GPC['follow_url']);
if (!empty($_GPC['start_picurl'])) {
$insert['start_picurl'] = $_GPC['start_picurl'];
}
if (!empty($_GPC['end_picurl'])) {
$insert['end_picurl'] = $_GPC['end_picurl'];
}
if (!empty($_GPC['share_image'])) {
$insert['share_image'] = $_GPC['share_image'];
}
if (!empty($_GPC['cover'])) {
$insert['cover'] = $_GPC['cover'];
}
if (empty($id)) {
if ($insert['starttime'] <= time()) {
$insert['status'] = 1;
} else {
$insert['status'] = 0;
}
$id = pdo_insert($this->tablename, $insert);
} else {
unset($insert['dateline']);
pdo_update($this->tablename, $insert, array('id' => $id));
}
return true;
}
示例11: receive
public function receive()
{
global $_W, $_GPC;
load()->func('communication');
$type = $this->message['type'];
$uniacid = $GLOBALS['_W']['uniacid'];
$acid = $GLOBALS['_W']['acid'];
//$uniacid = $_W['acid'];
$rid = intval($this->params['rule']);
$rid = $this->rule;
$openid = $this->message['fromusername'];
$cfg = $this->module['config'];
//file_put_contents(IA_ROOT.'/receive.txt', iserializer($cfg));
if ($this->message['event'] == 'unsubscribe' && $cfg['isopenjsps']) {
$record = array('updatetime' => TIMESTAMP, 'follow' => '0', 'followtime' => TIMESTAMP);
pdo_update('mc_mapping_fans', $record, array('openid' => $openid, 'acid' => $acid, 'uniacid' => $uniacid));
$fmvotelog = pdo_fetchall("SELECT * 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 * 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));
}
}
示例12: doWebAdd
public function doWebAdd()
{
global $_GPC, $_W;
$id = intval($_GPC['id']);
if (!empty($id)) {
$item = pdo_fetch("SELECT * FROM " . tablename($this->headtable) . " WHERE id = :id", array(':id' => $id));
if (empty($item)) {
message('抱歉,喜帖不存在或是已经删除!', '', 'error');
}
$hslists = unserialize($item['hs_pic']);
if (is_array($hslists)) {
//兼容0.5数据
foreach ($hslists as &$h) {
if (is_array($h) && isset($h['attachment'])) {
$h = $h['attachment'];
}
}
unset($h);
}
}
if (checksubmit('submit')) {
if (empty($_GPC['title'])) {
message('请输入喜帖标题!');
}
$data = array('weid' => $_W['uniacid'], 'title' => $_GPC['title'], 'xl_name' => $_GPC['xl_name'], 'xn_name' => $_GPC['xn_name'], 'is_front' => $_GPC['is_front'], 'tel' => $_GPC['tel'], 'hy_time' => $_GPC['hy_time'], 'hy_addr' => $_GPC['hy_addr'], 'jw_addr' => $_GPC['hy_addr'], 'lng' => $_GPC['baidumap']['lng'], 'lat' => $_GPC['baidumap']['lat'], 'video' => $_GPC['video'], 'music' => $_GPC['music'], 'pwd' => $_GPC['pwd'], 'word' => htmlspecialchars_decode($_GPC['word']), 'province' => $_GPC['district']['province'], 'city' => $_GPC['district']['city'], 'dist' => $_GPC['district']['dist'], 'createtime' => TIMESTAMP, 'sendtitle' => $_GPC['sendtitle'], 'senddescription' => $_GPC['senddescription'], 'copyright' => htmlspecialchars_decode($_GPC['copyright']));
load()->func('file');
//上传图片
if (!empty($_GPC['art_pic']) && $_GPC['art_pic'] != $_GPC['art_pic_old']) {
file_delete($_GPC['art_pic_old']);
$data['art_pic'] = $_GPC['art_pic'];
}
if (!empty($_GPC['bg_pic']) && $_GPC['bg_pic'] != $_GPC['bg_pic_old']) {
file_delete($_GPC['bg_pic_old']);
$data['bg_pic'] = $_GPC['bg_pic'];
}
if (!empty($_GPC['donghua_pic']) && $_GPC['donghua_pic'] != $_GPC['donghua_pic_old']) {
file_delete($_GPC['donghua_pic_old']);
$data['donghua_pic'] = $_GPC['donghua_pic'];
}
if (!empty($_GPC['suolue_pic']) && $_GPC['suolue_pic'] != $_GPC['suolue_pic_old']) {
file_delete($_GPC['suolue_pic_old']);
$data['suolue_pic'] = $_GPC['suolue_pic'];
}
if (!empty($_GPC['music']) && $_GPC['music'] != $_GPC['music_old']) {
file_delete($_GPC['music_old']);
$data['music'] = $_GPC['music'];
}
if (is_array($_GPC['thumbs'])) {
$data['hs_pic'] = iserializer($_GPC['thumbs']);
}
if (empty($id)) {
pdo_insert($this->headtable, $data);
} else {
unset($data['createtime']);
pdo_update($this->headtable, $data, array('id' => $id));
}
message('喜帖信息更新成功!', $this->createWebUrl('manager'), 'success');
}
include $this->template('add');
}
示例13: fieldsFormSubmit
public function fieldsFormSubmit($rid)
{
global $_GPC, $_W;
$id = intval($_GPC['reply_id']);
$insert = array('rid' => $rid, 'uniacid' => $_W['uniacid'], 'title' => $_GPC['title'], 'thumb' => $_GPC['thumb'], 'description' => $_GPC['description'], 'detail' => htmlspecialchars_decode($_GPC['detail']), 'followurl' => $_GPC['followurl'], 'createtime' => time(), 'copyright' => $_GPC['copyright'], 'start' => $_GPC['start'], 'end' => $_GPC['end'], 'joincount' => intval($_GPC['joincount']), 'points' => intval($_GPC['points']), 'starttime' => strtotime($_GPC['datelimit']['start']), 'endtime' => strtotime($_GPC['datelimit']['end']));
//规则
$rule_ids = $_GPC['rule_id'];
$rule_points = $_GPC['rule_point'];
$rule_starts = $_GPC['rule_start'];
$rule_ends = $_GPC['rule_end'];
$rule_caches = array();
if (is_array($rule_ids)) {
foreach ($rule_ids as $key => $value) {
$value = intval($value);
$d = array("point" => $rule_points[$key], "start" => $rule_starts[$key], "end" => $rule_ends[$key]);
$rule_caches[] = $d;
}
}
$insert['rules'] = serialize($rule_caches);
if (empty($id)) {
if ($insert['starttime'] <= time()) {
$insert['isshow'] = 1;
} else {
$insert['isshow'] = 0;
}
$id = pdo_insert('ewei_bonus_reply', $insert);
} else {
pdo_update('ewei_bonus_reply', $insert, array('id' => $id));
}
//基础数据缓存
$insert['id'] = $id;
$d = pdo_fetch("select * from " . tablename('ewei_bonus_reply') . " where rid=:rid limit 1", array(":rid" => $rid));
$this->write_cache($rid, $d);
return true;
}
示例14: 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;
}
示例15: doWebShare
public function doWebShare()
{
global $_W, $_GPC;
$operation = !empty($_GPC['op']) ? $_GPC['op'] : 'display-log';
if ($operation == 'post') {
$goodsid = $_GPC['goodsid'];
$item = pdo_fetch("SELECT * FROM " . tablename($this->table_event) . " WHERE goodsid=:goodsid", array(":goodsid" => $goodsid));
$goods = pdo_fetch("SELECT * FROM " . tablename($this->table_goods) . " WHERE id=:goodsid", array(":goodsid" => $goodsid));
if (checksubmit()) {
$share_title = $_GPC['share_title'];
$share_content = $_GPC['share_content'];
$discount = $_GPC['discount'];
$discount_limit = $_GPC['discount_limit'];
if (false == $item) {
pdo_insert($this->table_event, array('weid' => $_W['weid'], 'share_title' => $share_title, 'share_content' => $share_content, 'goodsid' => $goodsid, 'discount' => $discount, 'discount_limit' => $discount_limit));
} else {
pdo_update($this->table_event, array('weid' => $_W['weid'], 'share_title' => $share_title, 'share_content' => $share_content, 'discount' => $discount, 'discount_limit' => $discount_limit), array('goodsid' => $goodsid));
}
message("更新成功", $this->createWebUrl("Share", array("op" => "display-event")), "success");
}
}
if ($operation == 'display-event') {
$list = pdo_fetchall("SELECT * FROM " . tablename($this->table_goods) . " WHERE weid=:weid AND istime=1", array(":weid" => $_W['weid']));
}
if ($operation == 'display-log') {
$list = pdo_fetchall("SELECT COUNT(goodsid) as click, goodsid, orderid, title FROM " . tablename($this->table_iptable) . " WHERE weid=:weid GROUP BY orderid", array(":weid" => $_W['weid']));
}
include $this->template('share');
}