1
0
mirror of https://gitee.com/koogua/course-tencent-cloud.git synced 2025-06-24 12:05:39 +08:00

Merge branch 'koogua/hotfix-1.3.4'

This commit is contained in:
koogua 2021-05-15 15:27:01 +08:00
commit c53d14c0c5
2 changed files with 4 additions and 3 deletions

View File

@ -127,14 +127,12 @@ class Article extends Service
$validator = new ArticleValidator(); $validator = new ArticleValidator();
$category = $validator->checkCategory($post['category_id']);
$title = $validator->checkTitle($post['title']); $title = $validator->checkTitle($post['title']);
$article = new ArticleModel(); $article = new ArticleModel();
$article->published = ArticleModel::PUBLISH_APPROVED; $article->published = ArticleModel::PUBLISH_APPROVED;
$article->owner_id = $user->id; $article->owner_id = $user->id;
$article->category_id = $category->id;
$article->title = $title; $article->title = $title;
$article->create(); $article->create();

View File

@ -64,10 +64,13 @@ class ArticleController extends Controller
$this->seo->prependTitle('写文章'); $this->seo->prependTitle('写文章');
$referer = $this->request->getHTTPReferer();
$this->view->pick('article/edit'); $this->view->pick('article/edit');
$this->view->setVar('source_types', $sourceTypes); $this->view->setVar('source_types', $sourceTypes);
$this->view->setVar('article', $article);
$this->view->setVar('xm_tags', $xmTags); $this->view->setVar('xm_tags', $xmTags);
$this->view->setVar('article', $article);
$this->view->setVar('referer', $referer);
} }
/** /**