当前位置: 首页>>代码示例>>PHP>>正文


PHP pwQuery::update方法代码示例

本文整理汇总了PHP中pwQuery::update方法的典型用法代码示例。如果您正苦于以下问题:PHP pwQuery::update方法的具体用法?PHP pwQuery::update怎么用?PHP pwQuery::update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pwQuery的用法示例。


在下文中一共展示了pwQuery::update方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: editCareer

 /**
  * 编辑一条工作经历
  * @param int $uid 用户id
  * @param int $companyId 公司Id
  * @param int $startTime 入公司年份
  * @return bool
  */
 function editCareer($careerId, $companyId, $startTime)
 {
     if (!$careerId || !$companyId || !$startTime) {
         return false;
     }
     return pwQuery::update($this->_tableName, "careerid=:careerid", array($careerId), array('companyid' => $companyId, 'starttime' => $startTime));
 }
开发者ID:jechiy,项目名称:PHPWind,代码行数:14,代码来源:usercareerdb.class.php

示例2: updateByUidAndMedalId

 function updateByUidAndMedalId($fieldData, $uid, $medalId)
 {
     $fieldData = $this->_checkData($fieldData);
     if (!$fieldData) {
         return false;
     }
     return pwQuery::update($this->_tableName, "uid=:uid AND medal_id=:medal_id", array($uid, $medalId), $fieldData);
 }
开发者ID:sherlockhouse,项目名称:aliyun,代码行数:8,代码来源:medalawarddb.class.php

示例3: update

 function update($fieldData, $uid, $behavior)
 {
     $fieldData = $this->_checkData($fieldData);
     if (!$fieldData) {
         return false;
     }
     return pwQuery::update($this->_tableName, "uid=:uid AND behavior=:behavior", array($uid, $behavior), $fieldData);
 }
开发者ID:jechiy,项目名称:PHPWind,代码行数:8,代码来源:memberbehaviorstatisticdb.class.php

示例4: updateRecordByTidAndPid

 function updateRecordByTidAndPid($tid, $pid, $data)
 {
     list($tid, $pid) = array(intval($tid), intval($pid));
     $data = $this->_checkAllowField($data, $this->_allowFields);
     if ($tid < 1 || $pid < 1 || !S::isArray($data)) {
         return false;
     }
     return pwQuery::update($this->_tableName, "tid=:tid AND pid=:pid", array($tid, $pid), $data);
 }
开发者ID:jechiy,项目名称:PHPWind,代码行数:9,代码来源:replyrewardrecorddb.class.php

示例5: updates

 function updates($fieldData, $ids)
 {
     if (!$this->_check() || !$fieldData || empty($ids)) {
         return false;
     }
     /**
     		$this->_db->update("UPDATE " . $this->_tableName . " SET " . $this->_getUpdateSqlString($fieldData) . " WHERE " . $this->_primaryKey . " IN (" . $this->_getImplodeString($ids) . ")");
     		**/
     pwQuery::update('pw_memberinfo', 'uid IN(:uid)', array($ids), $fieldData);
     return $this->_db->affected_rows();
 }
开发者ID:jechiy,项目名称:PHPWind,代码行数:11,代码来源:memberinfodb.class.php

示例6: 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

示例7: 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

示例8: 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

示例9: 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

