本文整理汇总了PHP中CSaleUserAccount::Delete方法的典型用法代码示例。如果您正苦于以下问题:PHP CSaleUserAccount::Delete方法的具体用法?PHP CSaleUserAccount::Delete怎么用?PHP CSaleUserAccount::Delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CSaleUserAccount
的用法示例。
在下文中一共展示了CSaleUserAccount::Delete方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: OnBeforeUserDeleteHandler
function OnBeforeUserDeleteHandler($user_id)
{
\CModule::IncludeModule("iblock");
\CModule::IncludeModule("sale");
//Привязки к соц. сетям
$arrFilter = array("IBLOCK_ID" => USER_SOCIAL_IB, "PROPERTY_USER_ID" => $user_id);
$arSelect = array("ID");
$rsRes = \CIBlockElement::GetList($arOrder, $arrFilter, false, false, $arSelect);
while ($arItem = $rsRes->GetNext()) {
\CIBlockElement::Delete($arItem["ID"]);
}
//Удаляем записи
$result = \Hawkart\Megatv\RecordTable::getList(array('filter' => array("UF_USER_ID" => $user_id), 'select' => array("ID")));
while ($arRecord = $result->fetch()) {
\CRecordEx::delete($arRecord["ID"]);
}
//Удаляем счет
if ($arAccount = \CSaleUserAccount::GetByUserID($user_id, "RUR")) {
\CSaleUserAccount::Delete($arAccount["ID"]);
}
//Удаляем заказы
$arFilter = array("USER_ID" => $user_id);
$db_sales = \CSaleOrder::GetList(array("DATE_INSERT" => "ASC"), $arFilter);
while ($ar_sales = $db_sales->Fetch()) {
\CSaleOrder::Delete($ar_sales["ID"]);
}
//Удаляем подписки
$result = \Hawkart\Megatv\SubscribeTable::getList(array('filter' => array("=UF_USER_ID" => $user_id), 'select' => array("ID")));
if ($arSub = $result->fetch()) {
\Hawkart\Megatv\SubscribeTable::delete($arSub["ID"]);
}
}
示例2: OnUserDelete
public static function OnUserDelete($userID)
{
$userID = IntVal($userID);
$bSuccess = True;
$dbUserAccounts = CSaleUserAccount::GetList(array(), array("USER_ID" => $userID), false, false, array("ID"));
while ($arUserAccount = $dbUserAccounts->Fetch()) {
if (!CSaleUserAccount::Delete($arUserAccount["ID"])) {
$bSuccess = False;
}
}
return $bSuccess;
}
示例3: while
while ($arAccountList = $dbResultList->Fetch()) {
$arID[] = $arAccountList['ID'];
}
}
foreach ($arID as $ID) {
if (strlen($ID) <= 0) {
continue;
}
switch ($_REQUEST['action']) {
case "delete":
@set_time_limit(0);
if ($saleModulePermissions >= "W") {
$DB->StartTransaction();
if ($arDelAccount = CSaleUserAccount::GetByID($ID)) {
if (CSaleUserAccount::UpdateAccount($arDelAccount["USER_ID"], -$arDelAccount["CURRENT_BUDGET"], $arDelAccount["CURRENCY"], "DEL_ACCOUNT", 0)) {
if (!CSaleUserAccount::Delete($ID)) {
$DB->Rollback();
if ($ex = $APPLICATION->GetException()) {
$lAdmin->AddGroupError($ex->GetString(), $ID);
} else {
$lAdmin->AddGroupError(str_replace("#ID#", $ID, GetMessage("SAA_ERROR_DELETE")), $ID);
}
}
} else {
$DB->Rollback();
if ($ex = $APPLICATION->GetException()) {
$lAdmin->AddGroupError($ex->GetString(), $ID);
} else {
$lAdmin->AddGroupError(str_replace("#ID#", $ID, GetMessage("SAA_ERROR_MONEY")), $ID);
}
}