1. SQL / Говнокод #8112

    −853

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    SELECT a.*,r.rating_count,r.rating_sum,cc.params AS catparams,cc.title AS cattle,cc.alias AS category_alias FROM gn_content AS a INNER JOIN gn_categories AS cc ON cc.id = a.catid LEFT JOIN gn_content_rating AS r ON r.content_id = a.id WHERE a.state = 1 AND cc.published = 1 
    
                    AND ( a.publish_up = '2011-10-07 21:02:32' OR a.publish_up <= '2011-10-07 18:02:38' ) 
    
                    AND ( a.publish_down = '2011-10-07 21:02:32' OR a.publish_down >= '2011-10-07 18:02:38' ) 
    
                    AND (cc.id = 105 OR cc.id = 106 OR cc.id = 107 OR cc.id = 108 OR cc.id = 109 OR cc.id = 110 OR cc.id = 111 OR cc.id = 106 OR cc.id = 107 OR cc.id = 108 OR cc.id = 109 OR cc.id = 110 OR cc.id = 111) 
                    ORDER BY a.created DESC

    Это код модуля adinews2 для joomla

    Используются всегда только 2 даты: начало, конец

    Запостил: uadeveloper, 07 Октября 2011

    Комментарии (3) RSS

    Добавить комментарий