diff --git a/app/Http/Admin/Views/setting/point.volt b/app/Http/Admin/Views/setting/point.volt
index 7dafc75f..1d645873 100644
--- a/app/Http/Admin/Views/setting/point.volt
+++ b/app/Http/Admin/Views/setting/point.volt
@@ -115,6 +115,24 @@
|
|
+
+ 发布问题 |
+
+
+
+ |
+ |
+ |
+
+
+ 回答问题 |
+
+
+
+ |
+ |
+ |
+
diff --git a/app/Http/Home/Controllers/QuestionController.php b/app/Http/Home/Controllers/QuestionController.php
index cc616caf..0ee20625 100644
--- a/app/Http/Home/Controllers/QuestionController.php
+++ b/app/Http/Home/Controllers/QuestionController.php
@@ -65,7 +65,10 @@ class QuestionController extends Controller
$this->seo->prependTitle('提问题');
+ $referer = $this->request->getHTTPReferer();
+
$this->view->pick('question/edit');
+ $this->view->setVar('referer', $referer);
$this->view->setVar('question', $question);
$this->view->setVar('xm_tags', $xmTags);
}
diff --git a/app/Http/Home/Views/macros/point.volt b/app/Http/Home/Views/macros/point.volt
index 51918bf5..19ef5d61 100644
--- a/app/Http/Home/Views/macros/point.volt
+++ b/app/Http/Home/Views/macros/point.volt
@@ -47,6 +47,10 @@
发布评论
{% elseif value == 10 %}
发布文章
+ {% elseif value == 11 %}
+ 发布问题
+ {% elseif value == 12 %}
+ 发布回答
{% endif %}
{%- endmacro %}
@@ -78,5 +82,11 @@
{% elseif type == 10 %}
{% set article_url = url({'for':'home.article.show','id':info.article.id}) %}
{{ info.article.title }}
+ {% elseif type == 11 %}
+ {% set question_url = url({'for':'home.question.show','id':info.question.id}) %}
+ {{ info.question.title }}
+ {% elseif type == 12 %}
+ {% set question_url = url({'for':'home.question.show','id':info.question.id}) %}
+ {{ info.question.title }}
{% endif %}
{%- endmacro %}
\ No newline at end of file
diff --git a/app/Services/Logic/Article/ArticleCreate.php b/app/Services/Logic/Article/ArticleCreate.php
index 616d7857..f382abad 100644
--- a/app/Services/Logic/Article/ArticleCreate.php
+++ b/app/Services/Logic/Article/ArticleCreate.php
@@ -23,6 +23,7 @@ class ArticleCreate extends LogicService
$data = $this->handlePostData($post);
$data['published'] = $this->getPublishStatus($user);
+
$data['owner_id'] = $user->id;
$article->create($data);
diff --git a/app/Services/Logic/Point/History/AnswerPost.php b/app/Services/Logic/Point/History/AnswerPost.php
index 3f4da0e4..6bf957c1 100644
--- a/app/Services/Logic/Point/History/AnswerPost.php
+++ b/app/Services/Logic/Point/History/AnswerPost.php
@@ -58,10 +58,16 @@ class AnswerPost extends PointHistory
$user = $userRepo->findById($answer->owner_id);
+ $answerSummary = kg_substr($answer->summary, 0, 32);
+
$eventInfo = [
'question' => [
'id' => $question->id,
'title' => $question->title,
+ ],
+ 'answer' => [
+ 'id' => $answer->id,
+ 'summary' => $answerSummary,
]
];
diff --git a/app/Services/Logic/Point/History/CommentPost.php b/app/Services/Logic/Point/History/CommentPost.php
index a193485b..827db1e1 100644
--- a/app/Services/Logic/Point/History/CommentPost.php
+++ b/app/Services/Logic/Point/History/CommentPost.php
@@ -53,10 +53,12 @@ class CommentPost extends PointHistory
$user = $userRepo->findById($comment->owner_id);
+ $commentContent = kg_substr($comment->content, 0, 32);
+
$eventInfo = [
'comment' => [
'id' => $comment->id,
- 'content' => $comment->content,
+ 'content' => $commentContent,
]
];
diff --git a/app/Services/Logic/Question/QuestionCreate.php b/app/Services/Logic/Question/QuestionCreate.php
index 96cd6b92..f8f2834a 100644
--- a/app/Services/Logic/Question/QuestionCreate.php
+++ b/app/Services/Logic/Question/QuestionCreate.php
@@ -22,6 +22,8 @@ class QuestionCreate extends LogicService
$data = $this->handlePostData($post);
+ $data['published'] = $this->getPublishStatus($user);
+
$data['owner_id'] = $user->id;
$question->create($data);
@@ -39,7 +41,7 @@ class QuestionCreate extends LogicService
protected function getPublishStatus(UserModel $user)
{
- return $user->question_count > 3 ? QuestionModel::PUBLISH_APPROVED : QuestionModel::PUBLISH_PENDING;
+ return $user->question_count > 100 ? QuestionModel::PUBLISH_APPROVED : QuestionModel::PUBLISH_PENDING;
}
protected function recountUserQuestions(UserModel $user)