本文整理汇总了PHP中erLhcoreClassChat::getCount方法的典型用法代码示例。如果您正苦于以下问题:PHP erLhcoreClassChat::getCount方法的具体用法?PHP erLhcoreClassChat::getCount怎么用?PHP erLhcoreClassChat::getCount使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类erLhcoreClassChat
的用法示例。
在下文中一共展示了erLhcoreClassChat::getCount方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __get
public function __get($var)
{
switch ($var) {
case 'is_online':
$this->is_online = erLhcoreClassChat::isOnline($this->id);
return $this->is_online;
break;
case 'is_online_exclipic':
$this->is_online_exclipic = erLhcoreClassChat::isOnline($this->id, true);
return $this->is_online_exclipic;
break;
case 'inform_options_array':
$this->inform_options_array = $this->inform_options != '' ? unserialize($this->inform_options) : array();
return $this->inform_options_array;
break;
case 'can_delete':
$this->can_delete = erLhcoreClassChat::getCount(array('filter' => array('dep_id' => $this->id))) == 0;
return $this->can_delete;
break;
case 'department_transfer':
$this->department_transfer = false;
if ($this->department_transfer_id > 0) {
try {
$this->department_transfer = self::fetch($this->department_transfer_id, true);
} catch (Exception $e) {
}
}
return $this->department_transfer;
break;
case 'start_hour_front':
return floor($this->start_hour / 100);
break;
case 'start_minutes_front':
return $this->start_hour - $this->start_hour_front * 100;
break;
case 'end_hour_front':
return floor($this->end_hour / 100);
break;
case 'end_minutes_front':
return $this->end_hour - $this->end_hour_front * 100;
break;
default:
break;
}
}
示例2: afterSave
public function afterSave()
{
$db = ezcDbInstance::get();
$stmt = $db->prepare('DELETE FROM lh_userdep WHERE dep_group_id = :dep_group_id AND user_id = :user_id');
$stmt->bindValue(':dep_group_id', $this->dep_group_id);
$stmt->bindValue(':user_id', $this->user_id);
$stmt->execute();
foreach ($this->dep_group->departments_ids as $depId) {
$stmt = $db->prepare('INSERT INTO lh_userdep (user_id,dep_id,hide_online,last_activity,last_accepted,active_chats,type,dep_group_id) VALUES (:user_id,:dep_id,:hide_online,0,0,:active_chats,1,:dep_group_id)');
$stmt->bindValue(':user_id', $this->user_id);
$stmt->bindValue(':dep_id', $depId);
$stmt->bindValue(':hide_online', $this->user->hide_online);
$stmt->bindValue(':dep_group_id', $this->dep_group_id);
$stmt->bindValue(':active_chats', erLhcoreClassChat::getCount(array('filter' => array('user_id' => $this->user_id, 'status' => erLhcoreClassModelChat::STATUS_ACTIVE_CHAT))));
$stmt->execute();
}
erLhcoreClassModelDepartamentGroupMember::updateUserDepartmentsIds($this->user_id);
}
示例3: addUserDepartaments
public static function addUserDepartaments($Departaments, $userID = false, $UserData = false)
{
$db = ezcDbInstance::get();
if ($userID === false) {
$currentUser = erLhcoreClassUser::instance();
$userID = $currentUser->getUserID();
}
$stmt = $db->prepare('DELETE FROM lh_userdep WHERE user_id = :user_id ORDER BY id ASC');
$stmt->bindValue(':user_id', $userID);
$stmt->execute();
foreach ($Departaments as $DepartamentID) {
$stmt = $db->prepare('INSERT INTO lh_userdep (user_id,dep_id,hide_online,last_activity,last_accepted,active_chats) VALUES (:user_id,:dep_id,:hide_online,0,0,:active_chats)');
$stmt->bindValue(':user_id', $userID);
$stmt->bindValue(':dep_id', $DepartamentID);
$stmt->bindValue(':hide_online', $UserData->hide_online);
$stmt->bindValue(':active_chats', erLhcoreClassChat::getCount(array('filter' => array('user_id' => $UserData->id, 'status' => erLhcoreClassModelChat::STATUS_ACTIVE_CHAT))));
$stmt->execute();
}
if (isset($_SESSION['lhCacheUserDepartaments_' . $userID])) {
unset($_SESSION['lhCacheUserDepartaments_' . $userID]);
}
}
示例4: afterSave
public function afterSave()
{
$db = ezcDbInstance::get();
$stmt = $db->prepare('SELECT user_id FROM lh_departament_group_user WHERE dep_group_id = :dep_group_id');
$stmt->bindValue(':dep_group_id', $this->dep_group_id);
$stmt->execute();
$userIds = $stmt->fetchAll(PDO::FETCH_COLUMN);
foreach ($userIds as $userId) {
$stmt = $db->prepare('SELECT hide_online FROM lh_users WHERE id = :user_id');
$stmt->bindValue(':user_id', $userId);
$stmt->execute();
$hide_online = $stmt->fetch(PDO::FETCH_COLUMN);
$stmt = $db->prepare('INSERT INTO lh_userdep (user_id,dep_id,hide_online,last_activity,last_accepted,active_chats,type,dep_group_id) VALUES (:user_id,:dep_id,:hide_online,0,0,:active_chats,1,:dep_group_id)');
$stmt->bindValue(':user_id', $userId);
$stmt->bindValue(':dep_id', $this->dep_id);
$stmt->bindValue(':hide_online', $hide_online);
$stmt->bindValue(':dep_group_id', $this->dep_group_id);
$stmt->bindValue(':active_chats', erLhcoreClassChat::getCount(array('filter' => array('user_id' => $userId, 'status' => erLhcoreClassModelChat::STATUS_ACTIVE_CHAT))));
$stmt->execute();
self::updateUserDepartmentsIds($userId);
}
}
示例5: messages
echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/statistic', 'Total messages (only visitors)');
?>
</td>
<td><?php
$totalVisitorsMessagesCount = erLhcoreClassChat::getCount(array_merge_recursive($filter24, array('filter' => array('user_id' => 0))), 'lh_msg');
echo $totalVisitorsMessagesCount;
?>
</td>
</tr>
<tr>
<td><?php
echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/statistic', 'Total messages (only system messages)');
?>
</td>
<td><?php
$systemMessagesCount = erLhcoreClassChat::getCount(array_merge_recursive($filter24, array('filter' => array('user_id' => -1))), 'lh_msg');
echo $systemMessagesCount;
?>
</td>
</tr>
<tr>
<td><?php
echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/statistic', 'Total messages (only operators)');
?>
</td>
<td><?php
echo $totalMessagesCount - $systemMessagesCount - $totalVisitorsMessagesCount;
?>
</td>
</tr>
</table>
示例6: getCount
public static function getCount($params = array())
{
return erLhcoreClassChat::getCount($params, "lh_chat_online_user");
}
示例7: __get
public function __get($var)
{
switch ($var) {
case 'is_online':
$this->is_online = erLhcoreClassChat::isOnline($this->id);
return $this->is_online;
break;
case 'is_online_exclipic':
$this->is_online_exclipic = erLhcoreClassChat::isOnline($this->id, true);
return $this->is_online_exclipic;
break;
case 'inform_options_array':
$this->inform_options_array = $this->inform_options != '' ? unserialize($this->inform_options) : array();
return $this->inform_options_array;
break;
case 'can_delete':
$this->can_delete = erLhcoreClassChat::getCount(array('filter' => array('dep_id' => $this->id))) == 0;
return $this->can_delete;
break;
case 'department_transfer':
$this->department_transfer = false;
if ($this->department_transfer_id > 0) {
try {
$this->department_transfer = self::fetch($this->department_transfer_id, true);
} catch (Exception $e) {
}
}
return $this->department_transfer;
break;
case 'start_hour_front':
return floor($this->start_hour / 100);
break;
case 'start_minutes_front':
return $this->start_hour - $this->start_hour_front * 100;
break;
case 'end_hour_front':
return floor($this->end_hour / 100);
break;
case 'end_minutes_front':
return $this->end_hour - $this->end_hour_front * 100;
break;
case 'mod_start_hour_front':
case 'tud_start_hour_front':
case 'wed_start_hour_front':
case 'thd_start_hour_front':
case 'frd_start_hour_front':
case 'sad_start_hour_front':
case 'sud_start_hour_front':
$startHourName = str_replace('_start_hour_front', '', $var) . '_start_hour';
return $this->{$startHourName} != -1 ? floor($this->{$startHourName} / 100) : '';
break;
case 'mod_start_minutes_front':
case 'tud_start_minutes_front':
case 'wed_start_minutes_front':
case 'thd_start_minutes_front':
case 'frd_start_minutes_front':
case 'sad_start_minutes_front':
case 'sud_start_minutes_front':
$startHourName = str_replace('_start_minutes_front', '', $var) . '_start_hour';
$startHourFrontName = str_replace('_start_minutes_front', '', $var) . '_start_hour_front';
return $this->{$startHourName} != -1 ? $this->{$startHourName} - $this->{$startHourFrontName} * 100 : '';
break;
case 'mod_end_hour_front':
case 'tud_end_hour_front':
case 'wed_end_hour_front':
case 'thd_end_hour_front':
case 'frd_end_hour_front':
case 'sad_end_hour_front':
case 'sud_end_hour_front':
$endHourName = str_replace('_end_hour_front', '', $var) . '_end_hour';
return $this->{$endHourName} != -1 ? floor($this->{$endHourName} / 100) : '';
break;
case 'mod_end_minutes_front':
case 'tud_end_minutes_front':
case 'wed_end_minutes_front':
case 'thd_end_minutes_front':
case 'frd_end_minutes_front':
case 'sad_end_minutes_front':
case 'sud_end_minutes_front':
$endHourName = str_replace('_end_minutes_front', '', $var) . '_end_hour';
$endHourFrontName = str_replace('_end_minutes_front', '', $var) . '_end_hour_front';
return $this->{$endHourName} != -1 ? $this->{$endHourName} - $this->{$endHourFrontName} * 100 : '';
break;
default:
break;
}
}
示例8: updateActiveChats
public static function updateActiveChats($user_id)
{
$db = ezcDbInstance::get();
$stmt = $db->prepare('UPDATE lh_userdep SET active_chats = :active_chats WHERE user_id = :user_id');
$stmt->bindValue(':active_chats', erLhcoreClassChat::getCount(array('filter' => array('user_id' => $user_id, 'status' => erLhcoreClassModelChat::STATUS_ACTIVE_CHAT))), PDO::PARAM_INT);
$stmt->bindValue(':user_id', $user_id, PDO::PARAM_INT);
$stmt->execute();
}
示例9: messages
echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/statistic', 'Total messages (only visitors)');
?>
</td>
<td><?php
$totalVisitorsMessagesCount = erLhcoreClassChat::getCount(array('filter' => array('user_id' => 0), 'filtergte' => array('time' => time() - 24 * 3600)), 'lh_msg');
echo $totalVisitorsMessagesCount;
?>
</td>
</tr>
<tr>
<td><?php
echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/statistic', 'Total messages (only system messages)');
?>
</td>
<td><?php
$systemMessagesCount = erLhcoreClassChat::getCount(array('filter' => array('user_id' => -1), 'filtergte' => array('time' => time() - 24 * 3600)), 'lh_msg');
echo $systemMessagesCount;
?>
</td>
</tr>
<tr>
<td><?php
echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/statistic', 'Total messages (only operators)');
?>
</td>
<td><?php
echo $totalMessagesCount - $systemMessagesCount - $totalVisitorsMessagesCount;
?>
</td>
</tr>
</table>
示例10: getAverageChatduration
public static function getAverageChatduration($days = 30)
{
$dateUnixPast = mktime(0, 0, 0, date('m'), date('d') - $days, date('y'));
return erLhcoreClassChat::getCount(array('filtergt' => array('time' => $dateUnixPast, 'chat_duration' => 0), 'filter' => array('status' => erLhcoreClassModelChat::STATUS_CLOSED_CHAT)), 'lh_chat', 'AVG(chat_duration)');
}
示例11: __get
public function __get($var)
{
switch ($var) {
case 'range_from_front':
if ($this->range_from != 0) {
return date(erLhcoreClassModule::$dateFormat, $this->range_from);
}
return '';
break;
case 'range_to_front':
if ($this->range_to != 0) {
return date(erLhcoreClassModule::$dateFormat, $this->range_to);
}
return '';
break;
case 'potential_chats_count':
$this->potential_chats_count = erLhcoreClassChat::getCount(array('filterlt' => array('time' => $this->range_to), 'filtergt' => array('time' => $this->range_from)));
return $this->potential_chats_count;
break;
case 'chats_in_archive':
$this->chats_in_archive = 0;
if ($this->id > 0) {
self::$archiveTable = "lh_chat_archive_{$this->id}";
self::$archiveMsgTable = "lh_chat_archive_msg_{$this->id}";
$this->chats_in_archive = erLhcoreClassChat::getCount(array(), self::$archiveTable);
}
return $this->chats_in_archive;
break;
case 'messages_in_archive':
$this->messages_in_archive = 0;
if ($this->id > 0) {
self::$archiveTable = "lh_chat_archive_{$this->id}";
self::$archiveMsgTable = "lh_chat_archive_msg_{$this->id}";
$this->messages_in_archive = erLhcoreClassChat::getCount(array(), self::$archiveMsgTable);
}
return $this->messages_in_archive;
break;
default:
break;
}
}
示例12: lhPaginator
<?php
$tpl = erLhcoreClassTemplate::getInstance('lhfile/list.tpl.php');
if (isset($_GET['doSearch'])) {
$filterParams = erLhcoreClassSearchHandler::getParams(array('module' => 'chat', 'module_file' => 'filelist', 'format_filter' => true, 'use_override' => true, 'uparams' => $Params['user_parameters_unordered']));
$filterParams['is_search'] = true;
} else {
$filterParams = erLhcoreClassSearchHandler::getParams(array('module' => 'chat', 'module_file' => 'filelist', 'format_filter' => true, 'uparams' => $Params['user_parameters_unordered']));
$filterParams['is_search'] = false;
}
$append = erLhcoreClassSearchHandler::getURLAppendFromInput($filterParams['input_form']);
$pages = new lhPaginator();
$pages->serverURL = erLhcoreClassDesign::baseurl('file/list') . $append;
$pages->items_total = erLhcoreClassChat::getCount($filterParams['filter'], 'lh_chat_file');
$pages->setItemsPerPage(20);
$pages->paginate();
$items = array();
if ($pages->items_total > 0) {
$items = erLhcoreClassChat::getList(array_merge(array('offset' => $pages->low, 'limit' => $pages->items_per_page, 'sort' => 'id DESC'), $filterParams['filter']), 'erLhcoreClassModelChatFile', 'lh_chat_file');
}
$tpl->set('items', $items);
$tpl->set('pages', $pages);
$filterParams['input_form']->form_action = erLhcoreClassDesign::baseurl('file/list');
$tpl->set('input', $filterParams['input_form']);
$Result['content'] = $tpl->fetch();
$Result['path'] = array(array('url' => erLhcoreClassDesign::baseurl('system/configuration'), 'title' => erTranslationClassLhTranslation::getInstance()->getTranslation('system/configuration', 'System configuration')), array('url' => erLhcoreClassDesign::baseurl('file/list'), 'title' => erTranslationClassLhTranslation::getInstance()->getTranslation('system/configuration', 'List of files')));
示例13: __get
public function __get($var)
{
switch ($var) {
case 'time_created_front':
$this->time_created_front = date('Ymd') == date('Ymd', $this->time) ? date(erLhcoreClassModule::$dateHourFormat, $this->time) : date(erLhcoreClassModule::$dateDateHourFormat, $this->time);
return $this->time_created_front;
break;
case 'user_closed_ts_front':
$this->user_closed_ts_front = date('Ymd') == date('Ymd', $this->user_closed_ts) ? date(erLhcoreClassModule::$dateHourFormat, $this->user_closed_ts) : date(erLhcoreClassModule::$dateDateHourFormat, $this->user_closed_ts);
return $this->user_closed_ts_front;
break;
case 'is_operator_typing':
$this->is_operator_typing = $this->operator_typing > time() - 60;
// typing is considered if status did not changed for 30 seconds
return $this->is_operator_typing;
break;
case 'is_user_typing':
$this->is_user_typing = $this->user_typing > time() - 10;
// typing is considered if status did not changed for 30 seconds
return $this->is_user_typing;
break;
case 'wait_time_seconds':
$this->wait_time_seconds = time() - $this->time;
return $this->wait_time_seconds;
case 'wait_time_front':
$this->wait_time_front = erLhcoreClassChat::formatSeconds($this->wait_time);
return $this->wait_time_front;
break;
case 'wait_time_pending':
$this->wait_time_pending = erLhcoreClassChat::formatSeconds(time() - $this->time);
return $this->wait_time_pending;
break;
case 'chat_duration_front':
$this->chat_duration_front = erLhcoreClassChat::formatSeconds($this->chat_duration);
return $this->chat_duration_front;
break;
case 'user_name':
return $this->user_name = (string) $this->user;
break;
case 'plain_user_name':
$this->plain_user_name = false;
if ($this->user !== false) {
$this->plain_user_name = (string) $this->user->name_support;
}
return $this->plain_user_name;
break;
case 'user':
$this->user = false;
if ($this->user_id > 0) {
try {
$this->user = erLhcoreClassModelUser::fetch($this->user_id, true);
} catch (Exception $e) {
$this->user = false;
}
}
return $this->user;
break;
case 'operator_typing_user':
$this->operator_typing_user = false;
if ($this->operator_typing_id > 0) {
try {
$this->operator_typing_user = erLhcoreClassModelUser::fetch($this->operator_typing_id);
} catch (Exception $e) {
$this->operator_typing_user = false;
}
}
return $this->operator_typing_user;
break;
case 'online_user':
$this->online_user = false;
if ($this->online_user_id > 0) {
try {
$this->online_user = erLhcoreClassModelChatOnlineUser::fetch($this->online_user_id);
} catch (Exception $e) {
$this->online_user = false;
}
}
return $this->online_user;
break;
case 'department':
$this->department = false;
if ($this->dep_id > 0) {
try {
$this->department = erLhcoreClassModelDepartament::fetch($this->dep_id, true);
} catch (Exception $e) {
}
}
return $this->department;
break;
case 'department_name':
return $this->department_name = (string) $this->department;
break;
case 'number_in_queue':
$this->number_in_queue = 1;
if ($this->status == self::STATUS_PENDING_CHAT) {
$this->number_in_queue = erLhcoreClassChat::getCount(array('filterlt' => array('id' => $this->id), 'filter' => array('dep_id' => $this->dep_id, 'status' => self::STATUS_PENDING_CHAT))) + 1;
}
return $this->number_in_queue;
break;
case 'screenshot':
//.........这里部分代码省略.........
示例14: lhPaginator
<?php
$tpl = erLhcoreClassTemplate::getInstance('lhchatarchive/list.tpl.php');
$pages = new lhPaginator();
$pages->serverURL = erLhcoreClassDesign::baseurl('chatarchive/list');
$pages->items_total = erLhcoreClassChat::getCount(array(), 'lh_chat_archive_range', 'count(id)');
$pages->setItemsPerPage(20);
$pages->paginate();
$items = array();
if ($pages->items_total > 0) {
$items = erLhcoreClassChat::getList(array('offset' => $pages->low, 'limit' => $pages->items_per_page, 'sort' => 'id ASC'), 'erLhcoreClassModelChatArchiveRange', 'lh_chat_archive_range');
}
$tpl->set('items', $items);
$tpl->set('pages', $pages);
$Result['content'] = $tpl->fetch();
$Result['path'] = array(array('url' => erLhcoreClassDesign::baseurl('system/configuration'), 'title' => erTranslationClassLhTranslation::getInstance()->getTranslation('department/departments', 'System configuration')), array('url' => erLhcoreClassDesign::baseurl('chatarchive/archive'), 'title' => erTranslationClassLhTranslation::getInstance()->getTranslation('chatarchive/archive', 'Chat archive')));
$Result['path'][] = array('title' => erTranslationClassLhTranslation::getInstance()->getTranslation('chatarchive/list', 'Archives list'));
示例15: array
<?php
$hash = (string) $Params['user_parameters']['hash'];
$format = (string) $Params['user_parameters_unordered']['format'] == 'xml' ? 'xml' : 'json';
$hashSecret = erLhcoreClassModelChatConfig::fetch('export_hash')->current_value;
try {
if (sha1('getcount' . $hashSecret) == $hash) {
$filter = array();
if (is_array($Params['user_parameters_unordered']['status'])) {
foreach ($Params['user_parameters_unordered']['status'] as $status) {
$filter['filterin']['status'][] = (int) $status;
}
}
$totalChats = erLhcoreClassChat::getCount($filter);
if ($format == 'json') {
header('Content-type: application/json');
echo json_encode(array('count' => $totalChats));
exit;
} else {
header('Content-type: text/xml');
echo '<?xml version="1.0" encoding="utf-8" ?>', "<lhc><count>{$totalChats}</count></lhc>";
exit;
}
} else {
throw new Exception('Invalid hash.');
}
} catch (Exception $e) {
if ($format == 'json') {
header('Content-type: application/json');
echo json_encode(array('error' => $e->getMessage()));
exit;