本文整理汇总了PHP中Feedback::GetByChatId方法的典型用法代码示例。如果您正苦于以下问题:PHP Feedback::GetByChatId方法的具体用法?PHP Feedback::GetByChatId怎么用?PHP Feedback::GetByChatId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Feedback
的用法示例。
在下文中一共展示了Feedback::GetByChatId方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: InitFeedback
function InitFeedback($_userInitiated = true)
{
global $USER;
Server::InitDataBlock(array("DBCONFIG"));
if (empty(Server::$Configuration->Database["gl_fb"])) {
return;
}
$cid = $USER->Browsers[0]->GetLastActiveChatId();
if ($_userInitiated || !empty($cid)) {
if ($_userInitiated || Feedback::GetByChatId($cid) == null) {
$langparam = isset($_GET["el"]) ? "&el=" . $_GET["el"] : "";
$value = "0;" . base64_encode(LIVEZILLA_URL . "feedback.php?cid=" . Encoding::Base64UrlEncode($cid) . $langparam);
$fovl = new OverlayBox(CALLER_USER_ID, CALLER_BROWSER_ID, $value);
$fovl->Id = md5($cid . CALLER_USER_ID . CALLER_BROWSER_ID);
$fovl->Save();
$fovl->SetStatus(false);
}
}
}
示例2: GetRatingAVG
static function GetRatingAVG($_chatId, $ratav = "-")
{
Server::InitDataBlock(array("DBCONFIG"));
$fb = Feedback::GetByChatId($_chatId);
if (!empty($fb)) {
$fb->LoadCriteriaList();
$scount = 0;
$svalue = 0;
$scomment = "";
foreach (Server::$Configuration->Database["gl_fb"] as $criteria) {
if (!isset($fb->CriteriaList[$criteria->Id])) {
continue;
}
if ($criteria->Type == 0) {
$scount++;
$svalue += $fb->CriteriaList[$criteria->Id];
} else {
if ($criteria->Type == 1) {
$scomment .= $fb->CriteriaList[$criteria->Id];
}
}
$ratav = round($svalue / $scount, 1) . "/5 (" . $scomment . ")";
}
}
return $ratav;
}