string(1949) "SELECT * FROM (SELECT cr.content_id AS id, cr.content_type AS content_type, u.username AS company, u.kod AS comp_id, cr.title AS title, cr.content AS content, cr.published AS published, ifnull( concat(a.base_path, '',a.catalog,'/small',a.file_name) , concat('/uploads/gallery/', cr.comp_id, '/folders/', uf.img) ) AS logo, cr.all_cats AS all_cats, cr.proizvoditel AS proizvoditel, cr.prodavets AS prodavets, cr.pokupatel AS pokupatel, u.city1 AS city1, u.type AS utype, cr.price1 AS price1, cr.price2 AS price2, cr.val AS val, u.url AS url, u.country_id1 AS country_id1, MATCH (ct.title) AGAINST ('>>>>>>>>(гидромоторы) >>>>>>>(гидромоторы*) >>>>>>(гидромотор*) >>>>(гидромото*) >>>(гидромот*) >>(гидромо*) >(гидром*) (гидро*)' in boolean mode) + (case u.type when 'free' then 0 when 'start' then 0.61 when 'business' then 0.81 when 'premium' then 1.01 when 'elit' then 3.01 when 'prioritet' then 5.01 else -0.5 end) AS kf, 1 AS rof FROM content_text ct INNER JOIN content_report cr ON (ct.content_id = cr.content_id AND ct.content_type = cr.content_type) INNER JOIN users AS u ON cr.comp_id = u.kod LEFT JOIN photo AS a ON cr.logo = left join users_folders uf on uf.comp_id = cr.comp_id and = ifnull(cr.folder_id,0) WHERE MATCH (ct.title) AGAINST ('>>>>>>>>(гидромоторы) >>>>>>>(гидромоторы*) >>>>>>(гидромотор*) >>>>(гидромото*) >>>(гидромот*) >>(гидромо*) >(гидром*) (гидро*)' in boolean mode) AND cr.content_type != 'art' and cr.content_type != 'fl' AND (u.status = 'active' and cr.status in (1,2) and cr.state = 1 and u.inRU = 1 ) ORDER BY kf desc, published desc) as sh_match_group GROUP BY comp_id ORDER BY rof desc, kf desc, published desc"