1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
index_complete.php
См. документацию.
1<?php
2
4{
5 public static function GetList($arFilter = [], $arOrder = [])
6 {
7 global $DB;
8
9 if (!is_array($arOrder))
10 {
11 $arOrder = [];
12 }
13 if (count($arOrder) < 1)
14 {
15 $arOrder = [
16 'TABLE_NAME' => 'ASC',
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 switch ($strColumn)
26 {
27 case 'ID':
28 case 'TABLE_NAME':
29 $arSelect[] = $strColumn;
30 $arQueryOrder[$strColumn] = $strColumn . ' ' . $strDirection;
31 break;
32 }
33 }
34
35 $obQueryWhere = new CSQLWhere;
36 $obQueryWhere->SetFields([
37 'ID' => [
38 'TABLE_ALIAS' => 's',
39 'FIELD_NAME' => 'ID',
40 'FIELD_TYPE' => 'int', //int, double, file, enum, int, string, date, datetime
41 'JOIN' => false,
42 //"LEFT_JOIN" => "lt",
43 ],
44 ]);
45
46 if (!is_array($arFilter))
47 {
48 $arFilter = [];
49 }
50 $strQueryWhere = $obQueryWhere->GetQuery($arFilter);
51
52 $strSql = '
53 SELECT *
54 FROM b_perf_index_complete s
55 ' . ($strQueryWhere ? 'WHERE ' . $strQueryWhere : '') . '
56 ' . (count($arQueryOrder) ? 'ORDER BY ' . implode(', ', $arQueryOrder) : '') . '
57 ';
58 $res = $DB->Query($strSql);
59
60 return $res;
61 }
62
63 public static function Add($arFields)
64 {
65 global $DB;
66 $ID = $DB->Add('b_perf_index_complete', $arFields);
67 return $ID;
68 }
69
70 public static function Delete($ID)
71 {
72 global $DB;
73 $ID = intval($ID);
74 $DB->Query('DELETE FROM b_perf_index_complete WHERE ID = ' . $ID);
75 }
76
77 public static function DeleteByTableName($table, $columns)
78 {
79 global $DB;
80 $DB->Query("
81 delete
82 from b_perf_index_complete
83 where TABLE_NAME = '" . $DB->ForSql($table) . "'
84 AND COLUMN_NAMES = '" . $DB->ForSql($columns) . "'
85 ");
86 }
87
88 public static function IsBanned($table, $columns)
89 {
90 global $DB;
91 $rs = $DB->Query("
92 select *
93 from b_perf_index_complete
94 where TABLE_NAME = '" . $DB->ForSql($table) . "'
95 AND COLUMN_NAMES = '" . $DB->ForSql($columns) . "'
96 AND BANNED = 'Y'
97 ");
98 return is_array($rs->Fetch());
99 }
100}
SetFields($arFields)
Определения sqlwhere.php:239
static DeleteByTableName($table, $columns)
Определения index_complete.php:77
static Delete($ID)
Определения index_complete.php:70
static Add($arFields)
Определения index_complete.php:63
static IsBanned($table, $columns)
Определения index_complete.php:88
static GetList($arFilter=[], $arOrder=[])
Определения index_complete.php:5
Определения sqlwhere.php:1359
$arFields
Определения dblapprove.php:5
$res
Определения filter_act.php:7
if($ajaxMode) $ID
Определения get_user.php:27
global $DB
Определения cron_frame.php:29
</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
$rs
Определения action.php:82
$arFilter
Определения user_search.php:106