From 6254ac94ca1bcdd17d1a7c6e4bfc8028bdaa4c15 Mon Sep 17 00:00:00 2001 From: koogua Date: Sun, 16 May 2021 19:19:20 +0800 Subject: [PATCH 1/4] =?UTF-8?q?v1.3.5=E9=98=B6=E6=AE=B5=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Admin/Views/setting/point.volt | 27 +++ app/Http/Home/Views/macros/point.volt | 15 ++ app/Http/Home/Views/question/answers.volt | 4 +- app/Models/AnswerLike.php | 19 ++ app/Models/ArticleFavorite.php | 19 ++ app/Models/ArticleLike.php | 19 ++ app/Models/ChapterLike.php | 19 ++ app/Models/CommentLike.php | 19 ++ app/Models/ConsultLike.php | 19 ++ app/Models/CourseFavorite.php | 19 ++ app/Models/PointHistory.php | 8 +- app/Models/QuestionFavorite.php | 19 ++ app/Models/QuestionLike.php | 19 ++ app/Models/ReviewLike.php | 19 ++ app/Services/Logic/Answer/AnswerCreate.php | 16 +- app/Services/Logic/Answer/AnswerDelete.php | 8 - app/Services/Logic/Answer/AnswerLike.php | 43 +++- app/Services/Logic/Answer/AnswerUpdate.php | 9 - app/Services/Logic/Answer/CommentList.php | 4 +- app/Services/Logic/Article/ArticleCreate.php | 14 ++ .../Logic/Article/ArticleFavorite.php | 28 ++- app/Services/Logic/Article/ArticleInfo.php | 10 +- app/Services/Logic/Article/ArticleLike.php | 45 +++- app/Services/Logic/Article/CommentList.php | 4 +- app/Services/Logic/Chapter/ChapterInfo.php | 2 +- app/Services/Logic/Chapter/ChapterLike.php | 19 +- app/Services/Logic/Chapter/CommentList.php | 4 +- .../Logic/Comment/AfterCreateTrait.php | 75 ++++++ app/Services/Logic/Comment/CommentCreate.php | 53 +---- app/Services/Logic/Comment/CommentDelete.php | 2 +- app/Services/Logic/Comment/CommentLike.php | 32 ++- app/Services/Logic/Comment/CommentList.php | 2 +- app/Services/Logic/Comment/CommentReply.php | 41 +--- .../{CommentCountTrait.php => CountTrait.php} | 93 ++++---- .../{CommentListTrait.php => ListTrait.php} | 11 +- app/Services/Logic/Comment/ReplyList.php | 6 +- app/Services/Logic/Consult/ConsultLike.php | 30 ++- app/Services/Logic/Course/CourseFavorite.php | 15 +- app/Services/Logic/Course/CourseInfo.php | 2 +- .../Logic/Notice/System/AnswerCommented.php | 43 ++++ .../Logic/Notice/System/ArticleCommented.php | 21 +- .../Logic/Notice/System/QuestionCommented.php | 31 +++ .../Logic/Point/History/AnswerAccepted.php | 1 + .../Logic/Point/History/AnswerLiked.php | 1 + .../Logic/Point/History/AnswerPost.php | 1 + .../Logic/Point/History/ArticleLiked.php | 81 +++++++ .../Logic/Point/History/ArticlePost.php | 1 + .../Logic/Point/History/ChapterStudy.php | 1 + .../Logic/Point/History/CommentPost.php | 1 + .../Logic/Point/History/CourseReview.php | 1 + .../Logic/Point/History/QuestionLiked.php | 81 +++++++ .../Logic/Point/History/QuestionPost.php | 1 + app/Services/Logic/Question/AnswerList.php | 9 +- app/Services/Logic/Question/CommentList.php | 4 +- .../Logic/Question/QuestionFavorite.php | 28 ++- app/Services/Logic/Question/QuestionInfo.php | 4 +- app/Services/Logic/Question/QuestionLike.php | 43 +++- app/Services/Logic/Review/ReviewLike.php | 26 +- app/Services/Logic/User/ArticleList.php | 2 +- app/Validators/Comment.php | 25 +- db/migrations/20210515063211.php | 224 ++++++++++++++++++ 61 files changed, 1162 insertions(+), 280 deletions(-) create mode 100644 app/Services/Logic/Comment/AfterCreateTrait.php rename app/Services/Logic/Comment/{CommentCountTrait.php => CountTrait.php} (55%) rename app/Services/Logic/Comment/{CommentListTrait.php => ListTrait.php} (85%) create mode 100644 app/Services/Logic/Notice/System/AnswerCommented.php create mode 100644 app/Services/Logic/Notice/System/QuestionCommented.php create mode 100644 app/Services/Logic/Point/History/ArticleLiked.php create mode 100644 app/Services/Logic/Point/History/QuestionLiked.php create mode 100644 db/migrations/20210515063211.php diff --git a/app/Http/Admin/Views/setting/point.volt b/app/Http/Admin/Views/setting/point.volt index 1d645873..51393168 100644 --- a/app/Http/Admin/Views/setting/point.volt +++ b/app/Http/Admin/Views/setting/point.volt @@ -133,6 +133,33 @@ + + 文章被赞 + + + + + + + + + 问题被赞 + + + + + + + + + 回答被赞 + + + + + + +
diff --git a/app/Http/Home/Views/macros/point.volt b/app/Http/Home/Views/macros/point.volt index 19ef5d61..efa3d1ac 100644 --- a/app/Http/Home/Views/macros/point.volt +++ b/app/Http/Home/Views/macros/point.volt @@ -51,6 +51,12 @@ 发布问题 {% elseif value == 12 %} 发布回答 + {% elseif value == 13 %} + 文章被赞 + {% elseif value == 14 %} + 提问被赞 + {% elseif value == 15 %} + 回答被赞 {% endif %} {%- endmacro %} @@ -86,7 +92,16 @@ {% 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 }}

+ {% elseif type == 13 %} + {% set article_url = url({'for':'home.article.show','id':info.article.id}) %} +

{{ info.article.title }}

+ {% elseif type == 14 %} {% set question_url = url({'for':'home.question.show','id':info.question.id}) %}

{{ info.question.title }}

+ {% elseif type == 15 %} + {% 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/Http/Home/Views/question/answers.volt b/app/Http/Home/Views/question/answers.volt index 11951277..50f320a7 100644 --- a/app/Http/Home/Views/question/answers.volt +++ b/app/Http/Home/Views/question/answers.volt @@ -12,7 +12,9 @@ {{ item.owner.name }} - {{ item.owner.name }} + + {{ item.owner.name }} +
{{ item.content }}