diff options
Diffstat (limited to 'libs')
| -rw-r--r-- | libs/Utils.php | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/libs/Utils.php b/libs/Utils.php index f9785bc..34ac4fe 100644 --- a/libs/Utils.php +++ b/libs/Utils.php @@ -140,4 +140,17 @@ class Utils } } } + + /** + * 获取最早文章创建时间 + */ + public static function getOldestPostDate() { + $db = Typecho_Db::get(); + $content = $db->fetchRow($db->select()->from('table.contents') + ->where('table.contents.status = ?', 'publish') + ->where('table.contents.password IS NULL') + ->order('table.contents.created', Typecho_Db::SORT_ASC) + ->limit(1)); + echo '一切开始于 '.date('Y-m-d', $content['created']); + } }
\ No newline at end of file |
