本文整理汇总了PHP中pwQuery::buildClause方法的典型用法代码示例。如果您正苦于以下问题:PHP pwQuery::buildClause方法的具体用法?PHP pwQuery::buildClause怎么用?PHP pwQuery::buildClause使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pwQuery
的用法示例。
在下文中一共展示了pwQuery::buildClause方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: increase
function increase($userId, $increments)
{
$userId = intval($userId);
if ($userId <= 0 || !is_array($increments)) {
return 0;
}
$incrementStatement = array();
foreach ($increments as $field => $offset) {
$offset = intval($offset);
if (!$offset) {
continue;
}
if ($offset < 0) {
$incrementStatement[] = $field . "=" . $field . $offset;
} else {
$incrementStatement[] = $field . "=" . $field . "+" . $offset;
}
}
if (empty($incrementStatement)) {
return 0;
}
//* $this->_db->update("UPDATE " . $this->_tableName . " SET " . implode(", ", $incrementStatement) . " WHERE uid=" . $this->_addSlashes($userId));
$this->_db->update(pwQuery::buildClause("UPDATE :pw_table SET " . implode(", ", $incrementStatement) . " WHERE uid=:uid", array($this->_tableName, $userId)));
return $this->_db->affected_rows();
}
示例2: reduceReplyNumByCommentid
function reduceReplyNumByCommentid($num, $commentid)
{
$num = intval($num);
$commentid = intval($commentid);
if ($num < 1 || $commentid < 1) {
return false;
}
return $this->_db->update(pwQuery::buildClause("UPDATE :pw_table SET replynum=replynum-" . S::sqlEscape($num) . ' WHERE commentid=:commentid', array($this->_tableName, $commentid)));
}
示例3: delUserByIds
function delUserByIds($uids)
{
if (!is_array($uids) || !count($uids)) {
return;
}
$userService = $this->_getUserService();
$userService->deletes($uids);
$count = $userService->count();
$lastestUser = $userService->getLatestNewUser();
//* $this->db->update("UPDATE pw_bbsinfo SET newmember=" . S::sqlEscape($lastestUser['username']) . ',totalmember=' . S::sqlEscape($count) . " WHERE id='1'");
$this->db->update(pwQuery::buildClause("UPDATE :pw_table SET newmember=:newmember,totalmember=:totalmember WHERE id=:id", array('pw_bbsinfo', $lastestUser['username'], $count)));
}
示例4: updateReplynumByCommentid
/**
* 更新
*
* @param int $commentid
* @param array $fieldsData
* @return boolean
*/
function updateReplynumByCommentid($exp = '+1', $commentid)
{
$commentid = intval($commentid);
if ($commentid < 1 || !$exp) {
return false;
}
$num = intval(trim($exp, '+-'));
if (strpos($exp, '+') !== false) {
return $this->_db->update(pwQuery::buildClause("UPDATE :pw_table SET replynum=replynum+" . S::sqlEscape($num) . ' WHERE commentid=:commentid', array($this->_tableName, $commentid)));
} else {
return $this->_db->update(pwQuery::buildClause("UPDATE :pw_table SET replynum=replynum-" . S::sqlEscape($num) . ' WHERE commentid=:commentid', array($this->_tableName, $commentid)));
}
return false;
}
示例5: addSpreads
/**
* 批量增加套餐信息
* @param array $fieldData
* @return bool
*/
function addSpreads($fieldData)
{
if (!S::isArray($fieldData)) {
return false;
}
$data = array();
foreach ($fieldData as $value) {
$value = $this->_checkAllowField($value, $this->_allowFields);
if (!S::isArray($value)) {
continue;
}
$data[] = $value;
}
if (!S::isArray($data)) {
return false;
}
return $this->_db->query(pwQuery::buildClause('INSERT INTO :table VALUES :data', array($this->_tableName, S::sqlMulti($data))));
}
示例6: elseif
exit;
} elseif ($_POST['action'] == 'submit') {
S::gp(array('selid'), 'P');
$_tmpSelid = $selid;
$selid = checkselid($selid);
if ($selid === false) {
$basename = "javascript:history.go(-1);";
adminmsg('operate_error');
} elseif ($selid == '') {
//* $db->update("UPDATE pw_forums SET allowhtm='0' $sqladd");
$db->update(pwQuery::buildClause("UPDATE :pw_table SET allowhtm='0' {$sqladd}", array('pw_forums')));
} elseif ($selid) {
//* $db->update("UPDATE pw_forums SET allowhtm='1' $sqladd AND fid IN($selid)");
//* $db->update("UPDATE pw_forums SET allowhtm='0' $sqladd AND fid NOT IN($selid)");
$db->update(pwQuery::buildClause("UPDATE :pw_table SET allowhtm='1' {$sqladd} AND fid IN(:fid)", array('pw_forums', $_tmpSelid)));
$db->update(pwQuery::buildClause("UPDATE :pw_table SET allowhtm='0' {$sqladd} AND fid NOT IN(:fid)", array('pw_forums', $_tmpSelid)));
}
updatecache_f();
adminmsg('operate_success');
} elseif ($action == 'creat') {
@set_time_limit(0);
$pwServer['REQUEST_METHOD'] != 'POST' && PostCheck($verify);
S::gp(array('creatfid', 'percount', 'step', 'tfid', 'forumnum'));
$fids = $tid = $fieldadd = $tableadd = $tids = '';
!is_array($creatfid) && ($creatfid = explode(',', $creatfid));
if (in_array('all', $creatfid)) {
$query = $db->query("SELECT fid FROM pw_forums {$sqladd} AND allowhtm='1'");
while ($rt = $db->fetch_array($query)) {
$fids .= ($fids ? ',' : '') . $rt['fid'];
}
$creatfid = explode(',', $fids);
示例7: countPosts
/**
* 圈子中各种用户发表信息统计,记录、分享、群组、相册、回复等
*
* @param string $exp 表达式,包含+或-符号
*/
function countPosts($exp = '+1')
{
global $db;
$num = intval(trim($exp, '+-'));
if (strpos($exp, '+') !== false) {
//* $db->update("UPDATE pw_bbsinfo SET o_post=o_post+".S::sqlEscape($num,false).",o_tpost=o_tpost+".S::sqlEscape($num,false));
$db->update(pwQuery::buildClause("UPDATE :pw_table SET o_post=o_post+:o_post, o_tpost=o_tpost+:o_tpost", array('pw_bbsinfo', $num, $num)));
} else {
//* $db->update("UPDATE pw_bbsinfo SET o_post=o_post-".S::sqlEscape($num,false).",o_tpost=o_tpost-".S::sqlEscape($num,false));
$db->update(pwQuery::buildClause("UPDATE :pw_table SET o_post=o_post-:o_post, o_tpost=o_tpost-:o_tpost", array('pw_bbsinfo', $num, $num)));
}
}
示例8: _mergeThreads
function _mergeThreads(&$tmp, $toid, $fromid, $cydb)
{
if ($cydb[$toid]['classid'] == $cydb[$fromid]['classid']) {
//$this->_db->update("UPDATE pw_argument a LEFT JOIN pw_threads b ON a.tid=b.tid SET a.cyid=" . S::sqlEscape($toid) . " WHERE a.cyid=" . S::sqlEscape($fromid));
$this->_db->update(pwQuery::buildClause("UPDATE :pw_table1 a LEFT JOIN :pw_table2 b ON a.tid=b.tid SET a.cyid=:cyidx WHERE a.cyid=:cyid", array('pw_argument', 'pw_threads', $toid, $fromid)));
$tmp['tnum'] = $this->_db->affected_rows();
$tmp['pnum'] = $cydb[$fromid]['pnum'];
} else {
global $db_plist;
$ptable_a = array('pw_posts');
if ($db_plist) {
foreach ($db_plist as $key => $val) {
$key > 0 && ($ptable_a[] = 'pw_posts' . $key);
}
}
$pnum = 0;
foreach ($ptable_a as $val) {
$this->_db->update("UPDATE pw_argument a LEFT JOIN {$val} b ON a.tid=b.tid SET b.fid=" . S::sqlEscape($cydb[$toid]['classid']) . " WHERE a.cyid=" . S::sqlEscape($fromid));
$pnum += $this->_db->affected_rows();
}
$this->_db->update("UPDATE pw_argument a LEFT JOIN pw_attachs b ON a.tid=b.tid SET b.fid=" . S::sqlEscape($cydb[$toid]['classid']) . " WHERE a.cyid=" . S::sqlEscape($fromid));
//$this->_db->update("UPDATE pw_argument a LEFT JOIN pw_threads b ON a.tid=b.tid SET a.cyid=" . S::sqlEscape($toid) . ",b.fid=" . S::sqlEscape($cydb[$toid]['classid']) . " WHERE a.cyid=" . S::sqlEscape($fromid));
$this->_db->update(pwQuery::buildClause("UPDATE :pw_table1 a LEFT JOIN :pw_table2 b ON a.tid=b.tid SET a.cyid=:cyidx, b.fid=:bid WHERE a.cyid=:cyid", array('pw_argument', 'pw_threads', $toid, $cydb[$toid]['classid'], $fromid)));
$tnum = $this->_db->affected_rows();
$tmp['tnum'] = $tnum;
$tmp['pnum'] = $pnum + $tnum;
require_once R_P . 'require/updateforum.php';
updateForumCount($cydb[$toid]['classid'], $tnum, $pnum);
updateForumCount($cydb[$fromid]['classid'], -$tnum, -$pnum);
}
}
示例9: substrs
$lt = $db->get_one("SELECT tid,author,postdate,lastpost,lastposter,subject FROM pw_threads WHERE fid=" . S::sqlEscape($fid) . "AND specialsort=0 AND ifcheck=1 AND lastpost>0 ORDER BY lastpost DESC LIMIT 0,1");
if ($lt['tid']) {
$lt['subject'] = substrs($lt['subject'], 21);
if ($lt['postdate'] != $lt['lastpost']) {
$lt['subject'] = 'Re:' . $lt['subject'];
$add = '&page=e#a';
}
$toread = $cms ? '&toread=1' : '';
$htmurl = $db_readdir . '/' . $fid . '/' . date('ym', $lt['postdate']) . '/' . $lt['tid'] . '.html';
$new_url = file_exists(R_P . $htmurl) && $allowhtm == 1 && !$cms ? "{$R_url}/{$htmurl}" : "read.php?tid={$lt['tid']}{$toread}{$add}";
$lastinfo = addslashes(S::escapeChar($lt['subject']) . "\t" . $lt['lastposter'] . "\t" . $lt['lastpost'] . "\t" . $new_url);
} else {
$lastinfo = '';
}
//* $db->update("UPDATE pw_forumdata SET topic=".S::sqlEscape($topic).',article=article+'.S::sqlEscape($article).',lastpost='.S::sqlEscape($lastinfo).' WHERE fid='.S::sqlEscape($fid));
$db->update(pwQuery::buildClause("UPDATE :pw_table SET topic=:topic, article=article+:article,lastpost=:lastpost WHERE fid=:fid", array('pw_forumdata', $topic, $article, $lastinfo, $fid)));
}
if ($goon) {
adminmsg('updatecache_step', EncodeUrl($j_url));
} else {
adminmsg('operate_success');
}
} elseif ($action == 'thread') {
$pwServer['REQUEST_METHOD'] != 'POST' && PostCheck($verify);
S::gp(array('step', 'percount'));
!$step && ($step = 1);
!$percount && ($percount = 300);
$start = ($step - 1) * $percount;
$next = $start + $percount;
$step++;
$j_url = "{$basename}&action={$action}&step={$step}&percount={$percount}";
示例10: _insertUser
function _insertUser()
{
global $timestamp, $onlineip, $credit;
/**
$pwSQL = S::sqlSingle(array(
'uid' => $this->uid,
'username' => $this->data['username'],
'password' => $this->data['password'],
'safecv' => $this->data['safecv'],
'email' => $this->data['email'],
'groupid' => $this->data['groupid'],
'memberid' => $this->data['memberid'],
'regdate' => $timestamp,
'yz' => $this->data['yz'],
'userstatus' => $this->data['userstatus'],
'newpm' => 0
));
$this->db->update("REPLACE INTO pw_members SET $pwSQL");
**/
$pwSQL = array('uid' => $this->uid, 'username' => $this->data['username'], 'password' => $this->data['password'], 'safecv' => $this->data['safecv'], 'email' => $this->data['email'], 'groupid' => $this->data['groupid'], 'memberid' => $this->data['memberid'], 'regdate' => $timestamp, 'yz' => $this->data['yz'], 'userstatus' => $this->data['userstatus'], 'newpm' => 0);
pwQuery::replace('pw_members', $pwSQL);
/**
$pwSQL = S::sqlSingle(array(
'uid' => $this->uid,
'postnum' => 0,
'lastvisit' => $timestamp,
'thisvisit' => $timestamp,
'onlineip' => $onlineip
));
$this->db->pw_update(
'SELECT uid FROM pw_memberdata WHERE uid=' . S::sqlEscape($this->uid),
'UPDATE pw_memberdata SET ' . $pwSQL . ' WHERE uid=' . S::sqlEscape($this->uid),
'INSERT INTO pw_memberdata SET ' . $pwSQL
);
**/
$pwSQL = array('uid' => $this->uid, 'postnum' => 0, 'lastvisit' => $timestamp, 'thisvisit' => $timestamp, 'onlineip' => $onlineip);
$this->db->pw_update('SELECT uid FROM pw_memberdata WHERE uid=' . S::sqlEscape($this->uid), pwQuery::updateClause('pw_memberdata', 'uid =:uid', array($this->uid), $pwSQL), pwQuery::insertClause('pw_memberdata', $pwSQL));
//$this->db->update("REPLACE INTO pw_memberdata SET $pwSQL");
require_once R_P . 'require/credit.php';
$credit->addLog('reg_register', L::reg('rg_regcredit'), array('uid' => $this->uid, 'username' => stripslashes($this->data['username']), 'ip' => $onlineip));
$credit->sets($this->uid, L::reg('rg_regcredit'), false);
$credit->runsql();
//* $this->db->update("UPDATE pw_bbsinfo SET newmember=" . S::sqlEscape($this->data['username']) . ",totalmember=totalmember+1 WHERE id='1'");
$this->db->update(pwQuery::buildClause("UPDATE :pw_table SET newmember=:newmember,totalmember=totalmember+1 WHERE id=:id", array('pw_bbsinfo', $this->data['username'], 1)));
$this->memberinfo or $this->memberinfo['uid'] = $this->uid;
if ($this->memberinfo) {
/**
$this->db->update("REPLACE INTO pw_memberinfo SET uid=" . S::sqlEscape($this->uid) . ',' . S::sqlSingle($this->memberinfo));
**/
$_temp = array('uid' => $this->uid) + $this->memberinfo;
pwQuery::replace('pw_memberinfo', $_temp);
}
$statistics = L::loadClass('Statistics', 'datanalyse');
$statistics->register();
}
示例11: exit
<?php
!function_exists('readover') && exit('Forbidden');
$query = $db->query("SELECT id,uid,fid FROM pw_banuser WHERE type='1' AND startdate+days*86400<" . S::sqlEscape($timestamp));
$ids = $uids1 = $uids2 = array();
while ($rt = $db->fetch_array($query)) {
$ids[] = $rt['id'];
if ($rt['fid']) {
$uids2[] = $rt['uid'];
} else {
$uids1[] = $rt['uid'];
}
}
if ($ids) {
$userService = L::loadClass('UserService', 'user');
/* @var $userService PW_UserService */
$db->update("DELETE FROM pw_banuser WHERE id IN(" . S::sqlImplode($ids) . ")");
$uids1 && $userService->updates($uids1, array('groupid' => -1));
/**
$uids2 && $db->update("UPDATE pw_members m LEFT JOIN pw_banuser b ON m.uid=b.uid AND b.fid>0 SET m.userstatus=m.userstatus&(~1) WHERE b.uid is NULL AND m.uid IN(".S::sqlImplode($uids2).")");
**/
$uids2 && $db->update(pwQuery::buildClause("UPDATE :pw_table m LEFT JOIN pw_banuser b ON m.uid=b.uid AND b.fid>0 SET m.userstatus=m.userstatus&(~1) WHERE b.uid is NULL AND m.uid IN(:uid)", array('pw_members', $uids2)));
}
示例12: deletePing
/**
* 取消评分
* @param $tid
* @param $pids
* @param $params
*/
function deletePing($params = array())
{
global $groupid, $windid, $winduid, $credit, $onlineip, $timestamp, $gp_gptype;
//* $threadService = L::loadClass("threads", 'forum');
require_once R_P . 'require/credit.php';
foreach ($this->postData as $pid => $atc) {
$rpid = $pid == 'tpc' ? '0' : $pid;
// delete pinglog
$pingdata = $this->db->get_one('SELECT * FROM pw_pinglog WHERE tid=' . S::sqlEscape($this->tid) . ' AND pid=' . S::sqlEscape($rpid) . ' AND pinger=' . S::sqlEscape($windid) . ' ORDER BY pingdate DESC LIMIT 1');
//$this->db->update('DELETE FROM pw_pinglog WHERE id=' . S::sqlEscape($pingdata['id']));
pwQuery::delete('pw_pinglog', 'id=:id', array($pingdata['id']));
$this->update_markinfo($this->tid, $rpid);
//* $threadService->clearTmsgsByThreadId($this->tid);
Perf::gatherInfo('changeTmsgWithThreadIds', array('tid' => $this->tid));
$addpoint = $pingdata['point'];
if (!($cid = $credit->getCreditTypeByName($pingdata['name']))) {
continue;
}
$cName = $credit->cType[$cid];
$addpoint = $addpoint > 0 ? -$addpoint : abs($addpoint);
!$atc['subject'] && ($atc['subject'] = substrs(strip_tags(convert($atc['content'])), 35));
$credit->addLog('credit_delping', array($cid => $addpoint), array('uid' => $atc['authorid'], 'username' => $atc['author'], 'ip' => $onlineip, 'operator' => $windid, 'tid' => $this->tid, 'subject' => $atc['subject'], 'reason' => $params['atc_content']));
$credit->set($atc['authorid'], $cid, $addpoint);
if (!is_numeric($pid)) {
//* $this->db->update('UPDATE pw_threads SET ifmark=ifmark+'.S::sqlEscape($addpoint).' WHERE tid='.S::sqlEscape($tid));
$this->db->update(pwQuery::buildClause("UPDATE :pw_table SET ifmark=ifmark+:ifmark WHERE tid=:tid", array('pw_threads', $addpoint, $this->tid)));
}
if ($params['ifmsg'] && !$atc['anonymous'] && $atc['author'] != $windid) {
//发消息
$title = getLangInfo('writemsg', 'delping_title', array('sender' => $windid, 'receiver' => $atc['author']));
$content = getLangInfo('writemsg', 'delping_content', array('manager' => $windid, 'fid' => $atc['fid'], 'tid' => $this->tid, 'pid' => $pid, 'subject' => $atc['subject'], 'postdate' => get_date($atc['postdate']), 'forum' => strip_tags($this->forum->foruminfo['name']), 'affect' => "{$cName}:{$addpoint}", 'admindate' => get_date($timestamp), 'reason' => stripslashes($params['atc_content']), 'sender' => $windid, 'receiver' => $atc['author']));
$this->sendMessage($atc['author'], $title, $content);
}
if ($gp_gptype == 'system') {
require_once R_P . 'require/writelog.php';
$log = array('type' => 'credit', 'username1' => $atc['author'], 'username2' => $windid, 'field1' => $atc['fid'], 'field2' => '', 'field3' => '', 'descrip' => 'creditdel_descrip', 'timestamp' => $timestamp, 'ip' => $onlineip, 'tid' => $this->tid, 'forum' => strip_tags($this->forum->foruminfo['name']), 'subject' => $atc['subject'], 'affect' => "{$name}:{$addpoint}", 'reason' => $params['atc_content']);
writelog($log);
}
$pingLog[$pid] = $pingdata['id'];
}
$credit->runsql();
defined('AJAX') && ($GLOBALS['pingLog'] = $pingLog);
//GLOBAL
if ($this->forum->foruminfo['allowhtm'] && $_REQUEST['page'] == 1) {
$StaticPage = L::loadClass('StaticPage');
$StaticPage->update($this->tid);
}
return true;
}
示例13: array
$last = $db->get_one($sql);
# 更新主题的回复数,最后回复信息
//$sql = "UPDATE pw_threads SET replies=replies-".S::sqlEscape($num) . ",lastpost=" . S::sqlEscape($last['postdate'],false) . ",lastposter =" . S::sqlEscape($last['author'],false) . "WHERE tid=" . S::sqlEscape($tid);
$sql = pwQuery::buildClause('UPDATE :pw_table SET replies = replies - :replies, lastpost = :lastpost, lastposter = :lastposter WHERE tid = :tid', array('pw_threads', $num, $last['postdate'], $last['author'], $tid));
$db->update($sql);
# memcache refresh
// $threadList = L::loadClass("threadlist", 'forum');
// $threadList->updateThreadIdsByForumId($fid,$tid);
Perf::gatherInfo('changeThreadWithForumIds', array('fid' => $fid));
}
# 更新版块文章数
/**
$sql = "UPDATE pw_forumdata SET article=article-".S::sqlEscape($forum_count)." WHERE fid=".S::sqlEscape($fid);
$db->update($sql);
**/
$db->update(pwQuery::buildClause("UPDATE :pw_table SET article=article-:article WHERE fid=:fid", array('pw_forumdata', $forum_count, $fid)));
}
foreach ($db_threads as $tid => $thread) {
$toUser = array();
foreach ($thread as $post) {
$toUser[] = $post['author'];
}
$sql = "SELECT subject FROM pw_threads WHERE tid =" . S::sqlEscape($tid);
$subject = $db->get_value($sql);
M::sendNotice($toUser, array('title' => getLangInfo('writemsg', 'filtermsg_post_del_title'), 'content' => getLangInfo('writemsg', 'filtermsg_post_del_content', array('subject' => $subject))));
}
}
$delarticle->delReply($replydb, $db_recycle);
if (is_array($objid)) {
$filter_id = implode(',', $objid);
if ($filter_id) {
示例14: unserialize
$_cacheService = Perf::gatherCache('pw_space');
$tmp = $_cacheService->getSpaceByUid($winduid);
$tovisitors = $tmp['tovisitors'];
} else {
$tovisitors = $db->get_value("SELECT tovisitors FROM pw_space WHERE uid=" . S::sqlEscape($winduid));
}
$tovisitors = unserialize($tovisitors);
is_array($tovisitors) || ($tovisitors = array());
if (!isset($tovisitors[$uid]) || $timestamp - $tovisitors[$uid] > 900) {
$tovisitors[$uid] = $timestamp;
arsort($tovisitors);
if (count($tovisitors) > 12) {
array_pop($tovisitors);
}
//$db->update("UPDATE pw_space SET tovisits=tovisits+'1',tovisitors=" . S::sqlEscape(serialize($tovisitors),false) . " WHERE uid=" . S::sqlEscape($winduid));
$db->update(pwQuery::buildClause("UPDATE :pw_table SET tovisits=tovisits+1,tovisitors=:tovisitors WHERE uid=:uid", array('pw_space', serialize($tovisitors), $winduid)));
}
//猪头回收
$user_icon = explode('|', $space['icon']);
if ($user_icon[4] && $space['tooltime'] < $timestamp - 86400) {
$space['icon'] = "{$user_icon['0']}|{$user_icon['1']}|{$user_icon['2']}|{$user_icon['3']}|0";
/**
$db->update("UPDATE pw_members SET icon=".S::sqlEscape($space['icon'],false)." WHERE uid=".S::sqlEscape($space['uid']));
**/
pwQuery::update('pw_members', 'uid =:uid', array($space['uid']), array('icon' => $space['icon']));
}
}
$isSpace = true;
$spaceTemplate = "";
$spacestyle = $space['spacestyle'] === '2' || $space['spacestyle'] === '3' ? $space['spacestyle'] : 2;
$spaceTemplate = 'space_' . $spacestyle . '_index';
示例15: array
$msgdb[] = array('toUser' => $fromdb['author'], 'title' => getLangInfo('writemsg', 'unite_title', array('manager' => $windid)), 'content' => getLangInfo('writemsg', 'unite_content', array('manager' => $windid, 'fid' => $fid, 'tid' => $totid, 'subject' => $todb['subject'], 'postdate' => get_date($todb['postdate']), 'forum' => strip_tags($forum[$fid]['name']), 'admindate' => get_date($timestamp), 'reason' => stripslashes($atc_content))));
}
$log = array('type' => 'unite', 'username1' => $fromdb['author'], 'username2' => $windid, 'field1' => $fid, 'field2' => '', 'field3' => '', 'descrip' => 'unite_descrip', 'timestamp' => $timestamp, 'ip' => $onlineip, 'tid' => $totid, 'subject' => substrs($todb['subject'], 28), 'forum' => $forum[$fid]['name'], 'reason' => stripslashes($atc_content));
writelog($log);
$istucool && $tucoolService->delete($fromdb['tid']);
//更新评分
$oldPid = $fromdb['pid'] == 'tpc' ? 0 : $fromdb['pid'];
//$db->update(pwQuery::buildClause('UPDATE :pw_table SET tid=:tid1,pid=:pid WHERE tid=:tid AND pid=0', array('pw_pinglog', $totid, $pid, $fromdb['tid'])));
//$db->update(pwQuery::buildClause('UPDATE :pw_table SET tid=:tid1 WHERE tid=:tid AND pid>0', array('pw_pinglog', $totid, $fromdb['tid'])));
pwQuery::update('pw_pinglog', 'tid=:tid', array($fromdb['tid']), array('tid' => $totid, 'pid' => $pid));
//pwQuery::update('pw_pinglog', 'tid=:tid AND pid>0', array($fromdb['tid']), array('tid'=>$totid));
//更新elements
pwQuery::delete('pw_elements', 'id=:id AND type IN (:type)', array($fromdb['tid'], array('newpic', 'hitsort', 'hitsortday', 'hitsortweek', 'replysort', 'replysortday', 'replysortweek')));
}
//$db->update("UPDATE pw_threads SET replies=replies+" . S::sqlEscape($replies, false) . " WHERE tid=" . S::sqlEscape($totid));
$db->update(pwQuery::buildClause('UPDATE :pw_table SET replies=replies+:replies WHERE tid=:tid', array('pw_threads', $replies, $totid)));
$pw_tmsgs = GetTtable($totid);
//* $db->update("UPDATE $pw_tmsgs SET remindinfo=" . S::sqlEscape($remindinfo, false) . " WHERE tid=" . S::sqlEscape($totid));
pwQuery::update($pw_tmsgs, 'tid=:tid', array($totid), array('remindinfo' => $remindinfo));
updateforum($fid);
$weiboService = L::loadClass('weibo', 'sns');
$fromColonyIds && $weiboService->deleteWeibosByObjectIdsAndType($fromColonyIds, 'group_article');
$fromArticleIds && $weiboService->deleteWeibosByObjectIdsAndType($fromArticleIds, 'article');
$tousername = $db->get_value("SELECT author FROM pw_threads WHERE tid=" . S::sqlEscape($totid));
M::sendNotice(array($tousername), array('title' => getLangInfo('writemsg', 'unite_title'), 'content' => getLangInfo('writemsg', 'unite_content', array('manager' => $windid, 'fid' => $fid, 'tid' => $totid, 'subject' => $todb['subject'], 'postdate' => get_date($todb['postdate']), 'forum' => strip_tags($forum[$fid]['name']), 'admindate' => get_date($timestamp), 'reason' => stripslashes($atc_content)))));
if ($ifmsg) {
sendMawholeMessages($msgdb);
}
//* $threads = L::loadClass('Threads', 'forum');
//* $threads->delThreads($totid);
//* $threads->delThreads($fromdb['tid']);