本文整理汇总了PHP中pwQuery类的典型用法代码示例。如果您正苦于以下问题:PHP pwQuery类的具体用法?PHP pwQuery怎么用?PHP pwQuery使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了pwQuery类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: deleteByTids
function deleteByTids($tids)
{
if (!S::isArray($tids)) {
return false;
}
return pwQuery::delete($this->_tableName, "{$this->_primaryKey} IN (:{$this->_primaryKey})", array($tids));
}
开发者ID:sherlockhouse,项目名称:aliyun,代码行数:7,代码来源:replyrewarddb.class.php
示例2: deleteByAreaIds
/**
* 批量删除
*
* @param array $areaids 地区IDs
* @return boolean
*/
function deleteByAreaIds($areaids)
{
if (!S::isArray($areaids)) {
return false;
}
return (bool) pwQuery::delete($this->_tableName, "{$this->_primaryKey} in(:{$this->_primaryKey})", array($areaids));
}
开发者ID:sherlockhouse,项目名称:aliyun,代码行数:13,代码来源:areasdb.class.php
示例3: syncredit
function syncredit($arr)
{
if (is_array($arr)) {
foreach ($arr as $uid => $setv) {
$updateMemberData = array();
foreach ($setv as $cid => $value) {
if (is_numeric($cid)) {
$value = intval($value);
/**
$this->db->pw_update(
"SELECT uid FROM pw_membercredit WHERE uid=" . S::sqlEscape($uid) . ' AND cid=' . S::sqlEscape($cid),
"UPDATE pw_membercredit SET value=" . S::sqlEscape($value) . ' WHERE uid=' . S::sqlEscape($uid) . ' AND cid=' . S::sqlEscape($cid),
"INSERT INTO pw_membercredit SET " . S::sqlSingle(array('uid' => $uid, 'cid' => $cid, 'value' => $value))
);
**/
$this->db->pw_update("SELECT uid FROM pw_membercredit WHERE uid=" . S::sqlEscape($uid) . ' AND cid=' . S::sqlEscape($cid), pwQuery::updateClause('pw_membercredit', 'uid=:uid AND cid=:cid', array($uid, $cid), array('value' => $value)), pwQuery::insertClause('pw_membercredit', array('uid' => $uid, 'cid' => $cid, 'value' => $value)));
} elseif (in_array($cid, array('money', 'rvrc', 'credit', 'currency'))) {
$cid == 'rvrc' && ($value *= 10);
$updateMemberData[$cid] = intval($value);
}
}
if ($updateMemberData) {
$userService = L::loadClass('UserService', 'user');
/* @var $userService PW_UserService */
$userService->update($uid, array(), $updateMemberData);
}
}
}
return new ApiResponse(1);
}
开发者ID:jechiy,项目名称:PHPWind,代码行数:30,代码来源:class_Credit.php
示例4: 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();
}
开发者ID:jechiy,项目名称:PHPWind,代码行数:25,代码来源:memberinfodb.class.php
示例5: deleteByIdentify
function deleteByIdentify($identify)
{
if (!$this->_check() || !$identify) {
return false;
}
return pwQuery::delete($this->_tableName, "identify=:identify", array($identify));
}
开发者ID:sherlockhouse,项目名称:aliyun,代码行数:7,代码来源:medalinfodb.class.php
示例6: deleteMemberTagsByTagId
/**
* 根据标签ID批量删除
*
* @param int $tagids 标签ID数组
* @return boolean
*/
function deleteMemberTagsByTagId($tagids)
{
if (!S::isArray($tagids)) {
return false;
}
return (bool) pwQuery::delete($this->_tableName, "tagid in(:tagid)", array($tagids));
}
开发者ID:jechiy,项目名称:PHPWind,代码行数:13,代码来源:membertagsrelationsdb.class.php
示例7: 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)));
}
开发者ID:jechiy,项目名称:PHPWind,代码行数:9,代码来源:commentdb.class.php
示例8: deleteBySid
/**
* 根据链接ID删除数据
*
* @param int $sid 链接ID
* @return int 删除行数
*/
function deleteBySid($sid)
{
$sid = intval($sid);
if ($sid < 1) {
return null;
}
pwQuery::delete($this->_tableName, "sid=:sid", array($sid));
return $this->_db->affected_rows();
}
开发者ID:jechiy,项目名称:PHPWind,代码行数:15,代码来源:sharelinksrelationdb.class.php
示例9: deleteAttentionedTopic
/**
*
* 删除用户关注的话题
* @param int $topicId
* @param int $userid
* @return boolean
*/
function deleteAttentionedTopic($topicId, $userid)
{
$userid = intval($userid);
$topicId = intval($topicId);
if (!$userid || !$topicId) {
return false;
}
pwQuery::delete($this->_tableName, "userid=:userid and topicid=:topicid", array($userid, $topicId));
return true;
}
开发者ID:sherlockhouse,项目名称:aliyun,代码行数:17,代码来源:weibo_topicattentionsdb.class.php
示例10: addTopicRelations
/**
*
* 添加话题新鲜事关系
* @param int $topicId
* @param int $mid
*/
function addTopicRelations($topicId, $mid)
{
$mid = intval($mid);
$topicId = intval($topicId);
if (!$mid || !$topicId) {
return false;
}
$fields = array('topicid' => $topicId, 'mid' => $mid, 'crtime' => $GLOBALS['timestamp']);
pwQuery::replace($this->_tableName, $fields);
return true;
}
开发者ID:sherlockhouse,项目名称:aliyun,代码行数:17,代码来源:weibo_topicrelationsdb.class.php
示例11: _insertLog
function _insertLog($tableName, $sids, $operate)
{
if (!$tableName || !S::isArray($sids) || !$operate) {
return false;
}
global $db, $timestamp;
$operates = array('update' => 1, 'delete' => 2, 'insert' => 3);
foreach ($sids as $sid) {
pwQuery::replace($tableName, array('id' => $sid, 'sid' => $sid, 'operate' => $operates[$operate], 'modified_time' => $timestamp));
}
return true;
}
开发者ID:sherlockhouse,项目名称:aliyun,代码行数:12,代码来源:operatelog.class.php
示例12: 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;
}
开发者ID:jechiy,项目名称:PHPWind,代码行数:21,代码来源:cmscommentdb.class.php
示例13: insertAppevent
function insertAppevent($uid, $appevent = array(), $appid)
{
//插入用户的单个应用信息
//$rt = $this->db->get_one("SELECT uid FROM pw_userapp WHERE uid=".S::sqlEscape($uid)." AND appid=".S::sqlEscape($appid));
$appclient = L::loadClass('appclient');
$rt = $appclient->getUserAppByUidAndAppid($uid, $appid);
if ($rt && $appevent) {
$appevent = serialize($appevent);
//$this->db->update("UPDATE pw_userapp SET appevent=" .S::sqlEscape($appevent). "WHERE uid=".S::sqlEscape($uid)." AND appid=".S::sqlEscape($appid));
pwQuery::update('pw_userapp', 'uid=:uid AND appid=:appid', array($uid, $appid), array('appevent' => $appevent));
return new ApiResponse(true);
}
return new ApiResponse(false);
}
开发者ID:jechiy,项目名称:PHPWind,代码行数:14,代码来源:class_Feed.php
示例14: add
function add($username, $pwd, $email)
{
$this->db->update("INSERT INTO pw_members SET " . UC::sqlSingle(array('username' => $username, 'password' => $pwd, 'email' => $email, 'groupid' => 0, 'regdate' => $this->base->time)));
$uid = $this->db->insert_id();
/**
$this->db->update("INSERT INTO pw_memberdata SET " . $this->base->sqlSingle(array(
'uid' => $uid,
'lastvisit' => $this->base->time,
'thisvisit' => $this->base->time,
'onlineip' => $this->base->onlineip
)));
**/
pwQuery::insert('pw_memberdata', array('uid' => $uid, 'lastvisit' => $this->base->time, 'thisvisit' => $this->base->time, 'onlineip' => $this->base->onlineip));
return $uid;
}
开发者ID:jechiy,项目名称:PHPWind,代码行数:15,代码来源:user.php
示例15: add
function add($uid, $appid, $appname, $allowfeed, $descrip)
{
global $timestamp;
/*
$this->db->update("REPLACE INTO pw_userapp SET " . S::sqlSingle(array(
'uid' => $uid,
'appid' => $appid,
'appname' => $appname,
)));
*/
pwQuery::replace('pw_userapp', array('uid' => $uid, 'appid' => $appid, 'appname' => $appname));
if ($allowfeed) {
$descrip = S::escapeChar($descrip);
$this->db->update("INSERT INTO pw_feed SET " . S::sqlSingle(array('uid' => $uid, 'type' => 'app', 'descrip' => $descrip, 'timestamp' => $timestamp), false));
}
return new ApiResponse(true);
}
开发者ID:jechiy,项目名称:PHPWind,代码行数:17,代码来源:class_UserApp.php
示例16: update_markinfo
function update_markinfo($fid, $tid, $pid)
{
global $db;
$perpage = 10;
$pid = intval($pid);
$creditnames = pwCreditNames();
$whereStr = " fid=" . S::sqlEscape($fid) . " AND tid=" . S::sqlEscape($tid) . " AND pid=" . S::sqlEscape($pid) . " AND ifhide=0 ";
$count = 0;
$creditCount = array();
$query = $db->query("SELECT COUNT(*) AS count,name,SUM(point) AS sum FROM pw_pinglog WHERE {$whereStr} GROUP BY name");
while ($rt = $db->fetch_array($query)) {
$count += $rt['count'];
if (isset($creditnames[$rt['name']])) {
$creditCount[$rt['name']] += $rt['sum'];
} elseif (in_array($rt['name'], $creditnames)) {
$key = array_search($rt['name'], $creditnames);
$creditCount[$key] += $rt['sum'];
}
}
$markInfo = '';
if ($count) {
$query = $db->query("SELECT id FROM pw_pinglog WHERE {$whereStr} ORDER BY id DESC LIMIT 0,{$perpage}");
$ids = array();
while ($rt = $db->fetch_array($query)) {
$ids[] = $rt['id'];
}
$markInfo = $count . ":" . implode(",", $ids);
if ($creditCount) {
$tmp = array();
foreach ($creditCount as $key => $value) {
$tmp[] = $key . '=' . $value;
}
$markInfo .= ':' . implode(',', $tmp);
}
}
if ($pid == 0) {
//* $db->update("UPDATE $pw_tmsgs SET ifmark=" . S::sqlEscape($markInfo) . " WHERE tid=" . S::sqlEscape($tid));
$pw_tmsgs = GetTtable($tid);
pwQuery::update($pw_tmsgs, 'tid=:tid', array($tid), array('ifmark' => $markInfo));
} else {
$db->update("UPDATE " . GetPtable("N", $tid) . " SET ifmark=" . S::sqlEscape($markInfo) . " WHERE pid=" . S::sqlEscape($pid));
}
return $markInfo;
}
开发者ID:jechiy,项目名称:PHPWind,代码行数:44,代码来源:pingfunc.php
示例17: return_value
function return_value($tid, $rw_a_name, $rw_a_val)
{
global $db, $pw_posts, $authorid, $author, $onlineip, $forum, $fid, $credit;
if ($rw_a_val < 1) {
return;
}
$p_a = $u_a = array();
$query = $db->query("SELECT pid,author,authorid FROM {$pw_posts} WHERE tid=" . S::sqlEscape($tid) . " AND ifreward='0' AND authorid!=" . S::sqlEscape($authorid) . " GROUP BY authorid ORDER BY postdate ASC LIMIT {$rw_a_val}");
while ($user = $db->fetch_array($query)) {
$credit->addLog('reward_active', array($rw_a_name => 1), array('uid' => $user['authorid'], 'username' => $user['author'], 'ip' => $onlineip, 'fname' => $forum[$fid]['name']));
$p_a[] = $user['pid'];
$u_a[] = $user['authorid'];
$rw_a_val--;
}
//$p_a && $db->update("UPDATE $pw_posts SET ifreward='1' WHERE pid IN(" . S::sqlImplode($p_a) . ')');
$p_a && pwQuery::update($pw_posts, 'pid IN(:pid)', array($p_a), array('ifreward' => '1'));
$u_a && $credit->setus($u_a, array($rw_a_name => 1), false);
if ($rw_a_val > 0) {
$credit->addLog('reward_return', array($rw_a_name => $rw_a_val), array('uid' => $authorid, 'username' => $author, 'ip' => $onlineip, 'fname' => $forum[$fid]['name']));
$credit->set($authorid, $rw_a_name, $rw_a_val, false);
}
}
开发者ID:jechiy,项目名称:PHPWind,代码行数:22,代码来源:job.php
示例18: updatecache_i_i
function updatecache_i_i($fid, $aidin = null)
{
global $db, $db_windpost, $timestamp, $forum;
require_once R_P . 'require/bbscode.php';
//* include pwCache::getPath(D_P.'data/bbscache/forum_cache.php');
extract(pwCache::getData(D_P . 'data/bbscache/forum_cache.php', false));
$sql_where = empty($aidin) ? "fid=" . S::sqlEscape($fid) : "aid IN ({$aidin})";
$F_ffid = false;
$aid = $aidcache = 0;
$aids = '';
$query = $db->query("SELECT aid,startdate,enddate,content FROM pw_announce WHERE {$sql_where} AND ifopen='1' AND (enddate=0 OR enddate>=" . S::sqlEscape($timestamp) . ") ORDER BY vieworder,startdate DESC");
while ($rt = $db->fetch_array($query)) {
if ($rt['startdate'] <= $timestamp) {
if ($F_ffid) {
continue;
} elseif (!$rt['enddate']) {
$F_ffid = true;
}
}
if (!$aid && $rt['startdate'] <= $timestamp && (!$rt['enddate'] || $rt['enddate'] >= $timestamp)) {
$aid = $rt['aid'];
if ($rt['content'] != convert($rt['content'], $db_windpost, 2)) {
//* $db->update("UPDATE pw_announce SET ifconvert='1' WHERE aid=".S::sqlEscape($aid));
pwQuery::update('pw_announce', 'aid=:aid', array($aid), array('ifconvert' => 1));
}
} else {
$aids .= ",{$rt['aid']}";
}
}
if ($aids) {
$aids = substr($aids, 1);
$aidcache = $timestamp;
}
//* $db->update("UPDATE pw_forumdata SET ".S::sqlSingle(array('aid'=>$aid,'aids'=>$aids,'aidcache'=>$aidcache))."WHERE fid=".S::sqlEscape($fid));
pwQuery::update('pw_forumdata', 'fid=:fid', array($fid), array('aid' => $aid, 'aids' => $aids, 'aidcache' => $aidcache));
}
开发者ID:sherlockhouse,项目名称:aliyun,代码行数:36,代码来源:updatenotice.php
示例19: date
if ($foruminfo['allowhtm'] == 1) {
#纯静态页面生成
$htmurl = $db_readdir . '/' . $fid . '/' . date('ym', $read['postdate']) . '/' . $read['tid'] . '.html';
if (!$foruminfo['cms'] && !$toread && file_exists(R_P . $htmurl)) {
ObHeader("{$R_url}/{$htmurl}");
}
}
$readdb[] = $read;
}
$toread && ($urladd .= "&toread={$toread}");
$fpage > 1 && ($urladd .= "&fpage={$fpage}");
$pages = numofpage($count + $topped_count, $page, $numofpage, "read.php?tid={$tid}{$urladd}{$viewbbs}&");
$tpc_locked = $read['locked'] % 3 != 0 ? 1 : 0;
//更新帖子点击
if ($db_hits_store == 0) {
pwQuery::update('pw_threads', 'tid=:tid', array($tid), null, array(PW_EXPR => array('hits=hits+1')));
} elseif ($db_hits_store == 1) {
$db->update('UPDATE pw_hits_threads SET hits=hits+1 WHERE tid=' . S::sqlEscape($tid));
} elseif ($db_hits_store == 2) {
pwCache::writeover(D_P . 'data/bbscache/hits.txt', $tid . "\t", 'ab');
}
//帖子浏览记录
$readlog = str_replace(",{$tid},", ',', GetCookie('readlog'));
$readlog .= ($readlog ? '' : ',') . $tid . ',';
$readlogCount = substr_count($readlog, ',');
$readlogCount > 11 && ($readlog = preg_replace("/[\\d]+\\,/i", '', $readlog, $readlogCount - 11));
Cookie('readlog', $readlog);
$favortitle = str_replace(array("'", "'", "\"", "\\"), array("‘", "\\'", "\\\"", "\\\\"), $subject);
$db_bbsname_a = addslashes($db_bbsname);
#模版内用到
if ($readdb[0]['cyid']) {
开发者ID:jechiy,项目名称:PHPWind,代码行数:31,代码来源:addfloor.php
示例20: _delete
/**
* 基础删除一条数据查询语句
* @param $id
* @return unknown_type
*/
function _delete($id)
{
if (!$this->_check() || $id < 1) {
return false;
}
//* $this->_db->update("DELETE FROM " . $this->_tableName . " WHERE " . $this->_primaryKey . "=" . $this->_addSlashes($id) . " LIMIT 1");
return pwQuery::delete($this->_tableName, "{$this->_primaryKey}=:{$this->_primaryKey}", array($id));
}
开发者ID:sherlockhouse,项目名称:aliyun,代码行数:13,代码来源:basedb.php
注:本文中的pwQuery类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论