本文整理汇总了PHP中pwSqlMulti函数的典型用法代码示例。如果您正苦于以下问题:PHP pwSqlMulti函数的具体用法?PHP pwSqlMulti怎么用?PHP pwSqlMulti使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了pwSqlMulti函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: updates
function updates($array)
{
foreach ($array as $key => $value) {
$array[$key] = $this->_serializeData($value);
}
$this->_db->update("REPLACE INTO " . $this->_tableName . " (invokepieceid,fid,loopid,data,cachetime) VALUES " . pwSqlMulti($array, false));
}
示例2: update
/**
* 批量更新缓存数据
*
* @param array $data 缓存数据,array('KEY'=>'VALUE')
* @param int $expire 缓存数据自动过期时间(秒)
* @return bool
*/
function update($data, $expire = 180)
{
$tmpvhash = $dcache = $kcache = array();
$expire = $this->now + $expire;
$keys = array_keys($data);
$query = $this->cache->query("SELECT skey,vhash FROM " . $this->table . " WHERE skey IN (" . pwImplode($keys, false) . ")");
while ($rt = $this->cache->fetch_array($query)) {
$tmpvhash[$rt['skey']] = $rt['vhash'];
}
foreach ($data as $key => $value) {
$v = $this->_serialize($value);
$vhash = md5($v);
if (!isset($tmpvhash[$key]) || $tmpvhash[$key] != $vhash) {
$dcache[] = array($key, $expire, $vhash, $v);
} else {
$kcache[] = $key;
}
}
if ($dcache) {
$this->cache->update("REPLACE INTO " . $this->table . " (skey,expire,vhash,value) VALUES " . pwSqlMulti($dcache, false));
}
if ($kcache) {
$this->cache->update("UPDATE " . $this->table . " SET expire=" . pwEscape($expire, false) . "WHERE skey IN (" . pwImplode($kcache, false) . ")");
}
$this->_expire();
}
示例3: replaceSEOSet
/**
* @param $data
* @return boolean
*/
function replaceSEOSet($type, $data)
{
if ($data && $type && in_array($type, $this->_types)) {
$this->_db->update("REPLACE INTO " . $this->_tableName . " (mode,page,type,content) VALUES " . pwSqlMulti($data));
return true;
} else {
return false;
}
}
示例4: update
function update($uploaddb)
{
global $windid, $timestamp, $pintro;
foreach ($uploaddb as $key => $value) {
$this->attachs[] = array('aid' => $this->aid, 'pintro' => $pintro[$value['id']], 'path' => $value['fileuploadurl'], 'uploader' => $windid, 'uptime' => $timestamp, 'ifthumb' => $value['ifthumb']);
}
if ($this->attachs) {
$this->db->update("INSERT INTO pw_cnphoto (aid,pintro,path,uploader,uptime,ifthumb) VALUES " . pwSqlMulti($this->attachs));
$this->pid = $this->db->insert_id();
}
}
示例5: strrpos
$lastpos = strrpos($rt['path'], '/') + 1;
$path = $attachdir . '/' . substr($rt['path'], 0, $lastpos) . 's_' . substr($rt['path'], $lastpos);
if (copy($path, $attachdir . '/' . $savedir . 's_' . $filename)) {
$ifthumb = 1;
}
}
$path = $savedir . $filename;
} else {
$path = $rt['path'];
$ifthumb = $rt['ifthumb'];
}
$photos[] = array('aid' => $selaid, 'pintro' => '', 'path' => $path, 'uploader' => $windid, 'uptime' => $timestamp, 'ifthumb' => $ifthumb);
$lastphoto = $path;
}
if ($photos) {
$db->update("INSERT INTO pw_cnphoto (aid,pintro,path,uploader,uptime,ifthumb) VALUES " . pwSqlMulti($photos));
$pid = $db->insert_id();
$photoNum = count($photos);
$lastpid = getLastPid($selaid, 4);
array_unshift($lastpid, $pid);
$db->update("UPDATE pw_cnalbum SET photonum=photonum+" . pwEscape($photoNum) . ",lasttime=" . pwEscape($timestamp) . ',lastpid=' . pwEscape(implode(',', $lastpid)) . (!$selalbum['lastphoto'] ? ',lastphoto=' . pwEscape($lastphoto) : '') . " WHERE aid=" . pwEscape($selaid));
countPosts("+{$photoNum}");
$feedText = '';
foreach ($photos as $value) {
$feedText .= "[url={$db_bbsurl}/{#APPS_BASEURL#}space=1&q=galbum&a=view&cyid={$cyid}&pid={$pid}][img]" . getphotourl($value['path'], $value['ifthumb']) . "[/img][/url] ";
}
pwAddFeed($winduid, 'colony_photo', $cyid, array('lang' => 'colony_photo', 'cyid' => $cyid, 'num' => $photoNum, 'colony_name' => $colony['cname'], 'text' => $feedText));
//积分变动
require_once R_P . 'require/credit.php';
$o_groups_creditset = unserialize($o_groups_creditset);
$creditset = getCreditset($o_groups_creditset['Uploadphoto']);
示例6: exit
<?php
!defined('PW_UPLOAD') && exit('Forbidden');
$maxid = $db->get_value("SELECT MAX(id) FROM pw_advert");
$maxid = $maxid < 100 ? 101 : $maxid + 1;
$db->update("ALTER TABLE pw_advert AUTO_INCREMENT={$maxid}", false);
//$query = $db->query("");//TODO 转换id小于100的记录
$query = $db->query("SELECT * FROM pw_advert WHERE id<={$maxid} AND type=1");
while ($rt = $db->fetch_array($query)) {
$ads[] = array($rt['type'], $rt['uid'], $rt['ckey'], $rt['stime'], $rt['etime'], $rt['ifshow'], $rt['orderby'], $rt['descrip'], $rt['config']);
}
if ($ads) {
$db->update("INSERT INTO pw_advert(type,uid,ckey,stime,etime,ifshow,orderby,descrip,config) VALUES " . pwSqlMulti($ads, false));
}
$maxid = $maxid - 1;
$db->update("DELETE FROM pw_advert WHERE id<={$maxid} AND type=1");
$arrSQL = array("REPLACE INTO pw_advert VALUES(1, 0, 0, 'Site.Header', 0, 0, 1, 0, '头部横幅~\t~显示在页面的头部,一般以图片或flash方式显示,多条广告时系统将随机选取一条显示', 'a:1:{s:7:\"display\";s:4:\"rand\";}');", "REPLACE INTO pw_advert VALUES(2, 0, 0, 'Site.Footer', 0, 0, 1, 0, '底部横幅~\t~显示在页面的底部,一般以图片或flash方式显示,多条广告时系统将随机选取一条显示', 'a:1:{s:7:\"display\";s:4:\"rand\";}');", "REPLACE INTO pw_advert VALUES(3, 0, 0, 'Site.NavBanner1', 0, 0, 1, 0, '导航通栏[1]~\t~显示在主导航的下面,一般以图片或flash方式显示,多条广告时系统将随机选取一条显示', 'a:1:{s:7:\"display\";s:4:\"rand\";}');", "REPLACE INTO pw_advert VALUES(4, 0, 0, 'Site.NavBanner2', 0, 0, 1, 0, '导航通栏[2]~\t~显示在头部通栏广告[1]位置的下面,与通栏广告[1]可一起显示,一般为图片广告', 'a:1:{s:7:\"display\";s:4:\"rand\";}');", "REPLACE INTO pw_advert VALUES(5, 0, 0, 'Site.PopupNotice', 0, 0, 1, 0, '弹窗广告[右下]~\t~在页面右下角以浮动的层弹出显示,此广告内容需要单独设置相关窗口参数', 'a:1:{s:7:\"display\";s:4:\"rand\";}');", "REPLACE INTO pw_advert VALUES(6, 0, 0, 'Site.FloatRand', 0, 0, 1, 0, '漂浮广告[随机]~\t~以各种形式在页面内随机漂浮的广告', 'a:1:{s:7:\"display\";s:4:\"rand\";}');", "REPLACE INTO pw_advert VALUES(7, 0, 0, 'Site.FloatLeft', 0, 0, 1, 0, '漂浮广告[左]~\t~以各种形式在页面左边漂浮的广告,俗称对联广告[左]', 'a:1:{s:7:\"display\";s:4:\"rand\";}');", "REPLACE INTO pw_advert VALUES(8, 0, 0, 'Site.FloatRight', 0, 0, 1, 0, '漂浮广告[右]~\t~以各种形式在页面右边漂浮的广告,俗称对联广告[右]', 'a:1:{s:7:\"display\";s:4:\"rand\";}');", "REPLACE INTO pw_advert VALUES(9, 0, 0, 'Mode.TextIndex', 0, 0, 1, 0, '文字广告[论坛首页]~\t~显示在页面的导航下面,一般以文字方式显示,每行四条广告,超过四条将换行显示', 'a:1:{s:7:\"display\";s:3:\"all\";}');", "REPLACE INTO pw_advert VALUES(10, 0, 0, 'Mode.Forum.TextRead', 0, 0, 1, 0, '文字广告[帖子页]~\t~显示在页面的导航下面,一般以文字方式显示,每行四条广告,超过四条将换行显示', 'a:1:{s:7:\"display\";s:3:\"all\";}');", "REPLACE INTO pw_advert VALUES(11, 0, 0, 'Mode.Forum.TextThread', 0, 0, 1, 0, '文字广告[主题页]~\t~显示在页面的导航下面,一般以文字方式显示,每行四条广告,超过四条将换行显示', 'a:1:{s:7:\"display\";s:3:\"all\";}');", "REPLACE INTO pw_advert VALUES(12, 0, 0, 'Mode.Forum.Layer.TidRight', 0, 0, 1, 0, '楼层广告[帖子右侧]~\t~出现在帖子右侧,一般以图片或文字显示,多条帖间广告时系统将随机选取一条显示', 'a:1:{s:7:\"display\";s:4:\"rand\";}');", "REPLACE INTO pw_advert VALUES(13, 0, 0, 'Mode.Forum.Layer.TidDown', 0, 0, 1, 0, '楼层广告[帖子下方]~\t~出现在帖子下方,一般以图片或文字显示,多条帖间广告时系统将随机选取一条显示', 'a:1:{s:7:\"display\";s:4:\"rand\";}');", "REPLACE INTO pw_advert VALUES(14, 0, 0, 'Mode.Forum.Layer.TidUp', 0, 0, 1, 0, '楼层广告[帖子上方]~\t~出现在帖子上方,一般以图片或文字显示,多条帖间广告时系统将随机选取一条显示', 'a:1:{s:7:\"display\";s:4:\"rand\";}');", "REPLACE INTO pw_advert VALUES(15, 0, 0, 'Mode.Forum.Layer.TidAmong', 0, 0, 1, 0, '楼层广告[楼层中间]~\t~出现在帖子楼层之间,一般以图片或文字显示,多条帖间广告时系统将随机选取一条显示', 'a:1:{s:7:\"display\";s:4:\"rand\";}');", "REPLACE INTO pw_advert VALUES(16, 0, 0, 'Mode.Layer.Index', 0, 0, 1, 0, '论坛首页分类间~\t~出现在首页分类层之间,一般以图片或文字显示,多条帖间广告时系统将随机选取一条显示', 'a:1:{s:7:\"display\";s:4:\"rand\";}');", "REPLACE INTO pw_advert VALUES(23, 0, 0, 'Mode.Forum.Layer.area.ThreadTop', 0, 0, 1, 0, '门户帖子列表页右上~\t~帖子列表页门户模式浏览时,右上方的广告位', 'a:1:{s:7:\"display\";s:4:\"rand\";}');", "REPLACE INTO pw_advert VALUES(24, 0, 0, 'Mode.Forum.Layer.area.ThreadBtm', 0, 0, 1, 0, '门户帖子列表页右下~\t~帖子列表页门户模式浏览时,右下方的广告位', 'a:1:{s:7:\"display\";s:4:\"rand\";}');", "REPLACE INTO pw_advert VALUES(25, 0, 0, 'Mode.Forum.Layer.area.ReadTop', 0, 0, 1, 0, '门户帖子内容页右上~\t~帖子内容页门户模式浏览时,右上方的广告位', 'a:1:{s:7:\"display\";s:4:\"rand\";}');", "REPLACE INTO pw_advert VALUES(26, 0, 0, 'Mode.Forum.Layer.area.ReadBtm', 0, 0, 1, 0, '门户帖子内容页右下~\t~帖子内容页门户模式浏览时,右下方的广告位', 'a:1:{s:7:\"display\";s:4:\"rand\";}');", "REPLACE INTO pw_advert VALUES(30, 2, 0, 'Wap.Header', 0, 0, 1, 0, 'WAP头部~\t~显示在WAP头部,可以是图片或文字,存在多条广告时将全部显示', 'a:1:{s:7:\"display\";s:3:\"all\";}');", "REPLACE INTO pw_advert VALUES(31, 2, 0, 'Wap.Footer', 0, 0, 1, 0, 'WAP底部~\t~显示在WAP底部,可以是图片或文字,存在多条广告时将全部显示', 'a:1:{s:7:\"display\";s:3:\"all\";}');", "REPLACE INTO pw_advert VALUES(32, 2, 0, 'Wap.Read.Header', 0, 0, 1, 0, 'WAP帖子内容顶部~\t~显示在WAP帖子内容顶部,可以是图片或文字,存在多条广告时将全部显示', 'a:1:{s:7:\"display\";s:3:\"all\";}');", "REPLACE INTO pw_advert VALUES(33, 2, 0, 'Wap.Read.Footer', 0, 0, 1, 0, 'WAP帖子内容底部~\t~显示在WAP帖子内容底部,可以是图片或文字,存在多条广告时将全部显示', 'a:1:{s:7:\"display\";s:3:\"all\";}');", "REPLACE INTO `pw_advert` (`id`, `type`, `uid`, `ckey`, `stime`, `etime`, `ifshow`, `orderby`, `descrip`, `config`) VALUES\n(27, 0, 0, 'Site.Search.Thread.Right', 0, 0, 1, 0, '搜索帖子右侧广告~\t~搜索帖子时,显示在页面的右侧', 'a:1:{s:7:\"display\";s:4:\"rand\";}');", "REPLACE INTO `pw_advert` (`id`, `type`, `uid`, `ckey`, `stime`, `etime`, `ifshow`, `orderby`, `descrip`, `config`) VALUES\n(28, 0, 0, 'Site.Search.Diary.Right', 0, 0, 1, 0, '搜索日志右侧广告~\t~搜索日志时,显示在页面的右侧', 'a:1:{s:7:\"display\";s:4:\"rand\";}');", "REPLACE INTO `pw_advert` (`id`, `type`, `uid`, `ckey`, `stime`, `etime`, `ifshow`, `orderby`, `descrip`, `config`) VALUES\n(29, 0, 0, 'Site.u.IndexCenter', 0, 0, 1, 0, '个人中心首页广告位~\t~', 'a:1:{s:7:\"display\";s:3:\"all\";}')");
foreach ($arrSQL as $sql) {
if (trim($sql)) {
$db->update($sql);
}
}
$arrUpdate = array('Site.NavBanner' => 'Site.NavBanner1', 'Mode.Layer.TidRight' => 'Mode.Forum.Layer.TidRight', 'Mode.Layer.TidDown' => 'Mode.Forum.Layer.TidDown', 'Mode.Layer.TidUp' => 'Mode.Forum.Layer.TidUp', 'Mode.Layer.TidAmong' => 'Mode.Forum.Layer.TidAmong');
foreach ($arrUpdate as $key => $value) {
$db->update("UPDATE pw_advert SET ckey=" . pwEscape($value, false) . "WHERE ckey=" . pwEscape($key, false));
}
示例7: foreach
if (!S::inArray($key, $fids)) {
$addSQL[$key]['fid'] = $key;
$addSQL[$key]['vieworder'] = $vieworder;
} else {
if ($vieworder !== $forumDB[$key]['vieworder']) {
$updateArr[$key]['vieworder'] = $vieworder;
}
}
}
foreach ($order as $key => $value) {
//用于delect
if (S::inArray($key, $fids)) {
!$fidcommend[$key] && ($delSQL[$key] = $key);
}
}
$addSQL && $db->update("REPLACE INTO pw_searchforum (fid,vieworder) VALUES " . pwSqlMulti($addSQL));
if ($updateArr) {
foreach ($updateArr as $key => $value) {
$value && $db->update("UPDATE pw_searchforum SET " . pwSqlSingle($value) . " WHERE fid=" . pwEscape($key, false));
}
}
$delSQL && $db->update("DELETE FROM pw_searchforum WHERE fid IN(" . pwImplode($delSQL) . ")");
//if ($addSQL || $updateArr || $delSQL) {
updatecache_search();
//}
adminmsg('operate_success', "{$basename}&action=forum");
} elseif ($action == 'statistic') {
s::gp(array('keyword', 'createtime_s', 'createtime_e'));
$createtime_s = $createtime_s ? $createtime_s : get_date($timestamp - 7 * 24 * 3600, 'Y-m-d');
$createtime_e = $createtime_e ? $createtime_e : get_date($timestamp, 'Y-m-d');
$addsql = '';
示例8: pw_topictype
}
if ($typedb) {
$db->update("REPLACE INTO pw_topictype (fid,name,vieworder) VALUES " . pwSqlMulti($typedb));
}
//增加二级新分类
foreach ($new_t_sub_db as $key => $value) {
foreach ($value as $k => $v) {
if (empty($v)) {
continue;
}
$v = str_replace(array('..', ')', '<', '='), array('..', ')', '<', '='), $v);
$subtypedb[] = array('fid' => $fid, 'name' => $v, 'vieworder' => $new_t_sub_view_db[$key][$k], 'upid' => $key);
}
}
if ($subtypedb) {
$db->update("REPLACE INTO pw_topictype (fid,name,vieworder,upid) VALUES " . pwSqlMulti($subtypedb));
}
require_once R_P . 'admin/cache.php';
if ($addtpctype != $forumset['addtpctype']) {
$forumset['addtpctype'] = $addtpctype;
$forumset = serialize($forumset);
if ($foruminfo['fid']) {
$db->update('UPDATE pw_forumsextra SET forumset=' . pwEscape($forumset) . ' WHERE fid=' . pwEscape($fid));
} else {
$db->update('INSERT INTO pw_forumsextra SET ' . pwSqlSingle(array('fid' => $fid, 'forumset' => $forumset)));
}
updatecache_forums($fid);
}
$foruminfo = L::forum($fid);
if ($t_type != $foruminfo['t_type']) {
$db->update("UPDATE pw_forums SET " . pwSqlSingle(array('t_type' => $t_type)));
示例9: pwEscape
if ($md_ifopen && $userdb['medals']) {
include_once D_P . 'data/bbscache/medaldb.php';
$query = $db->query("SELECT id,awardee,level FROM pw_medalslogs WHERE awardee=" . pwEscape($userdb['username'], false) . " AND action='1' AND state='0' AND timelimit>0 AND {$timestamp}-awardtime>timelimit*2592000");
if ($db->num_rows($query)) {
include_once R_P . 'require/msg.php';
$reason = Char_cv(getLangInfo('other', 'medal_reason'));
$ids = $medals = $medalslog = array();
while ($rt = $db->fetch_array($query)) {
$ids[] = $rt['id'];
$medals[] = $rt['level'];
$medalslog[] = array($rt['awardee'], 'SYSTEM', $timestamp, $rt['level'], 2, $reason);
$message = array('toUser' => $rt['awardee'], 'subject' => 'metal_cancel', 'content' => 'metal_cancel_text', 'other' => array('medalname' => $_MEDALDB[$rt['level']]['name']));
pwSendMsg($message);
}
if ($ids) {
$db->update("INSERT INTO pw_medalslogs(awardee,awarder,awardtime,level,action,why) VALUES " . pwSqlMulti($medalslog, false));
$db->update("UPDATE pw_medalslogs SET state='1' WHERE id IN(" . pwImplode($ids) . ")");
$userdb['medals'] = explode(',', $userdb['medals']);
$userdb['medals'] = array_diff($userdb['medals'], $medals);
$userdb['medals'] = implode(',', $userdb['medals']);
$db->update("UPDATE pw_members SET medals=" . pwEscape($userdb['medals'], false) . " WHERE uid=" . pwEscape($userdb['uid'], false));
$db->update('DELETE FROM pw_medaluser WHERE uid=' . pwEscape($userdb['uid'], false) . ' AND mid IN(' . pwImplode($medals) . ')');
updatemedal_list();
}
}
$userdb['medals'] = explode(',', $userdb['medals']);
}
$usercredit = array('postnum' => $userdb['postnum'], 'digests' => $userdb['digests'], 'rvrc' => $userdb['rvrc'], 'money' => $userdb['money'], 'credit' => $userdb['credit'], 'currency' => $userdb['currency'], 'onlinetime' => $userdb['onlinetime']);
foreach ($credit->get($userdb['uid'], 'CUSTOM') as $key => $value) {
$usercredit[$key] = $value;
}
示例10: Char_cv
$forums[$key]['title'] = $value['title'] = Char_cv(strip_tags($value['title']));
$forums[$key]['descrip'] = $value['descrip'] = Char_cv(strip_tags($value['descrip']));
$forums[$key]['keywords'] = $value['keywords'] = Char_cv(strip_tags($value['keywords']));
if ($forum[$key]['title'] != $value['title'] || $forum[$key]['descrip'] != $value['descrip'] || $forum[$key]['keywords'] != $value['keywords']) {
$db->update("UPDATE pw_forums SET title=" . pwEscape($value['title']) . ",metadescrip=" . pwEscape($value['descrip']) . ",keywords=" . pwEscape($value['keywords']) . " WHERE fid = " . pwEscape($key));
}
}
updatecache_f();
$db_bbstitle = array('index' => Char_cv(strip_tags($contents['title_index'])), 'thread' => Char_cv(strip_tags($contents['title_thread'])), 'read' => Char_cv(strip_tags($contents['title_read'])));
$db_metadescrip = array('index' => Char_cv(strip_tags($contents['metadesc_index'])), 'thread' => Char_cv(strip_tags($contents['metadesc_thread'])), 'read' => Char_cv(strip_tags($contents['metadesc_read'])));
$db_metakeyword = array('index' => Char_cv(strip_tags($contents['metakeyword_index'])), 'thread' => Char_cv(strip_tags($contents['metakeyword_thread'])), 'read' => Char_cv(strip_tags($contents['metakeyword_read'])));
$config = array();
$config[] = array('db_name' => $db_names[0], 'vtype' => 'array', 'db_value' => serialize($db_bbstitle));
$config[] = array('db_name' => $db_names[1], 'vtype' => 'array', 'db_value' => serialize($db_metadescrip));
$config[] = array('db_name' => $db_names[2], 'vtype' => 'array', 'db_value' => serialize($db_metakeyword));
$sql = "REPLACE INTO pw_config (db_name,vtype,db_value) VALUES " . pwSqlMulti($config);
$db->update($sql);
updatecache_c();
$basename = $basename . '&mode=' . $mode;
adminmsg('operate_success');
} else {
if (!file_exists(D_P . 'data/bbscache/config.php') || !isset($db_bbstitle) || !isset($db_metadescrip) || !isset($db_metakeyword)) {
$sql = "SELECT * FROM pw_config WHERE db_name IN ( " . pwImplode($db_names) . " ) ";
$query = $db->query($sql);
while ($rt = $db->fetch_array($query)) {
${$rt['db_name']} = unserialize($rt['db_value']);
}
}
$config['title'] = is_array(${$db_names[0]}) ? ${$db_names[0]} : array('index' => ${$db_names[0]}, 'thread' => ${$db_names[0]}, 'read' => ${$db_names[0]});
$config['metadescrip'] = is_array(${$db_names[1]}) ? ${$db_names[1]} : array('index' => ${$db_names[1]}, 'thread' => ${$db_names[1]}, 'read' => ${$db_names[1]});
$config['metakeyword'] = is_array(${$db_names[2]}) ? ${$db_names[2]} : array('index' => ${$db_names[2]}, 'thread' => ${$db_names[2]}, 'read' => ${$db_names[2]});
示例11: validator_submit_task
if ('add' == $action) {
/* 新增提交 */
$task = validator_submit_task($data);
if (!isset($task['error']) && isset($task['ret'])) {
/* 验证成功 */
$ret = $task['ret'];
if (is_array($ret['owners'])) {
for ($i = 0; $i < sizeof($ret['owners']); $i++) {
// 默认字段
$ret['publisher_id'] = $winduid;
$ret['create_time'] = time();
$ret['modify_time'] = time();
$ret['owner_id'] = $ret['owners'][$i];
$ret_temp = $ret;
array_shift($ret_temp);
$temp[] = pwSqlMulti(array($ret_temp));
}
$temp = implode(',', $temp);
// 组装SQL
$sql = 'INSERT INTO pw_teamtasks (pid,taskname,owner,priority,plan_start_time,plan_end_time,real_start_time,real_end_time,remark,content,status,publisher_id,create_time,modify_time,owner_id) VALUES' . $temp;
// 写入数据
$db->update($sql);
$tid = $db->insert_id();
// 写入结果
if (!empty($tid) && is_numeric($tid) && 0 < $tid) {
// 是否关联修改项目的实际开始时间
if (0 < $ret['pid'] && 0 < $ret['real_start_time']) {
$sql = 'SELECT COUNT(*) AS cnt FROM pw_teamtasks WHERE pid = ' . $ret['pid'];
$rs = $db->get_one($sql);
if (1 == $rs['cnt']) {
$sql = 'UPDATE pw_teamprojects SET real_start_time = ' . $ret['real_start_time'] . ' WHERE pid = ' . $ret['pid'];
示例12: foreach
$threadList->refreshThreadIdsByForumId($fid);
}
foreach ($ttable_a as $pw_tmsgs => $val) {
$val = pwImplode($val);
$db->update("UPDATE {$pw_tmsgs} SET remindinfo=" . pwEscape($remindinfo) . "WHERE tid IN({$val})");
}
if (!empty($selids) && !empty($selForums)) {
$_topped = array();
if ($topped) {
foreach ($selForums as $_forum) {
foreach ($selids as $_tid) {
$_topped[] = array('fid' => $_forum, 'tid' => $_tid, 'pid' => '0', 'floor' => $topped, 'uptime' => $tid_fid[$_tid], 'overtime' => $toolfield);
}
}
$db->update("DELETE FROM pw_poststopped WHERE pid = '0' AND fid != '0' AND tid IN (" . pwImplode($selids) . ")");
$db->update("REPLACE INTO pw_poststopped (fid,tid,pid,floor,uptime,overtime) values " . pwSqlMulti($_topped));
} else {
$db->update("DELETE FROM pw_poststopped WHERE fid IN(" . pwImplode($selForums) . ") \r\n\t\t\t\t\t\t\t AND tid IN (" . pwImplode($selids) . ") AND pid = '0' ");
}
}
updatetop();
delfcache($fid, $db_fcachenum);
/*置顶印戳*/
if ($overprint) {
/*过滤取消置顶*/
$seltid = $seltid ? $seltid : $threadIds;
overPrint($overprint, $seltid, 'headtopic');
defined('AJAX') && showOverPrint($overprint, $seltid, 'headtopic', 1, $nextto);
}
if ($nextto && count($tidarray) == 1) {
$selids = reset($tidarray);
示例13: writeLog
function writeLog()
{
if (!empty($this->cLog)) {
$GLOBALS['db']->update("INSERT INTO pw_creditlog (uid,username,ctype,affect,adddate,logtype,ip,descrip) VALUES " . pwSqlMulti($this->cLog, false));
}
$this->cLog = array();
}
示例14: updateOnlineInfo
/**
* 更新在线信息
* @return void
*/
function updateOnlineInfo()
{
global $tdtime, $timestamp, $userinbbs, $guestinbbs;
$typeid = pwEscape(get_date($this->t, 'G'));
$date = pwEscape(get_date($this->t, 'Y-m-d'));
$userinbbs = intval($userinbbs);
$guestinbbs = intval($guestinbbs);
$this->_db->update("REPLACE INTO `pw_statistics_daily` (`name`,`typeid`,`date`,`value`,`updatetime`)\n\t\t\t\tVALUES('userinbbs',{$typeid},{$date},{$userinbbs},{$this->t}),\n\t\t\t\t('guestinbbs',{$typeid},{$date},{$guestinbbs},{$this->t})\n\t\t\t");
$lastday = pwEscape(get_date($tdtime - 86400, 'Y-m-d'));
$this->_db->update("DELETE FROM `pw_statistics_daily` WHERE (name='userinbbs' OR name='guestinbbs') AND `date`<{$lastday}");
//$this->_db->update("UPDATE `pw_bbsinfo` SET `last_statistictime`=$this->t WHERE id=1");
pwQuery::update('pw_bbsinfo', 'id=:id', array(1), array('last_statistictime' => $this->t));
/*归总前日登录数*/
if (procLock('statisticLogin')) {
$query = $this->_db->query("SELECT COUNT(`typeid`) AS `value`,`date` FROM `pw_statistics_daily` \n\t\t\t\tWHERE name='login' AND `typeid`>0 AND `date`<'{$this->day}'\n\t\t\t\tGROUP BY `date`");
$logins = array();
while ($rt = $this->_db->fetch_array($query)) {
$rt['typeid'] = 0;
$rt['name'] = 'login';
$rt['updatetime'] = $timestamp;
$logins[$rt['date']] = $rt;
}
$cnt = count($logins);
if ($cnt > 0) {
$this->_db->update("REPLACE INTO `pw_statistics_daily` (`value`,`date`,`typeid`,`name`,`updatetime`) VALUE " . pwSqlMulti($logins));
$this->_db->affected_rows() == $cnt && $this->_db->query("DELETE FROM `pw_statistics_daily` WHERE `name`='login' AND `date`<'{$this->day}' AND `typeid`>0");
}
procUnLock('statisticLogin');
}
}
示例15: insert_tag
function insert_tag($tid, $tags)
{
global $db;
$sql = array();
$tags = explode(" ", $tags);
foreach ($tags as $key => $value) {
if (!$value) {
continue;
}
$rt = $db->get_one("SELECT tagid FROM pw_tags WHERE tagname=" . pwEscape($value));
if (!$rt) {
$db->update("INSERT INTO pw_tags SET " . pwSqlSingle(array('tagname' => $value, 'num' => 1)));
$tagid = $db->insert_id();
} else {
$tagid = $rt['tagid'];
$db->update("UPDATE pw_tags SET num=num+1 WHERE tagid=" . pwEscape($tagid));
}
$sql[] = array($tagid, $tid);
}
$sql && $db->update("INSERT INTO pw_tagdata (tagid,tid) VALUES " . pwSqlMulti($sql));
}