SELECT
a.*,
b.option_name,
b.internal_option_name,
b.option_text,
b.description,
b.inner_hint,
b.incorrect_message,
b.comment
FROM
cscart_product_options as a
LEFT JOIN cscart_product_options_descriptions as b ON a.option_id = b.option_id
AND b.lang_code = 'kk'
INNER JOIN cscart_ult_objects_sharing ON (
cscart_ult_objects_sharing.share_object_id = a.option_id
AND cscart_ult_objects_sharing.share_company_id = 1
AND cscart_ult_objects_sharing.share_object_type = 'product_options'
)
WHERE
a.product_id IN (
51480, 51479, 51494, 51495, 132, 112,
3, 78, 2, 77, 87, 66, 22421, 22424, 22290,
50981, 50982, 133, 45, 143, 50983, 51416,
51043, 51421, 51471, 51413, 51057,
51472, 51547, 51470, 51500, 51412,
51529, 51459, 51457, 51460, 51501,
51530, 51464, 51051, 51053, 51551,
51478, 51469, 51510, 51486, 51531,
51467, 51047, 51461, 51044, 51475,
51477, 51473, 51437, 51540, 51048,
51525, 51458, 51463, 51516, 51532,
51545, 51492, 51514, 51538, 51539,
51468, 51476, 51491, 51513, 51474,
51503, 51520, 51541, 51462, 51502,
51522, 51499, 51465, 51509, 51515,
51466, 51485, 51518, 51550, 51519,
51524, 51528, 51508, 51527, 51543,
51482, 51504, 51542, 51512, 51493,
51511, 51505, 51046, 51439, 51544,
51054, 51546, 51548, 51438, 51535
)
AND a.status = 'A'
ORDER BY
a.position