示例10: is_null

        is_null($locked) && Showmsg('mawhole_nolock');
        $msgdb = $logdb = array();
        $query = $db->query("SELECT locked,tid,fid,postdate,author,authorid,subject FROM pw_threads WHERE tid IN(" . S::sqlImplode($selids) . ")");
        while ($rt = $db->fetch_array($query)) {
            if ($rt['locked'] % 3 != $locked && $locked) {
                $s = $rt['locked'] > 2 ? $locked + 3 : $locked;
                //$db->update('UPDATE pw_threads SET locked='.S::sqlEscape($s).' WHERE tid='.S::sqlEscape($rt['tid']));
                pwQuery::update('pw_threads', 'tid=:tid', array($rt['tid']), array('locked' => $s));
                if ($ifmsg) {
                    $msgdb[] = array('toUser' => $rt['author'], 'title' => getLangInfo('writemsg', 'lock_title'), 'content' => getLangInfo('writemsg', 'lock_content', array('manager' => $windid, 'fid' => $fid, 'tid' => $rt['tid'], 'subject' => $rt['subject'], 'postdate' => get_date($rt['postdate']), 'forum' => strip_tags($forum[$fid]['name']), 'admindate' => get_date($timestamp), 'reason' => stripslashes($atc_content))));
                }
                $logdb[] = array('type' => 'locked', 'username1' => $rt['author'], 'username2' => $windid, 'field1' => $fid, 'field2' => $rt['tid'], 'field3' => '', 'descrip' => 'lock_descrip', 'timestamp' => $timestamp, 'ip' => $onlineip, 'tid' => $rt['tid'], 'subject' => substrs($rt['subject'], 28), 'forum' => $forum[$fid]['name'], 'reason' => stripslashes($atc_content));
            } elseif ($rt['locked'] % 3 != 0 && !$locked) {
                $s = $rt['locked'] > 2 ? 3 : 0;
                //$db->update("UPDATE pw_threads SET locked='$s' WHERE tid=".S::sqlEscape($rt['tid']));
                pwQuery::update('pw_threads', "tid=:tid", array($rt['tid']), array("locked" => $s));
                if ($ifmsg) {
                    $msgdb[] = array('toUser' => $rt['author'], 'title' => getLangInfo('writemsg', 'unlock_title'), 'content' => getLangInfo('writemsg', 'unlock_content', array('manager' => $windid, 'fid' => $fid, 'tid' => $rt['tid'], 'subject' => $rt['subject'], 'postdate' => get_date($rt['postdate']), 'forum' => strip_tags($forum[$fid]['name']), 'admindate' => get_date($timestamp), 'reason' => stripslashes($atc_content))));
                }
                $logdb[] = array('type' => 'locked', 'username1' => $rt['author'], 'username2' => $windid, 'field1' => $fid, 'field2' => $rt['tid'], 'field3' => '', 'descrip' => 'unlock_descrip', 'timestamp' => $timestamp, 'ip' => $onlineip, 'tid' => $rt['tid'], 'subject' => substrs($rt['subject'], 28), 'forum' => $forum[$fid]['name'], 'reason' => stripslashes($atc_content));
            }
        }
        sendMawholeMessages($msgdb);
        foreach ($logdb as $key => $val) {
            writelog($val);
        }
        refreshto("apps.php?q=group&a=thread&cyid={$cyid}", 'lock_success');
    }
} elseif ($action == 'pushtopic') {
    $pushtime_top = (int) pwRights(false, 'pushtime');
    if (empty($_POST['step'])) {
开发者ID:sherlockhouse,项目名称:aliyun,代码行数:31,代码来源:m_topicadmin.php

示例11: procUnLock

// update posts hits
if ($c_htm || $db_hits_store == 2) {
    $db_hithour == 0 && ($db_hithour = 4);
    $hit_wtime = $hit_control * $db_hithour;
    $hit_wtime > 24 && ($hit_wtime = 0);
    $hitsize = @filesize(D_P . 'data/bbscache/hits.txt');
    if ($hitsize && ($hitsize > 1024 || $timestamp - $hit_tdtime > $hit_wtime * 3600) && procLock('hitupdate')) {
        require_once R_P . 'require/hitupdate.php';
        procUnLock('hitupdate');
    }
}
if ($higholnum < $usertotal) {
    pwQuery::update('pw_bbsinfo', 'id=:id', array(1), array('higholnum' => $usertotal, 'higholtime' => $timestamp));
    $higholnum = $usertotal;
}
if ($hposts < $tposts) {
    pwQuery::update('pw_bbsinfo', 'id=:id', array(1), array('hposts' => $tposts));
    $hposts = $tposts;
}
$mostinbbstime = get_date($higholtime);
if (!$ol_offset && $db_onlinelmt != 0 && $usertotal >= $db_onlinelmt) {
    Cookie('ol_offset', '', 0);
    Showmsg('most_online');
}
if ($plantime && $timestamp > $plantime && procLock('task')) {
    require_once R_P . 'require/task.php';
    procUnLock('task');
}
require_once PrintEot('index');
CloudWind::yunSetCookie(SCR);
footer();
开发者ID:jechiy,项目名称:PHPWind,代码行数:31,代码来源:index.php

示例12: changeEmail

 function changeEmail($uid, $newEmail)
 {
     $uid = intval($uid);
     $newEmail = trim($newEmail);
     if (!$uid || !$newEmail) {
         return false;
     }
     PW_Register::checkEmail($newEmail);
     return pwQuery::update('pw_members', "uid=:uid", array($uid), array('email' => $newEmail));
 }
开发者ID:sherlockhouse,项目名称:aliyun,代码行数:10,代码来源:register.class.php

示例13: array

                pwQuery::insert('pw_cmembers', array('uid' => $rt['uid'], 'username' => $admin, 'ifadmin' => 1, 'colonyid' => $cyid, 'addtime' => $timestamp));
            }
            $pwSQL['admin'] = $admin;
        }
        require_once A_P . 'lib/colonys.class.php';
        $colonyServer = new PW_Colony();
        if ($cid != $colony['classid']) {
            $cid = isset($o_classdb[$cid]) ? $cid : 0;
            $colonyServer->changeTopicToForum($cyid, $iftopicshowinforum, $cid, $colony['classid']);
            $pwSQL['classid'] = $cid;
        } elseif ($iftopicshowinforum != $colony['iftopicshowinforum'] && $colony['classid'] > 0) {
            $colonyServer->changeTopicShowInForum($cyid, $iftopicshowinforum, $colony['classid']);
        }
        $pwSQL['styleid'] = $styleid;
        //* $db->update("UPDATE pw_colonys SET " . S::sqlSingle($pwSQL) . ' WHERE id=' . S::sqlEscape($cyid));
        pwQuery::update('pw_colonys', 'id=:id', array($cyid), $pwSQL);
        require_once R_P . 'u/require/core.php';
        updateGroupLevel($cyid, $colony);
        adminmsg('operate_success', "{$basename}&action=editcolony");
    }
} elseif ($action == 'mergecolony') {
    if (empty($_POST['step'])) {
        require_once PrintApp('admin');
    } else {
        $basename = $basename . '&action=mergecolony';
        S::gp(array('fromcname', 'tocname'), '');
        require_once A_P . 'lib/colony.class.php';
        require_once A_P . 'lib/colonys.class.php';
        $colonyServer = new PW_Colony();
        if (!($colony = $colonyServer->getColonyByName($fromcname))) {
            adminmsg('源群组不存在!');
开发者ID:jechiy,项目名称:PHPWind,代码行数:31,代码来源:set.php

示例14: _update

 /**
  * 基础更新数据查询语句
  * @param $fieldData
  * @param $id
  * @return unknown_type
  */
 function _update($fieldData, $id)
 {
     if (!$this->_check() || !$fieldData || $id < 1) {
         return false;
     }
     //* $this->_db->update("UPDATE " . $this->_tableName . " SET " . $this->_getUpdateSqlString($fieldData) . " WHERE " . $this->_primaryKey . "=" . $this->_addSlashes($id) . " LIMIT 1");
     return pwQuery::update($this->_tableName, "{$this->_primaryKey}=:{$this->_primaryKey}", array($id), $fieldData);
 }
开发者ID:sherlockhouse,项目名称:aliyun,代码行数:14,代码来源:basedb.php

示例15: foreach

            $creditdb = $credit->get($value['uid'], 'CUSTOM');
            foreach ($creditdb as $k => $val) {
                /**
                				$db->pw_update(
                					"SELECT uid FROM pw_membercredit WHERE uid=".S::sqlEscape($newuid)."AND cid=".S::sqlEscape($k),
                					"UPDATE pw_membercredit SET value=value+".S::sqlEscape($val[1])."WHERE uid=".S::sqlEscape($newuid)."AND cid=".S::sqlEscape($k),
                					"INSERT INTO pw_membercredit SET".S::sqlSingle(array('uid'=>$newuid,'cid'=>$k,'value'=>$val[1]))
                				);
                				**/
                $db->pw_update("SELECT uid FROM pw_membercredit WHERE uid=" . S::sqlEscape($newuid) . "AND cid=" . S::sqlEscape($k), pwQuery::buildClause("UPDATE :pw_table SET value=value+:value WHERE uid=:uid AND cid=:cid", array('pw_membercredit', $val[1], $newuid, $k)), pwQuery::insertClause('pw_membercredit', array('uid' => $newuid, 'cid' => $k, 'value' => $val[1])));
            }
            //$db->update("UPDATE pw_threads SET ".S::sqlSingle(array('author'=>$touser['username'],'authorid'=>$newuid))."WHERE authorid=".S::sqlEscape($value['uid']));
            pwQuery::update('pw_threads', 'authorid=:authorid', array($value['uid']), array('author' => $touser['username'], 'authorid' => $newuid));
            foreach ($ptable_a as $val) {
                //$db->update("UPDATE $val SET ".S::sqlSingle(array('author'=>$touser['username'],'authorid'=>$newuid))."WHERE authorid=".S::sqlEscape($value['uid']));
                pwQuery::update($val, 'authorid=:authorid', array($value['uid']), array('author' => $touser['username'], 'authorid' => $newuid));
            }
            $db->update("UPDATE pw_attachs SET uid=" . S::sqlEscape($newuid) . "WHERE uid=" . S::sqlEscape($value['uid']));
            $userService->delete($value['uid']);
            $messageServer = L::loadClass('message', 'message');
            $messageServer->clearMessages($value['uid'], array('groupsms', 'sms', 'notice', 'request', 'history'));
        }
        $mainFields = array();
        $memberDataFields = array('postnum' => $postnum, 'digests' => $digests, 'rvrc' => $rvrc, 'money' => $money, 'credit' => $credits, 'currency' => $currency);
        $memberInfoFields = array('deposit' => $deposit, 'ddeposit' => $ddeposit);
        $userService->updateByIncrement($newuid, $mainFields, $memberDataFields, $memberInfoFields);
        adminmsg('operate_success');
    }
    include PrintEot('usermanage');
    exit;
} elseif ($adminitem == 'customcredit') {
开发者ID:jechiy,项目名称:PHPWind,代码行数:31,代码来源:usermanage.php


注:本文中的pwQuery::update方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。