本文整理汇总了PHP中CSaleOrder::GetList方法的典型用法代码示例。如果您正苦于以下问题:PHP CSaleOrder::GetList方法的具体用法?PHP CSaleOrder::GetList怎么用?PHP CSaleOrder::GetList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CSaleOrder
的用法示例。
在下文中一共展示了CSaleOrder::GetList方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: OnBasketAddHandler
function OnBasketAddHandler($ID, $arFields)
{
global $USER;
\Bitrix\Main\Loader::includeModule('catalog');
\Bitrix\Main\Loader::includeModule('sale');
if ($USER->IsAuthorized()) {
$arFilter = array("USER_ID" => $USER->GetID());
$db_sales = CSaleOrder::GetList(array("DATE_INSERT" => "ASC"), $arFilter);
$arrCount = [];
while ($ar_sales = $db_sales->Fetch()) {
$arrCount[] = $ar_sales;
}
if (is_array($arrCount) == false) {
$res = CCatalogDiscount::SetCoupon('SL-CDUEA-HI8MMPY');
//3%
} else {
if (count($arrCount) >= 1) {
$resClean = CCatalogDiscount::ClearCoupon('SL-CDUEA-HI8MMPY');
$res5 = CCatalogDiscount::SetCoupon('SL-0JG2C-XIHBEYZ');
//5%
} else {
}
}
} else {
$res = CCatalogDiscountCoupon::SetCoupon('SL-CDUEA-HI8MMPY');
//3%
}
}
示例2: chStatusOld
public static function chStatusOld($id, $status)
{
try {
self::$o_erip = new \Dm\Erip();
self::$opt_status = \Bitrix\Main\Config\Option::get(self::$module_id, "order_status_code_erip");
self::$opt_payment = \Bitrix\Main\Config\Option::get(self::$module_id, "payment_system_id");
self::$values = CSaleOrder::GetList(array(), array("ID" => $id), false, false, array("ID", "PAY_SYSTEM_ID", "PRICE", "CURRENCY", "STATUS_ID"))->Fetch();
if (self::$values["PAY_SYSTEM_ID"] == self::$opt_payment && $status != self::$values["STATUS_ID"] && $status == self::$opt_status) {
static::setTehnicalInfo();
static::setUserInfo();
static::setMoneyInfo();
$r = self::$o_erip->submit();
self::$o_response = json_decode($r);
if (isset(self::$o_response->errors)) {
throw new \Exception(self::$o_response->message);
}
if (CSaleOrder::Update($id, array("COMMENTS" => "status: " . self::$o_response->transaction->status . "\n" . "transaction_id: " . self::$o_response->transaction->transaction_id . "\n" . "order_id: " . self::$o_response->transaction->order_id . "\n" . "account_number: " . self::$o_response->transaction->erip->account_number . "\n"))) {
static::sendMail();
}
return true;
}
} catch (Exception $e) {
$GLOBALS["APPLICATION"]->ThrowException($e->getMessage());
return false;
}
}
示例3: 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"]);
}
}
示例4: CountOrderSumm
private static function CountOrderSumm($USER_ID)
{
if(!CModule::IncludeModule("sale"))
return false;
$rs = CSaleOrder::GetList(
array(),
array(
"USER_ID" => $USER_ID,
"STATUS_ID" => "F"
),
false,
false,
array()
);
$iSumm = 0;
while($ar = $rs -> Fetch())
{
if($ar["CURRENCY"] !== "RUB") continue;
$iSumm += ($ar["PRICE"] - $ar["PRICE_DELIVERY"]);
}
return $iSumm;
}
示例5: isDeliveryInOrders
protected static function isDeliveryInOrders($deliveryId)
{
$dbOrders = \CSaleOrder::GetList(array(), array("DELIVERY_ID" => $deliveryId), false, false, array("ID"));
if ($dbOrders->Fetch()) {
$result = true;
} else {
$result = false;
}
return $result;
}
示例6: onGenerateInitialData
public static function onGenerateInitialData(Date $from, Date $to)
{
$data = array();
// 1. Payments
$result = \CSaleOrder::GetList(array(), array('PAYED' => 'Y', 'CANCELED' => 'N', '>=DATE_PAYED' => $from, '<=DATE_PAYED' => $to), false, false, array('LID', 'DATE_PAYED', 'PRICE', 'CURRENCY'));
while ($row = $result->Fetch()) {
$day = new DateTime($row['DATE_PAYED']);
$sum = Config::convertToBaseCurrency($row['PRICE'], $row['CURRENCY']);
if ($counters =& $data[$row['LID']][$day->format('Y-m-d')]) {
$counters['sale_payment_add_day'] += 1;
$counters['sale_payment_sum_add'] += $sum;
} else {
$counters = array('sale_payment_add_day' => 1, 'sale_payment_sum_add' => $sum);
}
}
// 2. Orders
$result = \CSaleOrder::GetList(array(), array('CANCELED' => 'N', '>=DATE_INSERT' => $from, '<=DATE_INSERT' => $to), false, false, array('LID', 'DATE_INSERT', 'PRICE', 'CURRENCY'));
while ($row = $result->Fetch()) {
$day = new DateTime($row['DATE_INSERT']);
$sum = Config::convertToBaseCurrency($row['PRICE'], $row['CURRENCY']);
if ($counters =& $data[$row['LID']][$day->format('Y-m-d')]) {
$counters['sale_order_add_day'] += 1;
$counters['sale_order_sum_add'] += $sum;
} else {
$counters = array('sale_order_add_day' => 1, 'sale_order_sum_add' => $sum);
}
}
// 3. Cart
$result = \CSaleBasket::GetList(array(), array('>=DATE_INSERT' => $from, '<=DATE_INSERT' => $to), false, false, array('LID', 'DATE_INSERT', 'PRICE', 'CURRENCY', 'QUANTITY'));
while ($row = $result->Fetch()) {
$day = new DateTime($row['DATE_INSERT']);
$sum = Config::convertToBaseCurrency($row['PRICE'] * $row['QUANTITY'], $row['CURRENCY']);
if ($counters =& $data[$row['LID']][$day->format('Y-m-d')]) {
$counters['sale_cart_add_day'] += 1;
$counters['sale_cart_sum_add'] += $sum;
} else {
$counters = array('sale_cart_add_day' => 1, 'sale_cart_sum_add' => $sum);
}
}
// Result
unset($counters);
$result = array();
foreach ($data as $siteId => $dayCounters) {
$result[] = array('ATTRIBUTES' => array('conversion_site' => $siteId), 'DAY_COUNTERS' => $dayCounters);
}
return $result;
}
示例7: OnSalePayOrder
public static function OnSalePayOrder($ID, $val)
{
$ID = intval($ID);
if ($ID > 0 && $val == 'Y') {
$arOrder = array();
$dbBasketItems = CSaleBasket::GetList(array(), array('ORDER_ID' => $ID), false, false, array('ID', 'MODULE', 'CATALOG_XML_ID', 'QUANTITY'));
while ($arItems = $dbBasketItems->Fetch()) {
if ($arItems['MODULE'] == 'asd.money' && !empty($arItems['CATALOG_XML_ID']) && strpos($arItems['CATALOG_XML_ID'], '@') !== false) {
if (empty($arOrder)) {
$rsOrders = CSaleOrder::GetList(array(), array('ID' => $ID), false, false, array('ID', 'USER_ID'));
$arOrder = $rsOrders->Fetch();
if (empty($arOrder)) {
return;
}
}
list($amount, $curr) = explode('@', $arItems['CATALOG_XML_ID']);
CSaleUserAccount::UpdateAccount($arOrder['USER_ID'], doubleval($amount) * doubleval($arItems['QUANTITY']), $curr, GetMessage('ASD_MODULE_TRANSACT_PREPAID'), $ID);
}
}
}
}
示例8: array
?>
<div class="row">
<div class="col-lg-4 col-md-4 col-sm-12 col-xs-12 col-lg-push-8 col-md-push-8">
<div class="heading">
<h4>Мой кабинет</h4>
</div>
<?php
$APPLICATION->IncludeComponent("bitrix:menu", "vertical_left_menu", array("ROOT_MENU_TYPE" => "left", "MAX_LEVEL" => "1", "CHILD_MENU_TYPE" => "left", "USE_EXT" => "N", "DELAY" => "N", "ALLOW_MULTI_SELECT" => "N", "MENU_CACHE_TYPE" => "N", "MENU_CACHE_TIME" => "3600", "MENU_CACHE_USE_GROUPS" => "Y", "MENU_CACHE_GET_VARS" => array()));
?>
</div>
<div class="col-lg-8 col-md-8 col-sm-12 col-xs-12 col-lg-pull-4 col-md-pull-4"> <?php
if ($USER->IsAuthorized() && CModule::IncludeModule("sale")) {
$arOrders = array();
$arFilter = array("USER_ID" => $USER->GetID(), "STATUS_ID" => "F");
$rsSales = CSaleOrder::GetList(array("DATE_INSERT" => "ASC"), $arFilter);
while ($arSales = $rsSales->Fetch()) {
$arOrders[] = $arSales["ID"];
}
$dbBasketItems = CSaleBasket::GetList(array("NAME" => "ASC", "ID" => "ASC"), array("ORDER_ID" => $arOrders), false, false, array("PRODUCT_ID"));
while ($arItems = $dbBasketItems->Fetch()) {
$arBasketItems[] = $arItems["PRODUCT_ID"];
}
$arFilter = array("IBLOCK_ID" => 31, "ACTIVE" => "Y", "PROPERTY_Linked_Goods" => $arBasketItems);
}
?>
<?php
if (!empty($arBasketItems) && !empty($arOrders) && $USER->IsAuthorized() || $USER->isAdmin()) {
?>
<h3>Релизы </h3>
示例9: Delete
/**
* <p>Функция удаляет тип плательщика с кодом ID. Так же удаляются все связанные данные. Если есть заказы, привязанные к этому типу плательщика, то тип плательщика не может быть удален. </p>
*
*
*
*
* @param int $ID Код типа плательщика.
*
*
*
* @return bool <p>Возвращается <i>true</i> в случае успешного удаления и <i>false</i> - в
* противном случае.</p><br><br>
*
* @static
* @link http://dev.1c-bitrix.ru/api_help/sale/classes/csalepersontype/csalepersontype__delete.c2566ed3.php
* @author Bitrix
*/
public static function Delete($ID)
{
global $DB;
$ID = IntVal($ID);
$db_orders = CSaleOrder::GetList(
array("DATE_UPDATE" => "DESC"),
array("PERSON_TYPE_ID" => $ID),
false,
array("nTopCount" => 1),
array("ID")
);
if ($db_orders->Fetch())
{
$GLOBALS["APPLICATION"]->ThrowException(GetMessage("SKGP_ERROR_PERSON_HAS_ORDER").$ID, "ERROR_PERSON_HAS_ORDER");
return False;
}
$db_events = GetModuleEvents("sale", "OnBeforePersonTypeDelete");
while ($arEvent = $db_events->Fetch())
if (ExecuteModuleEventEx($arEvent, Array($ID))===false)
return false;
$events = GetModuleEvents("sale", "OnPersonTypeDelete");
while ($arEvent = $events->Fetch())
ExecuteModuleEventEx($arEvent, Array($ID));
$DB->Query("DELETE FROM b_sale_pay_system_action WHERE PERSON_TYPE_ID = ".$ID."", true);
$db_orderProps = CSaleOrderProps::GetList(
array("PROPS_GROUP_ID" => "ASC"),
array("PERSON_TYPE_ID" => $ID)
);
while ($arOrderProps = $db_orderProps->Fetch())
{
$DB->Query("DELETE FROM b_sale_order_props_variant WHERE ORDER_PROPS_ID = ".$arOrderProps["ID"]."", true);
$DB->Query("DELETE FROM b_sale_order_props_value WHERE ORDER_PROPS_ID = ".$arOrderProps["ID"]."", true);
$DB->Query("DELETE FROM b_sale_user_props_value WHERE ORDER_PROPS_ID = ".$arOrderProps["ID"]."", true);
}
$DB->Query("DELETE FROM b_sale_order_props WHERE PERSON_TYPE_ID = ".$ID."", true);
$db_orderUserProps = CSaleOrderUserProps::GetList(
array("NAME" => "ASC"),
array("PERSON_TYPE_ID" => $ID)
);
while ($arOrderUserProps = $db_orderUserProps->Fetch())
{
$DB->Query("DELETE FROM b_sale_user_props_value WHERE USER_PROPS_ID = ".$arOrderUserProps["ID"]."", true);
}
$DB->Query("DELETE FROM b_sale_user_props WHERE PERSON_TYPE_ID = ".$ID."", true);
$DB->Query("DELETE FROM b_sale_order_props_group WHERE PERSON_TYPE_ID = ".$ID."", true);
$DB->Query("DELETE FROM b_sale_person_type_site WHERE PERSON_TYPE_ID=".$ID, true);
unset($GLOBALS["SALE_PERSON_TYPE_LIST_CACHE"]);
return $DB->Query("DELETE FROM b_sale_person_type WHERE ID = ".$ID."", true);
}
示例10: __SaleOrderCount
function __SaleOrderCount($arFilter, $strCurrency = '')
{
$mxResult = false;
if (is_array($arFilter) && !empty($arFilter)) {
$dblPrice = 0;
$strCurrency = strval($strCurrency);
$mxLastOrderDate = '';
$intMaxTimestamp = 0;
$intTimeStamp = 0;
$rsSaleOrders = CSaleOrder::GetList(array(), $arFilter, false, false, array('ID', 'PRICE', 'CURRENCY', 'DATE_INSERT'));
while ($arSaleOrder = $rsSaleOrders->Fetch()) {
$intTimeStamp = MakeTimeStamp($arSaleOrder['DATE_INSERT']);
if ($intMaxTimestamp < $intTimeStamp) {
$intMaxTimestamp = $intTimeStamp;
$mxLastOrderDate = $arSaleOrder['DATE_INSERT'];
}
if (empty($strCurrency)) {
$dblPrice += $arSaleOrder['PRICE'];
$strCurrency = $arSaleOrder['CURRENCY'];
} else {
if ($strCurrency != $arSaleOrder['CURRENCY']) {
$dblPrice += $arSaleOrder['PRICE'];
} else {
$dblPrice += $arSaleOrder['PRICE'];
}
}
}
$mxResult = array('PRICE' => $dblPrice, 'CURRENCY' => $strCurrency, 'LAST_ORDER_DATE' => $mxLastOrderDate, 'TIMESTAMP' => $intMaxTimestamp);
}
return $mxResult;
}
示例11: GetMessage
$arResult["ITEMS"]["AnDelCanBuy"] = $arOrderForDiscount['BASKET_ITEMS'];
}
//end if array basket
if (empty($arBasketItems)) {
$arResult["ERROR_MESSAGE"] = GetMessage("SALE_EMPTY_BASKET");
}
if (!isset($_POST["BasketOrder"])) {
$errorMessage = "";
}
$errorMessage .= $productLimit;
$arResult["ERROR_MESSAGE"] = $errorMessage;
} else {
$arResult["ORDER_BASKET"]["CONFIRM_ORDER"] = "Y";
$arResult["ORDER_BASKET"]["ORDER_ID"] = intval($ORDER_ID);
$arResult["ORDER_ID"] = intval($ORDER_ID);
$dbOrder = CSaleOrder::GetList(array("DATE_UPDATE" => "DESC"), array("LID" => SITE_ID, "USER_ID" => $currentUserId, "ID" => $arResult["ORDER_BASKET"]["ORDER_ID"]));
if ($arOrder = $dbOrder->GetNext()) {
if (intval($arOrder["PAY_SYSTEM_ID"]) > 0) {
$dbPaySysAction = CSalePaySystemAction::GetList(array(), array("PAY_SYSTEM_ID" => $arOrder["PAY_SYSTEM_ID"], "PERSON_TYPE_ID" => $arOrder["PERSON_TYPE_ID"]), false, false, array("NAME", "ACTION_FILE", "NEW_WINDOW", "PARAMS", "ENCODING"));
if ($arPaySysAction = $dbPaySysAction->Fetch()) {
$arPaySysAction["NAME"] = htmlspecialcharsEx($arPaySysAction["NAME"]);
if (strlen($arPaySysAction["ACTION_FILE"]) > 0) {
if ($arPaySysAction["NEW_WINDOW"] != "Y") {
CSalePaySystemAction::InitParamArrays($arOrder, $arOrder["ID"], $arPaySysAction["PARAMS"]);
$pathToAction = $_SERVER["DOCUMENT_ROOT"] . $arPaySysAction["ACTION_FILE"];
$pathToAction = str_replace("\\", "/", $pathToAction);
while (substr($pathToAction, strlen($pathToAction) - 1, 1) == "/") {
$pathToAction = substr($pathToAction, 0, strlen($pathToAction) - 1);
}
if (file_exists($pathToAction)) {
if (is_dir($pathToAction) && file_exists($pathToAction . "/payment.php")) {
示例12: fGetBuyerType
function fGetBuyerType($PERSON_TYPE_ID, $LID, $USER_ID = '', $ORDER_ID = 0, $formVarsSubmit = false)
{
global $locationZipID, $locationID, $DELIVERY_LOCATION, $DELIVERY_LOCATION_ZIP;
$resultHtml = "<script>locationZipID = 0;locationID = 0;</script><table width=\"100%\" id=\"order_type_props\" class=\"edit-table\">";
//select person type
$arPersonTypeList = array();
$personTypeSelect = "<select name='buyer_type_id' id='buyer_type_id' OnChange='fBuyerChangeType(this);' >";
$dbPersonType = CSalePersonType::GetList(array("SORT" => "ASC", "NAME" => "ASC"), array("ACTIVE" => "Y"));
while ($arPersonType = $dbPersonType->GetNext())
{
if (!in_array($LID, $arPersonType["LIDS"]))
continue;
if (!isset($PERSON_TYPE_ID) OR $PERSON_TYPE_ID == "")
$PERSON_TYPE_ID = $arPersonType["ID"];
$class = "";
if (intval($arPersonType["ID"]) == intval($PERSON_TYPE_ID))
$class = " selected";
$personTypeSelect .= "<option value=\"".$arPersonType["ID"]."\" ".$class.">".$arPersonType["NAME"]." [".$arPersonType["ID"]."]</option>";
}
$personTypeSelect .= "</select>";
$userComment = "";
$userDisplay = "none";
if (intval($ORDER_ID) > 0)
{
$dbOrder = CSaleOrder::GetList(
array(),
array("ID" => $ORDER_ID, "ACTIVE" => "Y"),
false,
false,
array()
);
$arOrder = $dbOrder->Fetch();
$userComment = $arOrder["USER_DESCRIPTION"];
$userDisplay = "table-row";
}
if ($formVarsSubmit && $_REQUEST["btnTypeBuyer"] == "btnBuyerNew")
$userDisplay = "none";
elseif ($formVarsSubmit && $_REQUEST["btnTypeBuyer"] == "btnBuyerExist")
$userDisplay = "table-row";
$resultHtml .= "<tr id=\"btnBuyerExistField\" style=\"display:".$userDisplay."\">
<td class=\"adm-detail-content-cell-l\" width=\"40%\">".GetMessage("NEWO_BUYER").":</td>
<td class=\"adm-detail-content-cell-r\" width=\"60%\"><div id=\"user_name\">".fGetUserName($USER_ID)."</div></td></tr>";
$resultHtml .= "<tr class=\"adm-detail-required-field\">
<td class=\"adm-detail-content-cell-l\" width=\"40%\">".GetMessage("SOE_PERSON_TYPE").":</td>
<td class=\"adm-detail-content-cell-r\" width=\"60%\">".$personTypeSelect."</td>
</tr>";
$bShowTrProfile = "none";
if ($formVarsSubmit && $_POST["btnTypeBuyer"] == "btnBuyerExist")
$bShowTrProfile = "table-row";
$resultHtml .= "<tr id=\"buyer_profile_display\" style=\"display:".$bShowTrProfile."\" class=\"adm-detail-required-field\">
<td class=\"adm-detail-content-cell-l\">".GetMessage("NEWO_BUYER_PROFILE").":</td>
<td class=\"adm-detail-content-cell-r\">
<div id=\"buyer_profile_select\">";
if ($formVarsSubmit && $_POST["btnTypeBuyer"] == "btnBuyerExist")
{
$resultHtml .= fUserProfile(intval($_POST["user_id"]), intval($_POST["buyer_type_id"]), $default = '');
}
$resultHtml .= "</div></td>
</tr>";
if ($ORDER_ID <= 0)
{
$arCountProps = fGetCountProfileProps($PERSON_TYPE_ID);
$resultHtml .= "<tr id=\"btnBuyerNewField\">";
if (count($arCountProps) < 3)
{
$resultHtml .= "<td colspan=2>
<table width=\"100%\" class=\"edit-table\" >";
if (intval($arCountProps["IS_EMAIL"]) <= 0)
$resultHtml .= "<tr class=\"adm-detail-required-field\">
<td class=\"adm-detail-content-cell-l\" width=\"40%\">".GetMessage("NEWO_BUYER_REG_MAIL")."</td>
<td class=\"adm-detail-content-cell-r\"><input type=\"text\" name=\"NEW_BUYER_EMAIL\" size=\"30\" value=\"".htmlspecialcharsbx(trim($_REQUEST["NEW_BUYER_EMAIL"]))."\" tabindex=\"1\" /></td>
</tr>";
if (intval($arCountProps["IS_PAYER"]) <= 0)
$resultHtml .= "<tr class=\"adm-detail-required-field\">
<td class=\"adm-detail-content-cell-l\">".GetMessage("NEWO_BUYER_REG_LASTNAME")."</td>
<td class=\"adm-detail-content-cell-r\"><input type=\"text\" name=\"NEW_BUYER_LAST_NAME\" size=\"30\" value=\"".htmlspecialcharsbx(trim($_REQUEST["NEW_BUYER_LAST_NAME"]))."\" tabindex=\"3\" /></td>
</tr>
<tr class=\"adm-detail-required-field\">
<td class=\"adm-detail-content-cell-l\">".GetMessage("NEWO_BUYER_REG_NAME")."</td>
<td class=\"adm-detail-content-cell-r\"><input type=\"text\" name=\"NEW_BUYER_NAME\" size=\"30\" value=\"".htmlspecialcharsbx(trim($_REQUEST["NEW_BUYER_NAME"]))."\" tabindex=\"2\" /></td>
</tr>";
$resultHtml .= "</table>
</td>";
}
$resultHtml .= "</tr>";
}
//.........这里部分代码省略.........
示例13:
$strLockUserInfo = '';
$strLockUserInfoExt = '';
$strLockTime = '';
$strNameFormat = CSite::GetNameFormat(true);
$dbOrder = CSaleOrder::GetList(
array("ID" => "DESC"),
array("ID" => $ID),
false,
false,
array(
"ID", "LID", "PERSON_TYPE_ID",
"PAYED", "DATE_PAYED", "EMP_PAYED_ID", "PAY_VOUCHER_NUM", "PAY_VOUCHER_DATE",
"CANCELED", "DATE_CANCELED", "EMP_CANCELED_ID", "REASON_CANCELED",
"STATUS_ID", "DATE_STATUS", "EMP_STATUS_ID", "PRICE_DELIVERY",
"ALLOW_DELIVERY", "DATE_ALLOW_DELIVERY", "EMP_ALLOW_DELIVERY_ID",
"DEDUCTED", "DATE_DEDUCTED", "EMP_DEDUCTED_ID", "REASON_UNDO_DEDUCTED",
"MARKED", "DATE_MARKED", "EMP_MARKED_ID", "REASON_MARKED",
"PRICE", "CURRENCY", "DISCOUNT_VALUE", "SUM_PAID", "USER_ID", "PAY_SYSTEM_ID",
"DELIVERY_ID", "DATE_INSERT", "DATE_INSERT_FORMAT", "DATE_UPDATE", "USER_DESCRIPTION",
"ADDITIONAL_INFO", "PS_STATUS", "PS_STATUS_CODE", "PS_STATUS_DESCRIPTION",
"PS_STATUS_MESSAGE", "PS_SUM", "PS_CURRENCY", "PS_RESPONSE_DATE", "COMMENTS",
"TAX_VALUE", "STAT_GID", "RECURRING_ID", "AFFILIATE_ID", "LOCK_STATUS",
"USER_LOGIN", "USER_NAME", "USER_LAST_NAME", "USER_EMAIL", "DELIVERY_DOC_NUM",
"DELIVERY_DOC_DATE", "STORE_ID", "ACCOUNT_NUMBER", "TRACKING_NUMBER",
)
);
if (!($arOrder = $dbOrder->Fetch()))
LocalRedirect("sale_order.php?lang=".LANGUAGE_ID.GetFilterParams("filter_", false));
$boolLocked = CSaleOrder::IsLocked($ID, $intLockUserID, $strLockTime);
if ($boolLocked)
示例14: ExportOrders2Xml
public static function ExportOrders2Xml($arFilter = Array(), $nTopCount = 0, $currency = "", $crmMode = false)
{
global $DB;
$count = false;
if(IntVal($nTopCount)>0)
$count = Array("nTopCount" => $nTopCount);
$arResultStat = array(
"ORDERS" => 0,
"CONTACTS" => 0,
"COMPANIES" => 0,
);
$accountNumberPrefix = COption::GetOptionString("sale", "1C_SALE_ACCOUNT_NUMBER_SHOP_PREFIX", "");
$arOrder = array("ID" => "DESC");
if ($crmMode)
$arOrder = array("DATE_UPDATE" => "ASC");
$dbOrderList = CSaleOrder::GetList(
$arOrder,
$arFilter,
false,
$count,
array(
"ID", "LID", "PERSON_TYPE_ID", "PAYED", "DATE_PAYED", "EMP_PAYED_ID", "CANCELED", "DATE_CANCELED",
"EMP_CANCELED_ID", "REASON_CANCELED", "STATUS_ID", "DATE_STATUS", "PAY_VOUCHER_NUM", "PAY_VOUCHER_DATE", "EMP_STATUS_ID",
"PRICE_DELIVERY", "ALLOW_DELIVERY", "DATE_ALLOW_DELIVERY", "EMP_ALLOW_DELIVERY_ID", "PRICE", "CURRENCY", "DISCOUNT_VALUE",
"SUM_PAID", "USER_ID", "PAY_SYSTEM_ID", "DELIVERY_ID", "DATE_INSERT", "DATE_INSERT_FORMAT", "DATE_UPDATE", "USER_DESCRIPTION",
"ADDITIONAL_INFO", "PS_STATUS", "PS_STATUS_CODE", "PS_STATUS_DESCRIPTION", "PS_STATUS_MESSAGE", "PS_SUM", "PS_CURRENCY", "PS_RESPONSE_DATE",
"COMMENTS", "TAX_VALUE", "STAT_GID", "RECURRING_ID", "ACCOUNT_NUMBER"
)
);
$dbPaySystem = CSalePaySystem::GetList(Array("ID" => "ASC"), Array("ACTIVE" => "Y"), false, false, Array("ID", "NAME", "ACTIVE"));
while($arPaySystem = $dbPaySystem -> Fetch())
$paySystems[$arPaySystem["ID"]] = $arPaySystem["NAME"];
$dbDelivery = CSaleDelivery::GetList(Array("ID" => "ASC"), Array("ACTIVE" => "Y"), false, false, Array("ID", "NAME", "ACTIVE"));
while($arDelivery = $dbDelivery -> Fetch())
$delivery[$arDelivery["ID"]] = $arDelivery["NAME"];
$rsDeliveryHandlers = CSaleDeliveryHandler::GetAdminList(array("SID" => "ASC"));
while ($arHandler = $rsDeliveryHandlers->Fetch())
{
if(is_array($arHandler["PROFILES"]))
{
foreach($arHandler["PROFILES"] as $k => $v)
{
$delivery[$arHandler["SID"].":".$k] = $v["TITLE"]." (".$arHandler["NAME"].")";
}
}
}
$dbExport = CSaleExport::GetList();
while($arExport = $dbExport->Fetch())
{
$arAgent[$arExport["PERSON_TYPE_ID"]] = unserialize($arExport["VARS"]);
}
$dateFormat = CSite::GetDateFormat("FULL");
if ($crmMode)
{
echo "<"."?xml version=\"1.0\" encoding=\"UTF-8\"?".">\n";
$arCharSets = array();
$dbSitesList = CSite::GetList(($b=""), ($o=""));
while ($arSite = $dbSitesList->Fetch())
$arCharSets[$arSite["ID"]] = $arSite["CHARSET"];
}
else
echo "<"."?xml version=\"1.0\" encoding=\"windows-1251\"?".">\n";
?>
<<?php
echo GetMessage("SALE_EXPORT_COM_INFORMATION");
?>
<?php
echo GetMessage("SALE_EXPORT_SHEM_VERSION");
?>
="2.05" <?php
echo GetMessage("SALE_EXPORT_SHEM_DATE_CREATE");
?>
="<?php
echo date("Y-m-d");
?>
T<?php
echo date("G:i:s");
?>
" <?php
echo GetMessage("SALE_EXPORT_DATE_FORMAT");
?>
="<?php
echo GetMessage("SALE_EXPORT_DATE_FORMAT_DF");
?>
=yyyy-MM-dd; <?php
echo GetMessage("SALE_EXPORT_DATE_FORMAT_DLF");
?>
=DT" <?php
echo GetMessage("SALE_EXPORT_DATE_FORMAT_DATETIME");
//.........这里部分代码省略.........
示例15: AgentCountDayOrders
public static function AgentCountDayOrders()
{
global $DB;
if (Bitrix\Main\Loader::includeModule("sale")) {
//count orders
$arFilter = array("STATUS_ID" => array("F", "P"), "PAYED" => "Y");
$dateFromTs = MakeTimeStamp(date("d", time() - 3600 * 24 * 2) . "." . date("m", time() - 3600 * 24 * 2) . "." . date("Y", time() - 3600 * 24 * 2) . " 23:59:59", "DD.MM.YYYY HH:MI:SS");
$dateToTs = MakeTimeStamp(date("d") . "." . date("m") . "." . date("Y") . " 00:00:00", "DD.MM.YYYY HH:MI:SS");
$arFilter[">DATE_STATUS"] = date($DB->DateFormatToPHP(CSite::GetDateFormat("FULL", SITE_ID)), $dateFromTs);
$arFilter["<DATE_STATUS"] = date($DB->DateFormatToPHP(CSite::GetDateFormat("FULL", SITE_ID)), $dateToTs);
$dbOrders = CSaleOrder::GetList(array(), $arFilter);
$numOrders = $dbOrders->SelectedRowsCount();
$newNumOrders = array("newDay" => $numOrders);
$curNumOrders = Bitrix\Main\Config\Option::get("storeassist", "num_orders", "");
if ($curNumOrders) {
$curNumOrders = unserialize($curNumOrders);
}
$newNumOrders["prevDay"] = isset($curNumOrders["newDay"]) ? $curNumOrders["newDay"] : 0;
Bitrix\Main\Config\Option::set("storeassist", "num_orders", serialize($newNumOrders), "");
//count progress
$progress = Bitrix\Main\Config\Option::get("storeassist", "progress_percent", 0);
$newProgress = 0;
if ($newNumOrders["newDay"] >= $newNumOrders["prevDay"] && $newNumOrders["newDay"] > 0) {
$newProgress = ++$progress > 10 ? 10 : $progress;
} else {
$newProgress = --$progress > 0 ? $progress : 0;
}
Bitrix\Main\Config\Option::set("storeassist", "progress_percent", $newProgress, "");
}
return "CStoreAssist::AgentCountDayOrders();";
}