SELECT BE ID AS ID BE IBLOCK_ID AS IBLOCK_ID BE NAME AS NAME BE CODE A

 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
SELECT BE.ID AS ID,
BE.IBLOCK_ID AS IBLOCK_ID,
BE.NAME AS NAME,
BE.CODE AS CODE,
BE.PREVIEW_PICTURE AS PREVIEW_PICTURE,
BE.PREVIEW_TEXT AS PREVIEW_TEXT,
FPV0.VALUE AS PROPERTY_PHOTO1_VALUE,
FPV0.ID AS PROPERTY_PHOTO1_VALUE_ID,
FPV1.VALUE AS PROPERTY_ARTICUL_VALUE,
FPV1.ID AS PROPERTY_ARTICUL_VALUE_ID,
FPV2.VALUE AS PROPERTY_FABRIKA_VALUE,
FPV2.ID AS PROPERTY_FABRIKA_VALUE_ID,
FPV3.VALUE AS PROPERTY_STYLE_VALUE,
FPV3.ID AS PROPERTY_STYLE_VALUE_ID,
FPV4.VALUE AS PROPERTY_COLLECTION_VALUE,
FPV4.ID AS PROPERTY_COLLECTION_VALUE_ID,
FPV5.VALUE AS PROPERTY_COUNTRY_VALUE,
FPV5.ID AS PROPERTY_COUNTRY_VALUE_ID,
FPV6.VALUE AS PROPERTY_APPOINTMENT_VALUE,
FPV6.ID AS PROPERTY_APPOINTMENT_VALUE_ID,
FPV7.VALUE AS PROPERTY_COLOR_SCHEME_VALUE,
FPV7.ID AS PROPERTY_COLOR_SCHEME_VALUE_ID,
FPV8.VALUE AS PROPERTY_SIDE_1_VALUE,
FPV8.ID AS PROPERTY_SIDE_1_VALUE_ID,
FPV9.VALUE AS PROPERTY_SIDE_2_VALUE,
FPV9.ID AS PROPERTY_SIDE_2_VALUE_ID,
FPV10.VALUE AS PROPERTY_TYPE_VALUE,
FPV10.ID AS PROPERTY_TYPE_VALUE_ID,
BE.PREVIEW_TEXT_TYPE AS PREVIEW_TEXT_TYPE
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
LEFT JOIN b_iblock_property FP0 ON FP0.IBLOCK_ID = B.ID
AND FP0.CODE='PHOTO1'
LEFT JOIN b_iblock_property FP1 ON FP1.IBLOCK_ID = B.ID
AND FP1.CODE='ARTICUL'
INNER JOIN b_iblock_property FP2 ON FP2.IBLOCK_ID = B.ID
AND FP2.CODE='FABRIKA'
LEFT JOIN b_iblock_property FP3 ON FP3.IBLOCK_ID = B.ID
AND FP3.CODE='STYLE'
INNER JOIN b_iblock_property FP4 ON FP4.IBLOCK_ID = B.ID
AND FP4.CODE='COLLECTION'
LEFT JOIN b_iblock_property FP5 ON FP5.IBLOCK_ID = B.ID
AND FP5.CODE='COUNTRY'
LEFT JOIN b_iblock_property FP6 ON FP6.IBLOCK_ID = B.ID
AND FP6.CODE='APPOINTMENT'
LEFT JOIN b_iblock_property FP7 ON FP7.IBLOCK_ID = B.ID
AND FP7.CODE='COLOR_SCHEME'
LEFT JOIN b_iblock_property FP8 ON FP8.IBLOCK_ID = B.ID
AND FP8.CODE='SIDE_1'
LEFT JOIN b_iblock_property FP9 ON FP9.IBLOCK_ID = B.ID
AND FP9.CODE='SIDE_2'
LEFT JOIN b_iblock_property FP10 ON FP10.IBLOCK_ID = B.ID
AND FP10.CODE='TYPE'
LEFT JOIN b_iblock_element_property FPV0 ON FPV0.IBLOCK_PROPERTY_ID = FP0.ID
AND FPV0.IBLOCK_ELEMENT_ID = BE.ID
LEFT JOIN b_iblock_element_property FPV1 ON FPV1.IBLOCK_PROPERTY_ID = FP1.ID
AND FPV1.IBLOCK_ELEMENT_ID = BE.ID
INNER JOIN b_iblock_element_property FPV2 ON FPV2.IBLOCK_PROPERTY_ID = FP2.ID
AND FPV2.IBLOCK_ELEMENT_ID = BE.ID
LEFT JOIN b_iblock_element_property FPV3 ON FPV3.IBLOCK_PROPERTY_ID = FP3.ID
AND FPV3.IBLOCK_ELEMENT_ID = BE.ID
INNER JOIN b_iblock_element_property FPV4 ON FPV4.IBLOCK_PROPERTY_ID = FP4.ID
AND FPV4.IBLOCK_ELEMENT_ID = BE.ID
LEFT JOIN b_iblock_element_property FPV5 ON FPV5.IBLOCK_PROPERTY_ID = FP5.ID
AND FPV5.IBLOCK_ELEMENT_ID = BE.ID
LEFT JOIN b_iblock_element_property FPV6 ON FPV6.IBLOCK_PROPERTY_ID = FP6.ID
AND FPV6.IBLOCK_ELEMENT_ID = BE.ID
LEFT JOIN b_iblock_element_property FPV7 ON FPV7.IBLOCK_PROPERTY_ID = FP7.ID
AND FPV7.IBLOCK_ELEMENT_ID = BE.ID
LEFT JOIN b_iblock_element_property FPV8 ON FPV8.IBLOCK_PROPERTY_ID = FP8.ID
AND FPV8.IBLOCK_ELEMENT_ID = BE.ID
LEFT JOIN b_iblock_element_property FPV9 ON FPV9.IBLOCK_PROPERTY_ID = FP9.ID
AND FPV9.IBLOCK_ELEMENT_ID = BE.ID
LEFT JOIN b_iblock_element_property FPV10 ON FPV10.IBLOCK_PROPERTY_ID = FP10.ID
AND FPV10.IBLOCK_ELEMENT_ID = BE.ID
INNER JOIN
(SELECT DISTINCT BSE.IBLOCK_ELEMENT_ID
FROM b_iblock_section_element BSE
INNER JOIN b_iblock_section BS ON BSE.IBLOCK_SECTION_ID = BS.ID
WHERE ((BS.ID IN (387,
388,
389,
390,
397,
408,
444,
446,
465))) ) BES ON BES.IBLOCK_ELEMENT_ID = BE.ID
WHERE 1=1
AND (((((BE.IBLOCK_ID = '18'))))
AND ((((BE.ACTIVE='Y'))))
AND ((((((FPV4.VALUE LIKE 'Chrome'))))
AND ((((FPV2.VALUE LIKE 'Ravak')))))))
AND (((BE.WF_STATUS_ID=1
AND BE.WF_PARENT_ELEMENT_ID IS NULL))