SELECT BE SORT AS SORT BE ID AS ID DATE_FORMAT BE TIMESTAMP_X AS TIMES

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
SELECT BE.SORT AS
SORT,
BE.ID AS ID,
DATE_FORMAT(BE.TIMESTAMP_X, '%d.%m.%Y %H:%i:%s') AS TIMESTAMP_X,
UNIX_TIMESTAMP(BE.TIMESTAMP_X) AS TIMESTAMP_X_UNIX,
BE.MODIFIED_BY AS MODIFIED_BY,
DATE_FORMAT(BE.DATE_CREATE, '%d.%m.%Y %H:%i:%s') AS DATE_CREATE,
UNIX_TIMESTAMP(BE.DATE_CREATE) AS DATE_CREATE_UNIX,
BE.CREATED_BY AS CREATED_BY,
BE.IBLOCK_ID AS IBLOCK_ID,
BE.IBLOCK_SECTION_ID AS IBLOCK_SECTION_ID,
BE.ACTIVE AS ACTIVE,
IF(EXTRACT(HOUR_SECOND
FROM BE.ACTIVE_FROM)>0, DATE_FORMAT(BE.ACTIVE_FROM, '%d.%m.%Y %H:%i:%s'), DATE_FORMAT(BE.ACTIVE_FROM, '%d.%m.%Y')) AS ACTIVE_FROM,
IF(EXTRACT(HOUR_SECOND
FROM BE.ACTIVE_TO)>0, DATE_FORMAT(BE.ACTIVE_TO, '%d.%m.%Y %H:%i:%s'), DATE_FORMAT(BE.ACTIVE_TO, '%d.%m.%Y')) AS ACTIVE_TO,
IF(EXTRACT(HOUR_SECOND
FROM BE.ACTIVE_FROM)>0, DATE_FORMAT(BE.ACTIVE_FROM, '%d.%m.%Y %H:%i:%s'), DATE_FORMAT(BE.ACTIVE_FROM, '%d.%m.%Y')) AS DATE_ACTIVE_FROM,
IF(EXTRACT(HOUR_SECOND
FROM BE.ACTIVE_TO)>0, DATE_FORMAT(BE.ACTIVE_TO, '%d.%m.%Y %H:%i:%s'), DATE_FORMAT(BE.ACTIVE_TO, '%d.%m.%Y')) AS DATE_ACTIVE_TO,
BE.NAME AS NAME,
BE.PREVIEW_PICTURE AS PREVIEW_PICTURE,
BE.PREVIEW_TEXT AS PREVIEW_TEXT,
BE.PREVIEW_TEXT_TYPE AS PREVIEW_TEXT_TYPE,
BE.DETAIL_PICTURE AS DETAIL_PICTURE,
BE.DETAIL_TEXT AS DETAIL_TEXT,
BE.DETAIL_TEXT_TYPE AS DETAIL_TEXT_TYPE,
BE.SEARCHABLE_CONTENT AS SEARCHABLE_CONTENT,
BE.WF_STATUS_ID AS WF_STATUS_ID,
BE.WF_PARENT_ELEMENT_ID AS WF_PARENT_ELEMENT_ID,
BE.WF_LAST_HISTORY_ID AS WF_LAST_HISTORY_ID,
BE.WF_NEW AS WF_NEW,
IF (BE.WF_DATE_LOCK IS NULL,
'green',
if(DATE_ADD(BE.WF_DATE_LOCK, interval 60 MINUTE)<now(), 'green', if(BE.WF_LOCKED_BY=0, 'yellow', 'red'))) AS LOCK_STATUS,
BE.WF_LOCKED_BY AS WF_LOCKED_BY,
DATE_FORMAT(BE.WF_DATE_LOCK, '%d.%m.%Y %H:%i:%s') AS WF_DATE_LOCK,
BE.WF_COMMENTS AS WF_COMMENTS,
BE.IN_SECTIONS AS IN_SECTIONS,
BE.SHOW_COUNTER AS SHOW_COUNTER,
DATE_FORMAT(BE.SHOW_COUNTER_START, '%d.%m.%Y %H:%i:%s') AS SHOW_COUNTER_START,
BE.SHOW_COUNTER_START AS SHOW_COUNTER_START_X,
BE.CODE AS CODE,
BE.TAGS AS TAGS,
BE.XML_ID AS XML_ID,
BE.XML_ID AS EXTERNAL_ID,
BE.TMP_ID AS TMP_ID,
concat('(', U.LOGIN, ') ', ifnull(U.NAME, ''), ' ', ifnull(U.LAST_NAME, '')) AS USER_NAME,
concat('(', UL.LOGIN, ') ', ifnull(UL.NAME, ''), ' ', ifnull(UL.LAST_NAME, '')) AS LOCKED_USER_NAME,
concat('(', UC.LOGIN, ') ', ifnull(UC.NAME, ''), ' ', ifnull(UC.LAST_NAME, '')) AS CREATED_USER_NAME,
L.DIR AS LANG_DIR,
B.LID AS LID,
B.IBLOCK_TYPE_ID AS IBLOCK_TYPE_ID,
B.CODE AS IBLOCK_CODE,
B.NAME AS IBLOCK_NAME,
B.XML_ID AS IBLOCK_EXTERNAL_ID,
B.DETAIL_PAGE_URL AS DETAIL_PAGE_URL,
B.LIST_PAGE_URL AS LIST_PAGE_URL,
B.CANONICAL_PAGE_URL AS CANONICAL_PAGE_URL,
DATE_FORMAT(BE.DATE_CREATE, '%Y.%m.%d') AS CREATED_DATE,
if(BE.WF_STATUS_ID = 1, 'Y', 'N') AS BP_PUBLISHED
FROM b_iblock B
INNER JOIN b_lang L ON B.LID=L.LID
INNER JOIN b_iblock_element BE ON BE.IBLOCK_ID = B.ID
INNER JOIN b_iblock_element_prop_s28 FPS0 ON FPS0.IBLOCK_ELEMENT_ID = BE.ID
LEFT JOIN b_user U ON U.ID=BE.MODIFIED_BY
LEFT JOIN b_user UL ON UL.ID=BE.WF_LOCKED_BY
LEFT JOIN b_user UC ON UC.ID=BE.CREATED_BY
WHERE 1=1
AND (((((BE.IBLOCK_ID = '28'))))
AND ((((BE.ACTIVE='Y'))))
AND ((((FPS0.PROPERTY_432 LIKE '/bitrix/components/bitrix/pull.request/ajax.php')))))
AND (((BE.WF_STATUS_ID=1
AND BE.WF_PARENT_ELEMENT_ID IS NULL)))
ORDER BY BE.SORT ASC,
BE.ID ASC