DEBUG: SQL = SELECT DISTINCT a.id FROM cms_module_coupon a INNER JOIN cms_module_coupon_coup_cat c on a.id=c.coupon_id INNER JOIN cms_module_coupon_category e on c.cat_id=e.id WHERE e.hierarchy LIKE '%' AND (valid_from<=NOW() or valid_from is NULL) AND (valid_until>=NOW() or valid_until is NULL) AND status=2 AND type=1 AND default_city= ORDER BY priority_city DESC, priority_cat DESC, created DESC, id DESC LIMIT 4
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ORDER BY priority_city DESC, priority_cat DESC, created DESC, id DESC LIMIT 4' at line 4