本文整理汇总了PHP中Base_Common::getUserTable方法的典型用法代码示例。如果您正苦于以下问题:PHP Base_Common::getUserTable方法的具体用法?PHP Base_Common::getUserTable怎么用?PHP Base_Common::getUserTable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Base_Common
的用法示例。
在下文中一共展示了Base_Common::getUserTable方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: InsertCharacterKickOff
public function InsertCharacterKickOff($KickOffArr)
{
$this->db->begin();
$position = Base_Common::getUserDataPositionById($KickOffArr['UserId']);
$table_user = Base_Common::getUserTable($this->character_kick_off, $position);
$user = $this->db->insert($table_user, $KickOffArr);
$Date = date("Ym", $KickOffArr['KickOffTime']);
$table_date = $this->CreateCharacterKickOffLog($Date);
$oSocketType = @(include __APP_ROOT_DIR__ . "/etc/SocketType.php");
$oSocketQueue = new Config_SocketQueue();
$uType = 60221;
$TypeInfo = $oSocketType[$uType];
if ($TypeInfo['Type']) {
$DataArr = array('PackFormat' => $TypeInfo['PackFormat'], 'Length' => $TypeInfo['Length'], 'Length2' => 0, 'uType' => $uType, 'MsgLevel' => 0, 'Line' => 0, 'UserID' => $KickOffArr['UserId'], 'KickOffReason' => $KickOffArr['KickOffReason'], 'Serial' => $KickOffArr['KickOffId']);
}
$DataArr = array('ServerId' => $KickOffArr['ServerId'], 'uType' => $uType, 'UserId' => $DataArr['UserID'], 'MessegeContent' => serialize($DataArr), 'QueueTime' => time(), 'SendTime' => 0);
$addQueue = $oSocketQueue->insert($DataArr);
$log = $this->db->insert($table_date, $KickOffArr);
if ($user && $log && $addQueue) {
$this->db->commit();
return true;
} else {
$this->db->rollBack();
return false;
}
}
示例2: getItemPickUpCount
public function getItemPickUpCount($StartTime, $EndTime, $UserId, $ServerId, $oWherePartnerPermission, $ItemListText)
{
//查询列
$select_fields = array('PickUpCount' => 'count(*)');
//初始化查询条件
$whereStartTime = $StartTime ? " ItemPickUpTime >= '" . strtotime($StartTime) . "' " : "";
$whereEndTime = $EndTime ? " ItemPickUpTime <= '" . strtotime($EndTime) . "' " : "";
$whereServer = $ServerId ? " ServerId = " . $ServerId . " " : "";
$whereItemID = $ItemListText ? " ItemID in ( " . $ItemListText . " )" : "";
$whereUser = $UserId ? " UserId = " . $UserId . " " : "";
$whereCondition = array($whereStartTime, $whereEndTime, $whereUser, $whereServer, $oWherePartnerPermission, $whereItemID);
//生成查询列
$fields = Base_common::getSqlFields($select_fields);
//生成条件列
$where = Base_common::getSqlWhere($whereCondition);
if ($UserId) {
$position = Base_Common::getUserDataPositionById($UserId);
$table_to_process = Base_Common::getUserTable($this->table_list['pickitem_user'], $position);
} else {
$Date = date("Ymd", strtotime($StartTime));
$table_to_process = Base_Widget::getDbTable($this->table_list['pickitem']) . "_" . $Date;
}
$sql = "SELECT {$fields} FROM {$table_to_process} as log where 1 " . $where;
$PickUpCount = $this->db->getOne($sql, false);
if ($PickUpCount) {
return $PickUpCount;
} else {
return 0;
}
}
示例3: getPvpLogTotal
public function getPvpLogTotal($whereTime)
{
$table_to_process = Base_Widget::getDbTable($this->table_pvp_log_total);
$sql = "truncate {$table_to_process}";
$this->db->query($sql);
for ($i = 0; $i <= 255; $i++) {
$position = Base_Common::getUserDataPositionById(sprintf("%03d", $i));
$table_to_get = Base_Common::getUserTable($this->table_pvp_log_user, $position);
$sql = "replace into {$table_to_process} (ServerId,UserId,Won,PvpCount) select ServerId,UserId,Won,Count(*) from {$table_to_get} where {$whereTime} group by ServerId,UserId,Won";
echo $this->db->query($sql) . "-";
}
}
示例4: asignProductPackCode
public function asignProductPackCode($UserName, $unsignedCode)
{
$oUser = new Lm_User();
$UserInfo = $oUser->getUserByName($UserName);
if ($UserInfo['UserId']) {
if ($unsignedCode['ProductPackCode']) {
$PackInfo = $this->getRow($unsignedCode['ProductPackId']);
$CodeCount = $this->getUserProductPackCodeListCount($UserInfo['UserId'], 0, 0, $unsignedCode['GenId']);
if ($CodeCount < $PackInfo['AsignCountLimit']) {
$this->db->begin();
$unsignedCode['AsignTime'] = time();
$unsignedCode['AsignUser'] = $UserInfo['UserId'];
$position = Base_Common::getUserDataPositionById($UserInfo['UserId']);
$table_user = Base_Common::getUserTable($this->table_code, $position);
$user = $this->db->replace($table_user, $unsignedCode);
$table_code = Base_Widget::getDbTable($this->table_code);
$bind = $unsignedCode;
unset($bind['ProductPackCode']);
$code = $this->db->update($table_code, $bind, '`ProductPackCode` = ?', $unsignedCode['ProductPackCode']);
if ($code && $user) {
$this->db->commit();
return true;
} else {
$this->db->rollback();
return false;
}
} else {
return false;
}
} else {
return false;
}
} else {
return false;
}
}
示例5: getSendErrorList
public function getSendErrorList($UserId, $SendId, $fields = '*')
{
$position = Base_Common::getUserDataPositionById($UserId);
$table_user = Base_Common::getUserTable($this->table_send_log_user, $position);
$sql = "select {$fields} from {$table_user} where `SendStatus` = 2 and `UserId` = ? and `SendId` = ?";
return $this->db->getAll($sql, array($UserId, $SendId));
}
示例6: DelUserMailAndCommunication
public function DelUserMailAndCommunication($UserArr)
{
$table_communication = "user_info_communication";
$table_mail = "user_mail";
$delCommunicationCount = $delMailCount = 0;
$UpComCount = $UpMailCount = 0;
$table_to_update = Base_Widget::getDbTable($this->table_del);
$CommunicationArr = array("Communication" => 1);
$MailArr = array("Mail" => 1);
foreach ($UserArr as $k => $v) {
$position = Base_Common::getUserDataPositionByName($v["UserName"]);
$table_to_communication = Base_Common::getUserTable($table_communication, $position);
$sql = "SELECT UserMail from {$table_to_communication} WHERE `UserId`=" . $v["UserId"];
$Usermail = $this->db->getOne($sql);
if ($Usermail) {
//user_mail表是通过mail来定位的
$position = Base_Common::getUserDataPositionByName($Usermail);
$table_to_mail = Base_Common::getUserTable($table_mail, $position);
if ($this->db->delete($table_to_mail, '`UserId` = ?', $v["UserId"])) {
if ($this->db->update($table_to_update, $MailArr, '`UserId` = ?', $v["UserId"])) {
$UpMailCount++;
}
$delMailCount++;
}
}
if ($this->db->delete($table_to_communication, '`UserId` = ?', $v["UserId"])) {
if ($this->db->update($table_to_update, $CommunicationArr, '`UserId` = ?', $v["UserId"])) {
$UpComCount++;
}
$delCommunicationCount++;
}
}
return array("DelMailCount" => $delMailCount, "DelCommunicationCount" => $delCommunicationCount, "UpMailCount" => $UpMailCount, "UpComCount" => $UpComCount);
}