Переглянути джерело

Merge branch 'develop' of http://git.caihongxingqiu.net/rainbow/community-manage into durong

durong 5 роки тому
батько
коміт
e24030f093

+ 1 - 0
app/Http/Controllers/Post/PostController.php

@@ -142,6 +142,7 @@ class PostController extends Controller
             ],
             'columns' => [
                 'id',
+                'post_id',
                 'parent_id',
                 'uid',
                 'content',

+ 2 - 2
app/Repositories/Post/PostRepository.php

@@ -268,7 +268,7 @@ class PostRepository
             $data['parent_id'] = $request['parent_id'];
             $data['reply_uid'] = $comment->uid;
             $data['reply_username'] = $comment->username;
-            $this->rabbitMqUtil->push('add_message_one', [
+            $this->rabbitMqUtil->push('add_message', [
                 'uid' => $comment->uid,
                 'message_show_type' => 'post_reply_main',
                 'param' => [
@@ -277,7 +277,7 @@ class PostRepository
                 ]
             ]);
         }else{
-            $this->rabbitMqUtil->push('add_message_one', [
+            $this->rabbitMqUtil->push('add_message', [
                 'uid' => $post->uid,
                 'message_show_type' => 'post_comment',
                 'param' => [

+ 1 - 0
app/Transformers/Post/CommentTransformer.php

@@ -24,6 +24,7 @@ class CommentTransformer extends TransformerAbstract
         }
         return [
             'id' => $postComment['id'],
+            'post_id' => $postComment['post_id'],
             'parent_id' => $postComment['parent_id'],
             'uid' => $postComment['uid'],
             'username' => $postComment['username'],

+ 38 - 0
database/migrations/2019_06_14_192326_create_table_collect.php

@@ -0,0 +1,38 @@
+<?php
+
+use Illuminate\Support\Facades\Schema;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Database\Migrations\Migration;
+
+class CreateTableCollect extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::create('post_collect', function (Blueprint $table) {
+            $table->bigIncrements('id');
+            $table->integer('uid')
+                ->index('uid')
+                ->comment('用户ID');
+
+            $table->integer('post_id')
+                ->default(0)
+                ->comment('帖子id');
+            $table->timestamps();
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::dropIfExists('post_collect');
+    }
+}

+ 38 - 0
database/migrations/2019_06_14_192526_create_table_post_like.php

@@ -0,0 +1,38 @@
+<?php
+
+use Illuminate\Support\Facades\Schema;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Database\Migrations\Migration;
+
+class CreateTablePostLike extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::create('post_like', function (Blueprint $table) {
+            $table->bigIncrements('id');
+            $table->integer('uid')
+                ->index('uid')
+                ->comment('用户ID');
+
+            $table->integer('post_id')
+                ->default(0)
+                ->comment('帖子id');
+            $table->timestamps();
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::dropIfExists('post_like');
+    }
+}