From 4817b6ffa38af8b269e4ad91591d70c032dd8e5d Mon Sep 17 00:00:00 2001 From: BigCoke233 Date: Sat, 11 Jul 2020 09:32:16 +0800 Subject: =?UTF-8?q?:zap:=20Perf:=20=E4=BC=98=E5=8C=96=E5=BD=92=E6=A1=A3?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=20meta=20=E5=85=83=E4=BF=A1=E6=81=AF=20#64?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- libs/Utils.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'libs/Utils.php') 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 -- cgit v1.2.3