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); //字符串解密加密