2015-10-06 20:25:13 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
/**
|
2017-02-03 12:32:57 +08:00
|
|
|
* @Author: Zhou Yuyang <1009465756@qq.com> 10:28 2017/02/02
|
2016-12-03 21:42:04 +08:00
|
|
|
* @Copyright 2015-2020 SISMO
|
|
|
|
|
* @Project homepage https://github.com/CNSISMO
|
2017-02-03 12:32:57 +08:00
|
|
|
* @Version 2.0
|
2015-10-06 20:25:13 +08:00
|
|
|
*/
|
2017-02-03 12:32:57 +08:00
|
|
|
|
2015-10-06 20:25:13 +08:00
|
|
|
namespace Home\Controller;
|
|
|
|
|
|
|
|
|
|
use Think\Controller;
|
|
|
|
|
|
|
|
|
|
class BlogController extends Controller{
|
|
|
|
|
|
2016-12-03 21:42:04 +08:00
|
|
|
public function index()
|
2015-10-06 20:25:13 +08:00
|
|
|
{
|
2016-12-03 21:42:04 +08:00
|
|
|
$model = M('blog');
|
2016-01-24 11:54:16 +08:00
|
|
|
$tmodel= M('setting');
|
2016-12-03 21:42:04 +08:00
|
|
|
$pages = $model->limit(15)->select();
|
2016-01-24 11:54:16 +08:00
|
|
|
$title = $tmodel->where('id=1')->select();
|
|
|
|
|
$this->assign('title', $title);
|
2015-10-06 20:25:13 +08:00
|
|
|
$this->assign('model', $pages);
|
|
|
|
|
$this->display();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public function view(){
|
2016-12-03 21:42:04 +08:00
|
|
|
$id = I('get.id',0,'number_int');
|
2017-02-03 12:32:57 +08:00
|
|
|
$model = M('blog')->where(array('id'=>$id))->find();
|
2016-01-24 11:54:16 +08:00
|
|
|
$tmodel= M('setting');
|
|
|
|
|
$title = $tmodel->where('id=1')->select();
|
|
|
|
|
$this->assign('title', $title);
|
2015-10-06 20:25:13 +08:00
|
|
|
$this->assign('model',$model);
|
|
|
|
|
$this->display();
|
|
|
|
|
}
|
|
|
|
|
}
|