diff options
| author | BigCoke233 <hi@guhub.cn> | 2020-07-11 09:32:16 +0800 |
|---|---|---|
| committer | BigCoke233 <hi@guhub.cn> | 2020-07-11 09:32:16 +0800 |
| commit | 4817b6ffa38af8b269e4ad91591d70c032dd8e5d (patch) | |
| tree | 028633c00df80fb806335bf6745150818afca5be /libs/Utils.php | |
| parent | fdb60d77b1b68c9326b08a8ece770af3ac168877 (diff) | |
:zap: Perf: 优化归档页面 meta 元信息 #64
Diffstat (limited to 'libs/Utils.php')
| -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 |
