当前位置: 首页>>代码示例>>PHP>>正文


PHP CIBlockElement::GetList方法代码示例

本文整理汇总了PHP中CIBlockElement::GetList方法的典型用法代码示例。如果您正苦于以下问题:PHP CIBlockElement::GetList方法的具体用法?PHP CIBlockElement::GetList怎么用?PHP CIBlockElement::GetList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CIBlockElement的用法示例。


在下文中一共展示了CIBlockElement::GetList方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __construct

 /**
  * Get dev_key from db
  */
 public function __construct()
 {
     \CModule::IncludeModule("iblock");
     $arrFilter = array("IBLOCK_ID" => SOCIAL_CONFIG_IB, "PROPERTY_PROVIDER" => "Youtube", "PROPERTY_SOCIAL_ID" => $userProfile["identifier"]);
     $arSelect = array("PROPERTY_SECRET");
     $rsRes = \CIBlockElement::GetList($arOrder, $arrFilter, false, false, $arSelect);
     if ($arItem = $rsRes->GetNext()) {
         self::$dev_key = $arItem["PROPERTY_SECRET_VALUE"];
     }
 }
开发者ID:Hawkart,项目名称:megatv,代码行数:13,代码来源:YoutubeClient.php

示例2: rawFindBy

 /**
  * Получает результат запроса для поиска списка элементов
  *
  * @param array $filter
  * @param array $orderBy
  * @param array $selectedFields
  * @param mixed $navStartParams
  *
  * @return \CIBlockResult
  */
 public function rawFindBy(array $filter = array(), array $orderBy = array('sort' => 'asc'), array $selectedFields = array('*', 'PROPERTY_*'), $navStartParams = null)
 {
     if (!isset($filter['IBLOCK_ID']) && $this->iBlockId) {
         $filter['IBLOCK_ID'] = $this->iBlockId;
     }
     return $this->iBEGateway->GetList($orderBy, $filter, false, is_null($navStartParams) ? false : $navStartParams, $selectedFields);
 }
开发者ID:rocko61rus,项目名称:QuetzalTools,代码行数:17,代码来源:IBlockElementRepository.php

示例3: executeComponent

 function executeComponent()
 {
     $arFilter = array('IBLOCK_ID' => $this->arParams['IBLOCK_ID'], 'ACTIVE' => 'Y');
     if (true || $this->StartResultCache()) {
         $CIBlockElement = new CIBlockElement();
         $CFile = new \CFile();
         $aElts = array();
         $eltsSelectFields = array_merge(array('ID', 'NAME', 'CODE', 'PREVIEW_PICTURE', 'DETAIL_PICTURE', 'DETAIL_PAGE_URL'), $this->getIBlockProperties($this->arParams['IBLOCK_ID']));
         $rsElts = $CIBlockElement->GetList(array('SORT' => 'asc', 'date_active_from' => 'DESC'), $arFilter, false, false, array('ID', 'NAME'));
         if (intval($rsElts->SelectedRowsCount())) {
             while ($arElt = $rsElts->Fetch()) {
                 $aElts[] = array('ID' => $arElt['ID'], 'NAME' => $arElt['NAME']);
             }
             $arElt = $CIBlockElement->GetList(array('SORT' => 'asc', 'ID' => 'DESC'), array_merge($arFilter, array('ID' => $aElts[0]['ID'])), false, false, $eltsSelectFields)->GetNext();
             if ($arElt['DETAIL_PICTURE']) {
                 $arElt['DETAIL_PICTURE'] = $CFile->GetPath($arElt['DETAIL_PICTURE']);
             } elseif ($arElt['PREVIEW_PICTURE']) {
                 $arElt['DETAIL_PICTURE'] = $CFile->GetPath($arElt['PREVIEW_PICTURE']);
             }
             $arPrice = CPrice::GetList(array(), array("PRODUCT_ID" => $arElt['ID']))->Fetch();
             $arElt['PRICE'] = $arPrice['PRICE'];
             $this->arResult['ITEMS'] = $aElts;
             $this->arResult['ITEM'] = $arElt;
             $this->IncludeComponentTemplate();
         }
     }
 }
开发者ID:AlexPrya,项目名称:redvent.ru,代码行数:27,代码来源:class.php

