This commit is contained in:
2016-08-05 18:07:36 +08:00
parent 2e17228a32
commit 9f5c4070cc
2 changed files with 57 additions and 56 deletions
+2 -1
View File
@@ -15,6 +15,7 @@ namespace app\common\model;
class Document extends \think\model\Merge{
protected $fk = 'doc_id';
//protected static $relationModel = array('document_article');
// 定义需要自动写入时间戳格式的字段
protected $autoWriteTimestamp = array('create_time','update_time','deadline');
@@ -78,7 +79,7 @@ class Document extends \think\model\Merge{
public function change(){
/* 获取数据对象 */
$data = input('post.');
$data = \think\Request::instance()->post();
if ($data !== false) {
/* 添加或新增基础内容 */
+8 -8
View File
@@ -13,7 +13,7 @@ use app\common\controller\Fornt;
class Content extends Fornt {
protected $beforeActionList = array(
'setModel' => array('except' => 'category')
'setModel' => array('except' => 'category'),
);
//模块频道首页
@@ -35,7 +35,7 @@ class Content extends Fornt{
$data = array(
'category' => $cate,
'child_cate' => $ids
'child_cate' => $ids,
);
if ($cate['template_index']) {
$teamplate = 'content/' . $this->modelInfo['name'] . '/' . $cate['template_index'];
@@ -70,13 +70,13 @@ class Content extends Fornt{
} else {
$order = "is_top desc,id desc";
}
$list = $this->model->where($map)->order($order)->paginate(15);
$model = $this->model;
$list = $model->where($map)->order($order)->paginate(15);
$data = array(
'list' => $list,
'cate' => $cate,
'page' => $list->render()
'page' => $list->render(),
);
if ($cate['template_lists']) {
@@ -98,7 +98,7 @@ class Content extends Fornt{
$category = get_category_child($id);
$map = array(
'category_id' => array('IN', $category)
'category_id' => array('IN', $category),
);
$order = "id desc";
@@ -107,7 +107,7 @@ class Content extends Fornt{
$data = array(
'list' => $list,
'cate' => $cate,
'page' => $list->render()
'page' => $list->render(),
);
if ($cate['template_lists']) {
$teamplate = 'content/' . $cate['template_lists'];
@@ -135,7 +135,7 @@ class Content extends Fornt{
}
$data = array(
'info' => $info
'info' => $info,
);
if (isset($info['template_detail']) && $info['template_detail']) {
$teamplate = 'content/' . $this->modelInfo['name'] . '/' . $info['template_detail'];