1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
iblockoffers.php
См. документацию.
1
<?php
2
3
class
CIBlockOffersTmp
extends
CAllIBlockOffersTmp
4
{
5
public
static
function
GetOldID
($intProductIBlockID, $intOffersIBlockID, $intInterval = 1800)
6
{
7
global
$DB
;
8
$connection
=
\Bitrix\Main\Application::getConnection
();
9
$helper =
$connection
->getSqlHelper();
10
11
$intProductIBlockID = (int)$intProductIBlockID;
12
$intOffersIBlockID = (int)$intOffersIBlockID;
13
$intInterval = (int)$intInterval;
14
15
if
($intProductIBlockID <= 0 || $intOffersIBlockID <= 0)
16
return
false
;
17
18
if
($intInterval <= 0)
19
$intInterval = 1800;
20
21
$strQuery =
'
22
select ID
23
from b_iblock_offers_tmp
24
where PRODUCT_IBLOCK_ID = '
.$intProductIBlockID.
'
25
and OFFERS_IBLOCK_ID = '
.$intOffersIBlockID.
'
26
and TIMESTAMP_X < '
. $helper->addSecondsToDateTime(-$intInterval) .
'
27
'
;
28
return
$DB
->Query($strQuery);
29
}
30
31
public
static
function
DeleteOldID
($intProductIBlockID, $intOffersIBlockID = 0, $intInterval = 86400)
32
{
33
global
$DB
;
34
$connection
=
\Bitrix\Main\Application::getConnection
();
35
$helper =
$connection
->getSqlHelper();
36
37
$intProductIBlockID = (int)$intProductIBlockID;
38
$intOffersIBlockID = (int)$intOffersIBlockID;
39
$intInterval = (int)$intInterval;
40
41
if
($intProductIBlockID <= 0)
42
return
false
;
43
44
if
($intInterval <= 0)
45
$intInterval = 86400;
46
47
$strQuery =
'
48
delete from b_iblock_offers_tmp
49
where PRODUCT_IBLOCK_ID = '
.$intProductIBlockID.
'
50
'
.(0 < $intOffersIBlockID ?
'and OFFERS_IBLOCK_ID = '
.$intOffersIBlockID :
''
).
'
51
and TIMESTAMP_X < '
. $helper->addSecondsToDateTime(-$intInterval) .
'
52
'
;
53
return
is_object(
$DB
->Query($strQuery));
54
}
55
}
$connection
$connection
Определения
actionsdefinitions.php:38
Bitrix\Main\Application\getConnection
static getConnection($name="")
Определения
application.php:638
CAllIBlockOffersTmp
Определения
iblockoffers.php:6
CIBlockOffersTmp
Определения
iblockoffers.php:4
CIBlockOffersTmp\DeleteOldID
static DeleteOldID($intProductIBlockID, $intOffersIBlockID=0, $intInterval=86400)
Определения
iblockoffers.php:31
CIBlockOffersTmp\GetOldID
static GetOldID($intProductIBlockID, $intOffersIBlockID, $intInterval=1800)
Определения
iblockoffers.php:5
$DB
global $DB
Определения
cron_frame.php:29
bitrix
modules
iblock
classes
mysql
iblockoffers.php
Создано системой
1.14.0