示例4: addVariants

 public function addVariants(&$field, $params)
 {
     if (!$params["LINK_IBLOCK_ID"]) {
         return;
     }
     $cacheDir = KFilter::$config['CACHE_DIR'] . self::$cacheSubdir;
     $obCache = new CPHPCache();
     if ($obCache->InitCache(KFilter::$config['CACHE_TIME'], md5($params["LINK_IBLOCK_ID"] . __METHOD__), $cacheDir)) {
         $field['VARIANTS'] = $obCache->GetVars();
     } elseif ($obCache->StartDataCache()) {
         CModule::IncludeModule('iblock');
         global $CACHE_MANAGER;
         $CACHE_MANAGER->StartTagCache($cacheDir);
         $CACHE_MANAGER->RegisterTag("iblock_id_" . $params["LINK_IBLOCK_ID"]);
         $CACHE_MANAGER->EndTagCache();
         $rsSect = CIBlockSection::GetList(array('sort' => 'asc', 'name' => 'asc'), array('IBLOCK_ID' => $params["LINK_IBLOCK_ID"], 'ACTIVE' => 'Y'), false, array('ID', 'NAME'));
         while ($arSect = $rsSect->GetNext()) {
             $field['VARIANTS'][] = array('ID' => $arSect['ID'], 'NAME' => $arSect['NAME']);
         }
         $obCache->EndDataCache($field['VARIANTS']);
     }
     foreach ($field['VARIANTS'] as &$section) {
         if ($_REQUEST[$field['NAME']] == $section['ID']) {
             $section['SELECTED'] = 'Y';
             $res = CIBlockElement::GetList(array(), array("IBLOCK_ID" => $params["LINK_IBLOCK_ID"], "SECTION_ID" => $section['ID']), false, false, array("ID", "IBLOCK_ID"));
             $arr = array();
             while ($el = $res->GetNext()) {
                 $arr[] = $el['ID'];
             }
             $this->filter['PROPERTY_' . $field['PROPERTY']] = $arr;
             break;
         }
     }
 }
开发者ID:ASDAFF,项目名称:bitrix-modules-advancedfilter,代码行数:34,代码来源:kfsectlinkelement.php

示例5: trackStartedTask

function trackStartedTask($stopStartedTask = true)
{
    CModule::IncludeModule('iblock');
    $res = CIBlockElement::GetList(array(), array("IBLOCK_ID" => TASKS_IBLOCK_ID, 'ACTIVE' => 'Y', "PROPERTY_PROGRAMMER" => CUser::GetID(), "PROPERTY_STATUS" => STATUS_LIST_WORK), false, false, array('ID', 'NAME', 'PROPERTY_PROJECT', 'PROPERTY_STATUS_DATE'));
    if ($taskArr = $res->Fetch()) {
        if ($stopStartedTask) {
            CIBlockElement::SetPropertyValuesEx($taskArr['ID'], TASKS_IBLOCK_ID, array('STATUS' => STATUS_LIST_PAUSE));
        }
        $link = TASKS_LIST_URL . $taskArr["PROPERTY_PROJECT_VALUE"] . '/' . $taskArr['ID'] . '/';
        $date = new DateTime($taskArr["PROPERTY_STATUS_DATE_VALUE"]);
        $curdate = new DateTime();
        $diff = $date->diff($curdate);
        $h = $diff->format('%h');
        $i = $diff->format('%i');
        if ($h || $i) {
            $timingText = '';
            if ($h) {
                $timingText = "{$h} ч, ";
            }
            if ($i) {
                $timingText = $timingText . "{$i} мин. ";
            }
            $decTime = $h + $i / 60;
            $decTime = round($decTime, 2);
            $el = new CIBlockElement();
            if ($el->Add(array("DATE_ACTIVE_FROM" => ConvertTimeStamp(time(), "SHORT"), "MODIFIED_BY" => CUser::GetID(), "IBLOCK_SECTION_ID" => false, "IBLOCK_ID" => TRACKING_IBLOCK_ID, "NAME" => 'Без названия' . ' (' . $decTime . 'ч.)', "ACTIVE" => "Y", "PROPERTY_VALUES" => array("HOURS" => $decTime, "TASK" => $taskArr['ID'])))) {
                crmEntitiesHelper::recalcTaskTracking($taskArr['ID']);
                ToolTip::Add("+ {$timingText} в трекер задачи \"<a target=\"_blank\" href=\"{$link}\">{$taskArr['ID']} {$taskArr['NAME']}</a>\"");
            } else {
                ToolTip::AddError($el->LAST_ERROR);
            }
        }
    }
}
开发者ID:kudin,项目名称:crm,代码行数:34,代码来源:functions.php

