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


PHP pwQuery::updateClause方法代码示例

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


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

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

示例2: PrintEot

         $u_credit = $credit->get($rt['uid'], 'CUSTOM');
         include PrintEot('usermanage');
         exit;
     } else {
         S::gp(array('uid', 'creditdb'), 'P');
         !is_numeric($uid) && adminmsg('operate_error');
         foreach ($creditdb as $key => $value) {
             if (is_numeric($key) && is_numeric($value)) {
                 /**
                 					$db->pw_update(
                 						"SELECT uid FROM pw_membercredit WHERE uid=".S::sqlEscape($uid)."AND cid=".S::sqlEscape($key),
                 						"UPDATE pw_membercredit SET value=".S::sqlEscape($value)."WHERE uid=".S::sqlEscape($uid)."AND cid=".S::sqlEscape($key),
                 						"INSERT INTO pw_membercredit SET ".S::sqlSingle(array('uid'=>$uid,'cid'=>$key,'value'=>$value))
                 					);
                 					**/
                 $db->pw_update("SELECT uid FROM pw_membercredit WHERE uid=" . S::sqlEscape($uid) . "AND cid=" . S::sqlEscape($key), pwQuery::updateClause('pw_membercredit', 'uid=:uid AND cid=:cid', array($uid, $key), array('value' => $value)), pwQuery::insertClause('pw_membercredit', array('uid' => $uid, 'cid' => $key, 'value' => $value)));
             }
         }
         adminmsg('operate_success');
     }
 } else {
     S::gp(array('page'), 'GP', 2);
     $page < 1 && ($page = 1);
     $limit = S::sqlLimit(($page - 1) * $db_perpage, $db_perpage);
     $rt = $db->get_one("SELECT COUNT(*) AS sum FROM pw_membercredit WHERE value!=0");
     $pages = numofpage($rt['sum'], $page, ceil($rt['sum'] / $db_perpage), "{$basename}&");
     $query = $db->query("SELECT m.uid,m.username,mc.cid,mc.value FROM pw_membercredit mc LEFT JOIN pw_members m USING(uid) WHERE value!=0 ORDER BY cid, value DESC {$limit}");
     while ($rt = $db->fetch_array($query)) {
         $rt['name'] = $_CREDITDB[$rt['cid']][0];
         $creditdb[] = $rt;
     }
开发者ID:jechiy,项目名称:PHPWind,代码行数:31,代码来源:usermanage.php

示例3: _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();
 }
开发者ID:sherlockhouse,项目名称:aliyun,代码行数:55,代码来源:register.class.php

示例4: array

            				"SELECT * FROM pw_singleright WHERE uid=" . S::sqlEscape($uid),
            				"UPDATE pw_singleright SET" . S::sqlSingle(array(
            						'visit'	=> $visit,
            						'post'	=> $post,
            						'reply'	=> $reply
            					))
            				. " WHERE uid=" . S::sqlEscape($uid),
            				"INSERT INTO pw_singleright SET" . S::sqlSingle(array(
            					'uid'	=> $uid,
            					'visit'	=> $visit,
            					'post'	=> $post,
            					'reply'	=> $reply
            				))
            			);
            			**/
            $db->pw_update("SELECT * FROM pw_singleright WHERE uid=" . S::sqlEscape($uid), pwQuery::updateClause('pw_singleright', 'uid =:uid', array($uid), array('visit' => $visit, 'post' => $post, 'reply' => $reply)), pwQuery::insertClause('pw_singleright', array('uid' => $uid, 'visit' => $visit, 'post' => $post, 'reply' => $reply)));
            adminmsg('operate_success');
        }
    } elseif ($_POST['job'] == 'del') {
        S::gp(array('selid'), 'P');
        $tmpSelid = $selid;
        if (!($selid = checkselid($selid))) {
            adminmsg('operate_error');
        }
        //* $db->update("DELETE FROM pw_singleright WHERE uid IN($selid)");
        pwQuery::delete('pw_singleright', 'uid IN (:uid)', array($tmpSelid));
        adminmsg('operate_success');
    }
} elseif ($action == 'user') {
    //* include_once pwCache::getPath(D_P.'data/bbscache/level.php');
    //* include_once pwCache::getPath(D_P.'data/bbscache/forumcache.php');
开发者ID:jechiy,项目名称:PHPWind,代码行数:31,代码来源:singleright.php

示例5: update

 function update($tableName, $where_statement = null, $where_conditions = null, $col_names, $expand = null)
 {
     $GLOBALS['db']->update(pwQuery::updateClause($tableName, $where_statement, $where_conditions, $col_names, $expand));
     return $GLOBALS['db']->affected_rows();
 }
开发者ID:jechiy,项目名称:PHPWind,代码行数:5,代码来源:common.php


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