本文整理汇总了PHP中CSaleBasket::GetLeave方法的典型用法代码示例。如果您正苦于以下问题:PHP CSaleBasket::GetLeave方法的具体用法?PHP CSaleBasket::GetLeave怎么用?PHP CSaleBasket::GetLeave使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CSaleBasket
的用法示例。
在下文中一共展示了CSaleBasket::GetLeave方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: realpath
*
*/
$_SERVER["DOCUMENT_ROOT"] = realpath(dirname(__FILE__) . "/../..");
$DOCUMENT_ROOT = $_SERVER["DOCUMENT_ROOT"];
define("NO_KEEP_STATISTIC", true);
define("NOT_CHECK_PERMISSIONS", true);
define('CHK_EVENT', true);
require_once $_SERVER['DOCUMENT_ROOT'] . '/bitrix/modules/main/include/prolog_before.php';
@set_time_limit(0);
@ignore_user_abort(true);
CModule::IncludeModule('sale');
// Получим дату, до которой нам необходимо получить отложенные товары.
$filterDate = (new \DateTime())->modify('-30 days')->format('d.m.Y');
$arFilter = ['>=DATE_UPDATE' => $filterDate];
// Получим брошенные корзины пользователей
$dbLeaveBasketResultList = CSaleBasket::GetLeave(array($by => $order), $arFilter, false, false);
// Получим данные о корзинах пользователя
while ($arBasket = $dbLeaveBasketResultList->Fetch()) {
if (intval($arBasket['USER_ID']) == 0) {
continue;
}
// Создадим массив идентификаторов пользователей
$arUserID[] = $arBasket['USER_ID'];
$arFilterBasket = array("ORDER_ID" => false, "FUSER_ID" => $arBasket["FUSER_ID"], "LID" => $arBasket["LID"], "DELAY" => 'Y');
$arBasketItems = array();
$dbB = CSaleBasket::GetList(array("ID" => "ASC"), $arFilterBasket, false, false, array("ID", "PRODUCT_ID", "NAME", "QUANTITY", "PRICE", "CURRENCY", "DETAIL_PAGE_URL", "LID", "CAN_BUY", "SUBSCRIBE", "DELAY", 'ORDER_ID'));
// Создадим массив с отложенными товарами, распределенными по пользователям
while ($arB = $dbB->Fetch()) {
$arItemsByUser[$arBasket['USER_ID']][] = $arB;
}
}
示例2: elseif
} elseif ($arItems["DELAY"] == "Y") {
$url .= "&productDelay[]=" . $arItems["PRODUCT_ID"];
} elseif ($arItems["SUBSCRIBE"] == "Y") {
$url .= "&productSub[]=" . $arItems["PRODUCT_ID"];
} else {
$url .= "&productNA[]=" . $arItems["PRODUCT_ID"];
}
}
if (count($arID) > 0) {
LocalRedirect($url);
die;
}
}
}
}
$dbResultList = CSaleBasket::GetLeave(array($by => $order), $arFilter, false, array("nPageSize" => CAdminResult::GetNavSize($sTableID)));
$dbResultList = new CAdminResult($dbResultList, $sTableID);
$dbResultList->NavStart();
$lAdmin->NavText($dbResultList->GetNavPrint(GetMessage("SB_NAV")));
$lAdmin->AddHeaders(array(array("id" => "DATE_UPDATE_MAX", "content" => GetMessage("SB_DATE_UPDATE"), "sort" => "DATE_UPDATE_MAX", "default" => true), array("id" => "USER_ID", "content" => GetMessage("SB_USER"), "sort" => "user_id", "default" => true), array("id" => "PRICE_ALL", "content" => GetMessage("SB_PRICE_ALL"), "sort" => "PRICE_ALL", "default" => true, "align" => "right"), array("id" => "QUANTITY_ALL", "content" => GetMessage('SB_QUANTITY_ALL'), "sort" => "QUANTITY_ALL", "default" => false, "align" => "right"), array("id" => "PR_COUNT", "content" => GetMessage("SB_CNT"), "sort" => "PR_COUNT", "default" => true, "align" => "right"), array("id" => "LID", "content" => GetMessage("SB_LID"), "sort" => "LID", "default" => count($siteName) == 1 ? false : true), array("id" => "BASKET", "content" => GetMessage("SB_BASKET"), "sort" => "", "default" => true), array("id" => "BASKET_NAME", "content" => GetMessage("SB_BASKET_NAME"), "sort" => "", "default" => false), array("id" => "BASKET_QUANTITY", "content" => GetMessage("SB_BASKET_QUANTITY"), "sort" => "", "default" => false, "align" => "right"), array("id" => "BASKET_PRICE", "content" => GetMessage("SB_BASKET_PRICE"), "sort" => "", "default" => false, "align" => "right"), array("id" => "BASKET_AVAIBLE", "content" => GetMessage("BASKET_AVAIBLE"), "sort" => "", "default" => false), array("id" => "DATE_INSERT_MIN", "content" => GetMessage("SB_DATE_INSERT"), "sort" => "DATE_INSERT_MIN", "default" => true), array("id" => "FUSER_ID", "content" => GetMessage("SB_FUSER_ID"), "sort" => "FUSER_ID", "default" => false)));
$arVisibleColumns = $lAdmin->GetVisibleHeaderColumns();
while ($arBasket = $dbResultList->Fetch()) {
$row =& $lAdmin->AddRow($arBasket["ID"], $arBasket);
$row->AddField("ID", $arBasket["ID"]);
$fieldValue = GetMessage("SB_NOT_AUTH");
if (IntVal($arBasket["USER_ID"]) > 0) {
$fieldValue = "[<a href=\"/bitrix/admin/user_edit.php?ID=" . $arBasket["USER_ID"] . "&lang=" . LANG . "\" title=\"" . GetMessage("SB_USER_INFO") . "\">" . $arBasket["USER_ID"] . "</a>] ";
$fieldValue .= " (" . htmlspecialcharsEx($arBasket["USER_LOGIN"]) . ") ";
$fieldValue .= "<a href=\"sale_buyers_profile.php?USER_ID=" . $arBasket["USER_ID"] . "&lang=" . LANG . "\" title=\"" . GetMessage("SB_FUSER_INFO") . "\">" . htmlspecialcharsEx($arBasket["USER_NAME"] . (strlen($arBasket["USER_NAME"]) <= 0 || strlen($arBasket["USER_LAST_NAME"]) <= 0 ? "" : " ") . $arBasket["USER_LAST_NAME"]) . "</a><br />";
$fieldValue .= "<a href=\"mailto:" . htmlspecialcharsEx($arBasket["USER_EMAIL"]) . "\" title=\"" . GetMessage("SB_MAILTO") . "\">" . htmlspecialcharsEx($arBasket["USER_EMAIL"]) . "</a>";
}