/** * @todo: 编辑文章 * @author Saki <*****@*****.**> * @date 2014-12-15 下午3:56:16 * @version V1.0 */ public function update() { //类型列表 $type_list = D('Admin/ArticleType')->where('status=1')->order('ctm desc')->select(); $condition['id'] = $id = $_GET['id']; $model = new \Admin\Model\ArticleListModel(); if (isset($_POST['Article'])) { $data = $model->updateArticle($_POST['Article'], $id); echo json_encode($data); } else { $article_info = $model->where($condition)->find(); $this->assign('article_info', $article_info); $this->assign('type_list', $type_list); $this->assign('action', 'update'); $this->display('form'); } }