1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
history.php
См. документацию.
1
<?php
2
3
class
CPerfomanceHistory
4
{
5
public
static
function
GetList
($arOrder,
$arFilter
= [])
6
{
7
global
$DB
;
8
9
if
(!is_array($arOrder))
10
{
11
$arOrder = [];
12
}
13
if
(
count
($arOrder) < 1)
14
{
15
$arOrder = [
16
'ID'
=>
'DESC'
,
17
];
18
}
19
20
$arQueryOrder = [];
21
foreach
($arOrder as $strColumn => $strDirection)
22
{
23
$strColumn = mb_strtoupper($strColumn);
24
$strDirection = mb_strtoupper($strDirection) ===
'ASC'
?
'ASC'
:
'DESC'
;
25
if
($strColumn ===
'ID'
)
26
{
27
$arQueryOrder[$strColumn] = $strColumn .
' '
. $strDirection;
28
}
29
}
30
31
static
$arWhereFields = [
32
'ID'
=> [
33
'TABLE_ALIAS'
=>
'h'
,
34
'FIELD_NAME'
=>
'ID'
,
35
'FIELD_TYPE'
=>
'int'
,
36
'JOIN'
=>
false
,
37
],
38
];
39
40
$obQueryWhere =
new
CSQLWhere
;
41
$obQueryWhere->
SetFields
($arWhereFields);
42
43
$strSql =
'
44
SELECT
45
h.*
46
,'
.
$DB
->DateToCharFunction(
'h.TIMESTAMP_X'
) .
' TIMESTAMP_X
47
FROM
48
b_perf_history h
49
'
;
50
if
(!is_array(
$arFilter
))
51
{
52
$arFilter
= [];
53
}
54
if
($strQueryWhere = $obQueryWhere->GetQuery(
$arFilter
))
55
{
56
$strSql .=
'
57
WHERE
58
'
. $strQueryWhere .
'
59
'
;
60
}
61
if
(
count
($arQueryOrder) > 0)
62
{
63
$strSql .=
'
64
ORDER BY
65
'
. implode(
', '
, $arQueryOrder) .
'
66
'
;
67
}
68
69
return
$DB
->Query($strSql);
70
}
71
72
public
static
function
Delete
(
$ID
)
73
{
74
global
$DB
;
75
$ID
= intval(
$ID
);
76
return
$DB
->Query(
'DELETE FROM b_perf_history WHERE ID = '
.
$ID
);
77
}
78
79
public
static
function
Add
(
$arFields
)
80
{
81
global
$DB
;
82
83
if
(
$arFields
[
'TOTAL_MARK'
] > 0)
84
{
85
$arFields
[
'ACCELERATOR_ENABLED'
] =
$arFields
[
'ACCELERATOR_ENABLED'
] ===
'Y'
?
'Y'
:
'N'
;
86
$arFields
[
'~TIMESTAMP_X'
] =
$DB
->CurrentTimeFunction();
87
return
$DB
->Add(
'b_perf_history'
,
$arFields
);
88
}
89
else
90
{
91
return
false
;
92
}
93
}
94
}
CAllSQLWhere\SetFields
SetFields($arFields)
Определения
sqlwhere.php:239
CPerfomanceHistory
Определения
history.php:4
CPerfomanceHistory\Delete
static Delete($ID)
Определения
history.php:72
CPerfomanceHistory\Add
static Add($arFields)
Определения
history.php:79
CPerfomanceHistory\GetList
static GetList($arOrder, $arFilter=[])
Определения
history.php:5
CSQLWhere
Определения
sqlwhere.php:1359
$arFields
$arFields
Определения
dblapprove.php:5
$ID
if($ajaxMode) $ID
Определения
get_user.php:27
$DB
global $DB
Определения
cron_frame.php:29
count
</p ></td >< td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0cm 2.0pt 0cm 2.0pt;height:9.0pt'>< p class=Normal align=center style='margin:0cm;margin-bottom:.0001pt;text-align:center;line-height:normal'>< a name=ТекстовоеПоле54 ></a ><?=($taxRate > count( $arTaxList) > 0) ? $taxRate."%"
Определения
waybill.php:936
$arFilter
$arFilter
Определения
user_search.php:106
bitrix
modules
perfmon
classes
general
history.php
Создано системой
1.14.0