示例6: getResult

    /**
     * получение результатов
     */
    protected function getResult()
    {
        global $APPLICATION;
        $uri = $APPLICATION->GetCurUri();
        $page = $APPLICATION->GetCurPage();

        $filter = Array(
            'IBLOCK_TYPE'=> $this -> arParams['IBLOCK_TYPE'],
            'IBLOCK_ID' => $this -> arParams['IBLOCK_ID'],
            'PREVIEW_TEXT' => $_SERVER['REQUEST_URI'],
            //'PREVIEW_TEXT' => 'привет',
        );

        $select = array(
            'NAME',
            'ID',
            'PREVIEW_TEXT'
        );

        $db_list = CIBlockElement::GetList(Array(), $filter, false, false, $select);

        if($ar_result = $db_list -> Fetch())
        {
            $APPLICATION->SetTitle($ar_result['NAME']);
            return $ar_result['NAME'];
        }else{
            return false;
        }

    }
开发者ID:akniyev,项目名称:arteva.ru,代码行数:33,代码来源:class.php

示例7: _getIBlockItemsCount

 function _getIBlockItemsCount($ib, $section = null, $object = false, $object_id = false)
 {
     $arFilter = array("IBLOCK_ID" => intval($ib), "INCLUDE_SUBSECTIONS" => "Y", "CHECK_PERMISSIONS" => "N", "ACTIVE" => "Y");
     if ($section !== null) {
         $arFilter["SECTION_ID"] = intval($section);
     }
     if ($object !== false) {
         if ($object == "user") {
             $arFilter["CREATED_BY"] = $object_id;
         } else {
             $arFilter["SOCNET_GROUP_ID"] = $object_id;
         }
         $arFilter["SECTION_ID"] = 0;
         $dbRes = CIBLockSection::GetList(array(), $arFilter, false);
         // find GROUP/USER SECTION_ID
         if ($dbRes && ($arRes = $dbRes->Fetch())) {
             $arFilter["SECTION_ID"] = $arRes["ID"];
         } else {
             return 0;
         }
     }
     $itemsCount = CIBlockElement::GetList(array(), $arFilter, array(), false);
     // decrement by trash size
     $arParams = array();
     if ($object !== false) {
         $arParams["ROOT_SECTION_ID"] = $arFilter["SECTION_ID"];
         $arParams["ATTRIBUTES"] = $object == "user" ? array('user_id' => $object_id) : array('group_id' => $object_id);
     }
     $ob = new CWebDavIblock($arFilter['IBLOCK_ID'], '', $arParams);
     $arFilter["SECTION_ID"] = array($ob->GetMetaID("TRASH", false), $ob->GetMetaID("DROPPED", false));
     unset($ob);
     $trashAndDroppedItemsCount = CIBlockElement::GetList(array(), $arFilter, array(), false);
     $itemsCount -= $trashAndDroppedItemsCount;
     return $itemsCount;
 }
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:35,代码来源:functions.php

示例8: Delivery

