From 76ccce0d45f3e73ec8b573dd558cea9293e0388c Mon Sep 17 00:00:00 2001 From: molong Date: Wed, 4 Apr 2018 08:36:51 +0800 Subject: [PATCH] =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=8F=B7=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=EF=BC=8C=E6=8E=A5=E5=8F=A3=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/api/controller/Content.php | 25 +++++++++++++++++++++++++ application/common.php | 2 +- 2 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 application/api/controller/Content.php diff --git a/application/api/controller/Content.php b/application/api/controller/Content.php new file mode 100644 index 00000000..39aab949 --- /dev/null +++ b/application/api/controller/Content.php @@ -0,0 +1,25 @@ +page($page . ',' . $pagesize)->order('id desc')->select(); + foreach($list as $key => $value){ + $list[$key]['create_time'] = date('Y-m-d H:i:s', $value['create_time']); + $list[$key]['cover'] = 'https://www.tensent.cn' . get_cover($value['cover_id'], 'path'); + } + $this->data['list'] = $list; + return $this->data; + } + + public function detail($id = 0){ + $info = db('Article')->where('id', $id)->find(); + $info['create_time'] = date('Y-m-d H:i:s', $info['create_time']); + $info['content'] = str_replace('/uploads/', 'https://www.tensent.cn/uploads/', $info['content']); + $info['cover'] = 'https://www.tensent.cn' . get_cover($info['cover_id'], 'path'); + + $this->data['info'] = $info; + return $this->data; + } +} diff --git a/application/common.php b/application/common.php index 08697fba..708c5dc8 100644 --- a/application/common.php +++ b/application/common.php @@ -8,7 +8,7 @@ // +---------------------------------------------------------------------- // SentCMS常量定义 -define('SENTCMS_VERSION', '3.5.201801'); +define('SENTCMS_VERSION', '3.6.201803'); define('SENT_ADDON_PATH', __DIR__ . '/../addons' . DS); //字符串解密加密