static function getLayouts() { if (self::$layouts === null) { self::$layouts = array(); $sql = " SELECT name, count(page.id) as num \t\t\t\t\t" . " FROM module m LEFT JOIN page ON m.name = page.module\t" . " WHERE local_time AND name LIKE 'cms.layout.%'\t\t\t" . " GROUP BY m.name\t\t\t\t\t\t\t\t\t\t" . " ORDER BY count(page.id) DESC\t\t\t\t\t\t\t"; foreach (D()->query($sql) as $vs) { self::$layouts[$vs['name']] = sysPATH . $vs['name'] . '/'; } } return self::$layouts; }