本文整理汇总了PHP中CDBResult::fetch方法的典型用法代码示例。如果您正苦于以下问题:PHP CDBResult::fetch方法的具体用法?PHP CDBResult::fetch怎么用?PHP CDBResult::fetch使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CDBResult
的用法示例。
在下文中一共展示了CDBResult::fetch方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getSortedItems
private static function getSortedItems(\CDBResult $result, $userId, $groupId, $prevTaskSort, $prevTaskId, $sourceId, $targetId)
{
$items = array();
$itemIndex = -1;
$prevTaskIndex = null;
$targetFound = false;
while ($row = $result->fetch()) {
if ($sourceId == $row["ID"]) {
//Skip source task
continue;
}
if ($prevTaskIndex !== null) {
$items[$prevTaskIndex]["NEXT_TASK_ID"] = $row["ID"];
}
$prevTaskSort += static::SORT_INDEX_INCREMENT;
$fields = array("TASK_ID" => $row["ID"], "SORT" => $prevTaskSort, "PREV_TASK_ID" => $prevTaskId, "NEXT_TASK_ID" => 0);
if ($groupId) {
$fields["GROUP_ID"] = $groupId;
} else {
$fields["USER_ID"] = $userId;
}
$items[++$itemIndex] = $fields;
$prevTaskIndex = $itemIndex;
$prevTaskId = $row["ID"];
if ($targetId == $row["ID"]) {
$targetFound = true;
break;
}
}
return array($items, $targetFound);
}
示例2: unset
unset($arResult["arComments"][$key]);
}
}
}
$tmp = reset($arResult["arComments"]);
$request = \Bitrix\Main\Context::getCurrent()->getRequest();
$rating_entity_type = $tmp["EVENT"]["RATING_TYPE_ID"] ?: false;
$lastLogTs = (int) $request->getQuery("lastLogTs");
$db_res = new CDBResult();
$db_res->InitFromArray($arResult["arComments"]);
//$db_res->NavNum = 1;
//$db_res->NavStart(10, false);
$records = array();
$arEvent = CSocNetLogTools::FindLogCommentEventByLogEventID($arLog["EVENT_ID"]);
$offset = CTimeZone::GetOffset();
while (($arComment = $db_res->fetch()) && $arComment) {
$commentId = $arComment["EVENT"]["SOURCE_ID"] ? $arComment["EVENT"]["SOURCE_ID"] : $arComment["EVENT"]["ID"];
$timestamp = $arComment["LOG_DATE_TS"];
$datetime_formatted = CSocNetLogComponent::getDateTimeFormatted($timestamp, array("DATE_TIME_FORMAT" => $arParams["DATE_TIME_FORMAT"], "DATE_TIME_FORMAT_WITHOUT_YEAR" => $arParams["DATE_TIME_FORMAT_WITHOUT_YEAR"], "TIME_FORMAT" => $arParams["TIME_FORMAT"]));
ob_start();
?>
<script>
top.arLogCom<?php
echo $arLog["ID"];
echo $commentId;
?>
= '<?php
echo $arComment["EVENT"]["ID"];
?>
';<?php
?>
示例3: array
$result->NavStart();
}
$result->NavRecordCount = $totalCount;
$result->NavPageCount = $totalPage;
$result->NavPageNomer = $page;
$arResult["NAV_OBJECT"] = $result;
$arResult["ROWS_COUNT"] = $result->SelectedRowsCount();
$arResult["ELEMENTS_ROWS"] = array();
$arAvailableStatuses = array("200", "304", "603", "404", "486", "503", "480", "402", "1", "2", "3");
$bModuleCatalog = false;
if (CModule::IncludeModule("catalog")) {
$bModuleCatalog = true;
}
$arUserIds = array();
$portalNumbers = CVoxImplantConfig::GetPortalNumbers();
while ($data = $result->fetch()) {
$data = CVoxImplantHistory::PrepereData($data);
if ($data["PORTAL_USER_ID"] > 0 && !in_array($data["PORTAL_USER_ID"], $arUserIds)) {
$arUserIds[] = $data["PORTAL_USER_ID"];
}
if (in_array($data["CALL_FAILED_CODE"], array(1, 2, 3, 409))) {
$data["CALL_FAILED_REASON"] = GetMessage("TELEPHONY_STATUS_" . $data["CALL_FAILED_CODE"]);
}
if (isset($portalNumbers[$data["PORTAL_NUMBER"]])) {
$data["PORTAL_NUMBER"] = $portalNumbers[$data["PORTAL_NUMBER"]];
} else {
if (substr($data["PORTAL_NUMBER"], 0, 3) == 'sip') {
$data["PORTAL_NUMBER"] = GetMessage("TELEPHONY_PORTAL_PHONE_SIP_OFFICE", array('#ID#' => substr($data["PORTAL_NUMBER"], 3)));
} else {
if (substr($data["PORTAL_NUMBER"], 0, 3) == 'reg') {
$data["PORTAL_NUMBER"] = GetMessage("TELEPHONY_PORTAL_PHONE_SIP_CLOUD", array('#ID#' => substr($data["PORTAL_NUMBER"], 3)));