function Delivery(&$arFields){
	CModule::IncludeModule("iblock");
		$arSelect = Array("ID","PROPERTY_iblock","PROPERTY_send","NAME");
		$arFilter = Array("IBLOCK_ID"=>38, "ACTIVE"=>"Y");
		$res = CIBlockElement::GetList(Array(), $arFilter, false, Array("nPageSize"=>50), $arSelect);
		while($ob = $res->GetNextElement())
		{
			$arFields1 = $ob->GetFields();
			$delivery[$arFields1["PROPERTY_IBLOCK_VALUE"]]=$arFields1;
			$id_ac[]=$arFields1["PROPERTY_IBLOCK_VALUE"];
		}
		if (in_array($arFields['IBLOCK_ID'],$id_ac))
		{
			$arSelect = Array("ID","PROPERTY_email","NAME");
			$arFilter = Array("IBLOCK_ID"=>34, "ACTIVE"=>"Y","PROPERTY_delivery"=>$arFields['IBLOCK_ID']);
			$res = CIBlockElement::GetList(Array(), $arFilter, false, Array("nPageSize"=>50000), $arSelect);
			while($ob = $res->GetNextElement())
			{
				$arFields1 = $ob->GetFields();
				$receivers[]=$arFields1;
			}
			
			foreach ($receivers as $receiver){
				$arEventFields = array(
					"ID"                  => $arFields["ID"],
					"EMAIL_TO"            => $receiver["PROPERTY_EMAIL_VALUE"],
					"TITLE"				  => $arFields["NAME"],
					);

				$ev_id[]=CEvent::Send('DELIVERY', 's1', $arEventFields,"N",$delivery[$arFields['IBLOCK_ID']]["PROPERTY_SEND_VALUE"]);

			}

		}
}
开发者ID:raffiz,项目名称:my_home_tests,代码行数:35,代码来源:init.php

