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

View File

@@ -15,6 +15,7 @@ namespace app\common\model;
class Document extends \think\model\Merge{ class Document extends \think\model\Merge{
protected $fk = 'doc_id'; protected $fk = 'doc_id';
//protected static $relationModel = array('document_article');
// 定义需要自动写入时间戳格式的字段 // 定义需要自动写入时间戳格式的字段
protected $autoWriteTimestamp = array('create_time','update_time','deadline'); protected $autoWriteTimestamp = array('create_time','update_time','deadline');
@@ -78,7 +79,7 @@ class Document extends \think\model\Merge{
public function change(){ public function change(){
/* 获取数据对象 */ /* 获取数据对象 */
$data = input('post.'); $data = \think\Request::instance()->post();
if ($data !== false) { if ($data !== false) {
/* 添加或新增基础内容 */ /* 添加或新增基础内容 */

View File

@@ -13,7 +13,7 @@ use app\common\controller\Fornt;
class Content extends Fornt { class Content extends Fornt {
protected $beforeActionList = array( protected $beforeActionList = array(
'setModel' => array('except' => 'category') 'setModel' => array('except' => 'category'),
); );
//模块频道首页 //模块频道首页
@@ -35,7 +35,7 @@ class Content extends Fornt{
$data = array( $data = array(
'category' => $cate, 'category' => $cate,
'child_cate' => $ids 'child_cate' => $ids,
); );
if ($cate['template_index']) { if ($cate['template_index']) {
$teamplate = 'content/' . $this->modelInfo['name'] . '/' . $cate['template_index']; $teamplate = 'content/' . $this->modelInfo['name'] . '/' . $cate['template_index'];
@@ -70,13 +70,13 @@ class Content extends Fornt{
} else { } else {
$order = "is_top desc,id desc"; $order = "is_top desc,id desc";
} }
$model = $this->model;
$list = $this->model->where($map)->order($order)->paginate(15); $list = $model->where($map)->order($order)->paginate(15);
$data = array( $data = array(
'list' => $list, 'list' => $list,
'cate' => $cate, 'cate' => $cate,
'page' => $list->render() 'page' => $list->render(),
); );
if ($cate['template_lists']) { if ($cate['template_lists']) {
@@ -98,7 +98,7 @@ class Content extends Fornt{
$category = get_category_child($id); $category = get_category_child($id);
$map = array( $map = array(
'category_id' => array('IN', $category) 'category_id' => array('IN', $category),
); );
$order = "id desc"; $order = "id desc";
@@ -107,7 +107,7 @@ class Content extends Fornt{
$data = array( $data = array(
'list' => $list, 'list' => $list,
'cate' => $cate, 'cate' => $cate,
'page' => $list->render() 'page' => $list->render(),
); );
if ($cate['template_lists']) { if ($cate['template_lists']) {
$teamplate = 'content/' . $cate['template_lists']; $teamplate = 'content/' . $cate['template_lists'];
@@ -135,7 +135,7 @@ class Content extends Fornt{
} }
$data = array( $data = array(
'info' => $info 'info' => $info,
); );
if (isset($info['template_detail']) && $info['template_detail']) { if (isset($info['template_detail']) && $info['template_detail']) {
$teamplate = 'content/' . $this->modelInfo['name'] . '/' . $info['template_detail']; $teamplate = 'content/' . $this->modelInfo['name'] . '/' . $info['template_detail'];