1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- <?php
- namespace app\portal\controller;
- use think\Db;
- use think\db\Query;
- use cmf\controller\HomeBaseController;
- class PageController extends HomeBaseController{
-
- public function index(){
- $id=$this->request->param('id');
- if(!$id){
- $this->assign("reason",'参数错误');
- $this->display(':error');
- exit;
- }
- $info=Db::name("posts")->field("id,post_title,post_content")->where("id={$id} and post_type=1")->find();
- if(!$info){
- $this->assign("reason",'参数错误');
- $this->display(':error');
- exit;
- }
- $this->assign("info",$info);
- return $this->fetch();
- }
- }
|