示例9: getProductInfo

 /** Returns an array, containing information about the product block on its ID.
  * @param $elementId
  * @return array|string
  */
 public static function getProductInfo($elementId)
 {
     $elementId = intval($elementId);
     $result = "";
     if ($elementId <= 0) {
         return $result;
     }
     $dbProduct = CIBlockElement::GetList(array(), array("ID" => $elementId), false, false, array('ID', 'IBLOCK_ID', 'IBLOCK_SECTION_ID', 'DETAIL_PICTURE', 'PREVIEW_PICTURE', 'NAME', 'XML_ID'));
     while ($arProduct = $dbProduct->GetNext()) {
         $imgCode = "";
         if ($arProduct["IBLOCK_ID"] > 0) {
             $arProduct["EDIT_PAGE_URL"] = CIBlock::GetAdminElementEditLink($arProduct["IBLOCK_ID"], $elementId, array("find_section_section" => $arProduct["IBLOCK_SECTION_ID"]));
         }
         if ($arProduct["DETAIL_PICTURE"] > 0) {
             $imgCode = $arProduct["DETAIL_PICTURE"];
         } elseif ($arProduct["PREVIEW_PICTURE"] > 0) {
             $imgCode = $arProduct["PREVIEW_PICTURE"];
         }
         $arProduct["NAME"] = $arProduct["NAME"];
         $arProduct["DETAIL_PAGE_URL"] = htmlspecialcharsex($arProduct["DETAIL_PAGE_URL"]);
         if ($imgCode > 0) {
             $arFile = CFile::GetFileArray($imgCode);
             $arImgProduct = CFile::ResizeImageGet($arFile, array('width' => 80, 'height' => 80), BX_RESIZE_IMAGE_PROPORTIONAL, false, false);
             $arProduct["IMG_URL"] = $arImgProduct['src'];
         }
         return $arProduct;
     }
     return $result;
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:33,代码来源:store_utility.php

示例10: getInfo

 /**
  * Возвращаем данные столика
  * @param $arData
  * @return CDBResult|CIBlockResult|string
  */
 function getInfo($tableID, $arData = false, $GetNext = false)
 {
     $arFilterTable = array("IBLOCK_ID" => IB_TABLE_ID, "PROPERTY_CLUB" => $this->clubID, "ID" => intval($tableID));
     $arSelectTable = array("ID");
     $arOrderTable = array();
     $arOrder = is_array($arData["arSelect"]) ? array_merge($arData["arOrder"], $arOrderTable) : $arOrderTable;
     $arGroupBy = is_array($arData["arGroupBy"]) ? array_merge($arData["arGroupBy"], array()) : false;
     $arNavStartParams = is_array($arData["arGroupBy"]) ? array_merge($arData["arNavStartParams"], array()) : false;
     $arSelect = is_array($arData["arSelect"]) ? array_merge($arData["arSelect"], $arSelectTable) : $arSelectTable;
     $arFilter = is_array($arData["arFilter"]) ? array_merge($arData["arFilter"], $arFilterTable) : $arFilterTable;
     $res = CIBlockElement::GetList($arOrder, $arFilter, $arGroupBy, $arNavStartParams, $arSelect);
     if (!$res) {
         return Errors::run("404");
     }
     $ob = $GetNext ? $res->GetNext() : $res->Fetch();
     if (isset($ob["PREVIEW_PICTURE"])) {
         $arFile = CFile::GetFileArray($ob["PREVIEW_PICTURE"]);
         $ob["PREVIEW_PICTURE"] = $arFile["SRC"];
     }
     if (isset($ob["PROPERTY_PRICE_GROUP_VALUE"])) {
         $res = CIBlockElement::GetList(array(), array("ID" => intval($ob["PROPERTY_PRICE_GROUP_VALUE"]), "IBLOCK_ID" => IB_PRICE_GROUP), false, false, array("NAME", "ID", "PROPERTY_PRICE"));
         $ob["PROPERTY_PRICE_GROUP"] = $res->Fetch();
     }
     return $ob;
 }
开发者ID:nProfessor,项目名称:Mytb,代码行数:30,代码来源:Table.php

示例11: createSmartFilterSeoXML

function createSmartFilterSeoXML()
{
    if (CModule::IncludeModule("iblock")) {
        $resElDB = CIBlockElement::GetList(array("SORT" => "ASC"), array('IBLOCK_ID' => SEO_IBLOCK), false, false, array('PROPERTY_TARGET_ON', 'PROPERTY_INDEX', 'PROPERTY_FOLLOW', 'IBLOCK_ID', 'ID', 'NAME'));
        $protocol = CMain::IsHTTPS() ? "https" : "http";
        $host = $_SERVER['HTTP_HOST'];
        if ($_SERVER['SERVER_PORT'] != 80 && $_SERVER['SERVER_PORT'] != 443 && $_SERVER['SERVER_PORT'] > 0 && strpos($_SERVER['HTTP_HOST'], ":") === false) {
            $host .= ":" . $_SERVER['SERVER_PORT'];
        }
        $curDate = date("Y-m-d\\TH:i:s P");
        $strBeginSmartFilter = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\">\n";
        $index = 0;
        while ($res = $resElDB->fetch()) {
            $exp = explode('*', $res['PROPERTY_TARGET_ON_VALUE']['TEXT']);
            $urlFilter = trim($exp[0]);
            //clean url of smart filter
            if ($index == 0) {
                $strBeginSmartFilter .= "\t<url>\n\t\t";
                $index++;
            } else {
                $strBeginSmartFilter .= "<url>\n\t\t";
            }
            $strBeginSmartFilter .= "<loc>" . $protocol . "://" . $host . $urlFilter . "</loc>\n\t\t";
            $strBeginSmartFilter .= "<lastmod>" . $curDate . "</lastmod>\n\t";
            $strBeginSmartFilter .= "</url>";
        }
        $strBeginSmartFilter .= "</urlset\n>";
        $smartXmlFileName = 'sitemap_iblock_' . SEO_IBLOCK . '.xml';
        $el = fopen($_SERVER['DOCUMENT_ROOT'] . '/' . $smartXmlFileName, "w");
        fwrite($el, $strBeginSmartFilter);
        fclose($el);
        return "createSmartFilterSeoXML();";
    }
}
开发者ID:VitaliiSestrenskyi,项目名称:sest,代码行数:34,代码来源:createSmartFilterSeoXML.php

示例12: OnProductCatalogHandler

function OnProductCatalogHandler($ID, $arFields)
{
    Bitrix\Main\Loader::includeModule('iblock');
    Bitrix\Main\Loader::includeModule('catalog');
    define('IBLOCK_ID_PRODUCTS', 2);
    define('IBLOCK_ID_OFFERS', 3);
    $query = new \Bitrix\Main\Entity\Query(Bitrix\Iblock\ElementTable::getEntity());
    $query->setSelect(array("ID", "IBLOCK_ID"))->setFilter(array("ID" => $ID))->setOrder(array("ID" => "ASC"));
    $resElement = $query->exec()->fetch();
    if ($resElement['IBLOCK_ID'] == IBLOCK_ID_PRODUCTS) {
        CIBlockElement::SetPropertyValuesEx($ID, $resElement['IBLOCK_ID'], array("AVAILABLE_QUANTITY_CATALOG" => $arFields['QUANTITY']));
    } elseif ($resElement['IBLOCK_ID'] == IBLOCK_ID_OFFERS) {
        //1
        $rsElementOffer = CIBlockElement::GetList(array(), array("ID" => $ID), false, false, array("ID", "IBLOCK_ID", 'NAME', "PROPERTY_CML2_LINK"))->fetch();
        $resElemOfferProduct = (int) $rsElementOffer['PROPERTY_CML2_LINK_VALUE'];
        //2
        $resOffersCML2 = CIBlockElement::GetList(array(), array("PROPERTY_CML2_LINK" => $resElemOfferProduct, 'IBLOCK_ID' => IBLOCK_ID_OFFERS), false, false, array("ID", "IBLOCK_ID", 'NAME'));
        //3
        $arrOffersIDs = array();
        while ($res = $resOffersCML2->fetch()) {
            $arrOffersIDs[] = $res['ID'];
        }
        //4
        $availQuant = array();
        foreach ($arrOffersIDs as $k => $v) {
            $ar_res_cat = CCatalogProduct::GetList(array("ID" => "DESC"), array("ID" => (int) $v), false, false, array("ID", "QUANTITY", 'ELEMENT_IBLOCK_ID', 'ELEMENT_NAME'))->fetch();
            $availQuant[] = $ar_res_cat['QUANTITY'];
        }
        //5
        $minAvailQuant = (int) min($availQuant);
        //6
        $resUpdateSCU = CIBlockElement::SetPropertyValuesEx($resElemOfferProduct, IBLOCK_ID_PRODUCTS, array("AVAILABLE_QUANTITY_CATALOG" => $minAvailQuant));
    }
}
开发者ID:VitaliiSestrenskyi,项目名称:sest,代码行数:34,代码来源:scu_sort_available.php

示例13: getUserByProviderAndId

 public static function getUserByProviderAndId($providerName, $userProfile)
 {
     CModule::IncludeModule("iblock");
     $userID = false;
     //Проверим привязан ли к какому нибудь пользователю
     $arrFilter = array("IBLOCK_ID" => USER_SOCIAL_IB, "ACTIVE" => "Y", "PROPERTY_SOCIAL_PROVIDER" => $providerName, "PROPERTY_SOCIAL_ID" => $userProfile["identifier"]);
     $arSelect = array("PROPERTY_USER_ID");
     $rsRes = \CIBlockElement::GetList($arOrder, $arrFilter, false, false, $arSelect);
     if ($arItem = $rsRes->GetNext()) {
         $userID = intval($arItem["PROPERTY_USER_ID_VALUE"]);
     }
     $email = "";
     if (!empty($userProfile["email"])) {
         $email = $userProfile["email"];
     } else {
         if (!empty($userProfile["emailVerified"])) {
             $email = $userProfile["emailVerified"];
         }
     }
     //Проверяем есть ли пользователь с таким мэйлом
     if (!$userID && !empty($email)) {
         $dbUsers = CUser::GetList($by = "EMAIL", $order = "desc", array("=EMAIL" => $email));
         while ($arUser = $dbUsers->Fetch()) {
             $userID = $arUser["ID"];
             self::connectToUser($userID, $providerName, $userProfile);
             self::updateUser($userID, $userProfile);
         }
     }
     return $userID;
 }
开发者ID:Hawkart,项目名称:megatv,代码行数:30,代码来源:CSocialAuth.php

示例14: taskInsertElement

 /**
  * TASK performs with ACTION = INSERT
  *
  * @param int $limit
  * @return string
  */
 public static function taskInsertElement($limit = 500)
 {
     if (($limit = (int) $limit) < 0) {
         return;
     }
     $iblockElement = new \CIBlockElement();
     $connection = \Bitrix\Main\Application::getConnection();
     $sqlHelper = $connection->getSqlHelper();
     // We get a task with the `ACTION` of `INSERT`
     $sql = "\n            SELECT t1.ID as TASK_ID, t1.PARAMS, t1.FILTER_USER_ID, t3.*\n            FROM b_citfact_filter_subscribe_stack as t1\n            LEFT JOIN b_citfact_filter_subscribe_user as t2 ON t2.ID = t1.FILTER_USER_ID\n            LEFT JOIN b_citfact_filter_subscribe as t3 ON t3.ID = t2.FILTER_USER\n            WHERE t1.ACTION = 'INSERT' AND t3.ACTIVE = 'N'\n            LIMIT 1\n        ";
     $task = (array) $connection->query($sql)->fetch();
     if (!empty($task)) {
         $filter['IBLOCK_ID'] = $task['IBLOCK_ID'];
         if ($task['SECTION_ID'] > 0) {
             $filter['SECTION_ID'] = $task['SECTION_ID'];
         }
         $filter = array_merge($filter, unserialize($task['FILTER']));
         $elementResult = $iblockElement->GetList(array('ID' => 'ASC'), $filter, false, array('nTopCount' => $limit), array('ID'));
         while ($element = $elementResult->fetch()) {
             Model\SubscribeNotifyTable::add(array('FILTER_USER_ID' => $task['FILTER_USER_ID'], 'ELEMENT_ID' => $element['ID']));
         }
         Model\SubscribeStackTable::delete(array('ID' => $task['TASK_ID']));
     }
     return "Citfact\\FilterSubscribe\\Agent::taskInsertElement({$limit})";
 }
开发者ID:ASDAFF,项目名称:citfact.filter.subscribe,代码行数:31,代码来源:Agent.php

示例15: getData

 function getData()
 {
     $data = array();
     $svg = new SimpleXMLElement(file_get_contents($this->xml));
     foreach ($svg->deals->deal as $var) {
         $id = $var->id;
         $url = preg_replace("#http://#i", "", $var->vendor_website_url);
         $url = preg_replace("#^([^/]+)/.*#i", "\\1", $url);
         $url = str_replace("www.", "", $url);
         $arSelect = array("ID", "NAME");
         if ($this->filterSite($url)) {
             $arFilter = array("IBLOCK_ID" => IB_CLUB_ID, "PROPERTY_SITE" => "%" . $url . "%");
             if ($res = CIBlockElement::GetList(array("SORT" => "DESC"), $arFilter, FALSE, FALSE, $arSelect)->Fetch()) {
                 if (!($resStock = CIBlockElement::GetList(array("SORT" => "DESC"), array("CODE" => $id, "TAGS" => $this->tags), FALSE, FALSE, $arSelect)->Fetch())) {
                     $PROP = array();
                     $PROP["URL"] = $var->deal_url;
                     // �������� � ����� 12 ����������� �������� "�����"
                     $PROP["CLUB_ID"] = $res["ID"];
                     // �������� � ����� 3 ����������� �������� 38
                     $PROP["PRICE"] = intval($var->value);
                     // �������� � ����� 3 ����������� �������� 38
                     $PROP["DISCOUNT"] = intval($var->discount_percent);
                     // �������� � ����� 3 ����������� �������� 38
                     $PROP["DISCOUNTPRICE"] = intval($var->discount_amount);
                     // �������� � ����� 3 ����������� �������� 38
                     $PROP["PRICECOUPON"] = intval($var->price);
                     // �������� � ����� 3 ����������� �������� 38
                     $arLoadProductArray = array("IBLOCK_ID" => IB_SUB_STOCK_ID, "PROPERTY_VALUES" => $PROP, "NAME" => $var->title, "ACTIVE_FROM" => date("d.m.Y H:m:s", intval($var->start_timestamp)), "ACTIVE_TO" => date("d.m.Y H:m:s", intval($var->end_timestamp)), "CODE" => $id, "TAGS" => $this->tags, "ACTIVE" => "Y", "PREVIEW_TEXT" => strip_tags($var->conditions), "DETAIL_PICTURE" => CFile::MakeFileArray($var->large_image_url));
                     $data[] = $arLoadProductArray;
                 }
             }
         }
     }
     return count($data) ? $data : false;
 }
开发者ID:nProfessor,项目名称:Mytb,代码行数:35,代码来源:MegaKupon.php


注:本文中的CIBlockElement::GetList方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。