SELECT SQL_CALC_FOUND_ROWS  a.`Message_ID`, a.`User_ID`, a.`IP`, a.`UserAgent`, a.`LastUser_ID`, a.`LastIP`, a.`LastUserAgent`, a.`Priority`, a.`Parent_Message_ID`, a.`ncTitle`, a.`ncKeywords`, a.`ncDescription`, sub.`Subdivision_ID`, CONCAT('', sub.`Hidden_URL`) AS `Hidden_URL`, cc.`Sub_Class_ID`, cc.`EnglishName`, a.`Checked`, a.`Created`, a.`Keyword`, a.`LastUpdated` + 0 AS LastUpdated, a.ObjectID, a.SectionID, a.isCommerce, a.CommerceName, tbl2835.CommerceType_Name AS CommerceType, tbl2835.CommerceType_ID AS CommerceType_id, tbl2835.`Value` AS CommerceType_value , a.Code, a.Floor, a.BldNr, a.Nr, a.FloorNr, a.Rooms, a.SquareTotal, a.SquareLiving, a.SquareKitchen, a.TCount, a.BCount, a.Cost, a.Price, tbl2652.FlatStatus_Name AS Status, tbl2652.FlatStatus_ID AS Status_id, tbl2652.`Value` AS Status_value , a.ArticleId, a.DiscountPrice, tbl2942.TypeObject_Name AS TypeObject, tbl2942.TypeObject_ID AS TypeObject_id, tbl2942.`Value` AS TypeObject_value , tbl2943.SubTypeObject_Name AS SubTypeObject, tbl2943.SubTypeObject_ID AS SubTypeObject_id, tbl2943.`Value` AS SubTypeObject_value , a.smallAboutPenthaus, a.TextPenthause, a.CeilingHeight, a.PhotoPenthausList, a.countlavatory, a.SaleAction, a.SaleActionFromCrm
                   FROM (`Message2039` AS a )  LEFT JOIN `Subdivision` AS sub ON sub.`Subdivision_ID` = a.`Subdivision_ID`
                  LEFT JOIN `Sub_Class` AS cc ON cc.`Sub_Class_ID` = a.`Sub_Class_ID`  LEFT JOIN `Classificator_CommerceType` AS tbl2835 ON a.`CommerceType` = tbl2835.CommerceType_ID  LEFT JOIN `Classificator_FlatStatus` AS tbl2652 ON a.`Status` = tbl2652.FlatStatus_ID  LEFT JOIN `Classificator_TypeObject` AS tbl2942 ON a.`TypeObject` = tbl2942.TypeObject_ID  LEFT JOIN `Classificator_SubTypeObject` AS tbl2943 ON a.`SubTypeObject` = tbl2943.SubTypeObject_ID  
                  WHERE 1  AND a.`Parent_Message_ID` = '0'  AND sub.`Catalogue_ID` = '1'  AND a.`Subdivision_ID` = '31'  AND a.`Sub_Class_ID` = '45'  AND a.`Checked` = 1  ORDER BY a.`Priority` DESC, a.`LastUpdated` DESC LIMIT 0,20

Заказать обратный звонок

Оставить заявку