12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- <?php
- // +—————————————————————————————————————————————————————————————————————
- // | Created by Yunbao
- // +—————————————————————————————————————————————————————————————————————
- // | Copyright (c) 2013~2022 http://www.yunbaokj.com All rights reserved.
- // +—————————————————————————————————————————————————————————————————————
- // | Author: https://gitee.com/yunbaokeji
- // +—————————————————————————————————————————————————————————————————————
- // | Date: 2022-04-30
- // +—————————————————————————————————————————————————————————————————————
- namespace app\appapi\controller;
- use cmf\controller\HomeBaseController;
- use think\Db;
- use think\db\Query;
- class PageController extends HomebaseController{
- //文章
- public function news() {
- $id = $this->request->param('id',0,'intval');
- $news=Db::name("posts")
- ->field("post_title,post_content")
- ->where("id='{$id}'")->find();
- $this->assign("news",$news);
-
- return $this->fetch();
- }
- //读取常见问题下的文章列表
- public function questions(){
- $questionList=Db::name("posts")
- ->field("id,post_title")
- ->where("termid=13")
- ->select();
- $questionList->all();
-
- $time=time();
- $this->assign("questionList",$questionList);
- $this->assign("time",$time);
- return $this->fetch();
- }
-
- }
|