瀏覽代碼

Merge branch 'gq' of http://git.9026.com/roobe/miao

Mike 8 年之前
父節點
當前提交
5d820e6b32

+ 1 - 1
server/app/Http/Controllers/Api/V1/IndexController.php

xqd
@@ -178,7 +178,7 @@ class IndexController extends Controller
         $keyword ='%'.$request->keyword.'%';
         $user_infos = UserInfoModel::where('nickname','like',$keyword)->get();
         $dream_infos = DreamInfoModel::where('name','like',$keyword)->
-            orWhere('sign','like',$keyword)->get();
+            orWhere('sign','like',$keyword)->with('img')->get();
         $signs  = BaseSettingsModel::where('category','sign')->where('value','like',$keyword)->get();
         if (empty($request->keyword)) {
 //            历史搜索

+ 6 - 1
server/app/Http/Controllers/Api/V1/MyController.php

xqd xqd
@@ -410,7 +410,7 @@ class MyController extends Controller
     }
 
     /**
-     * @api {get}  /api/dream/search_collection 梦想搜索
+     * @api {get}  /api/my/search_collection 梦想搜索
      * @apiDescription 梦想搜索
      * @apiGroup My
      * @apiPermission none
@@ -456,6 +456,11 @@ class MyController extends Controller
         $data = DreamInfoModel::where('name','like',$keyword)->
         orWhere('sign','like',$keyword)->with('user','imgs')->get();
         $this->insertSearchTable($user->id,$request->keyword);
+        $data = $user->careDreams()->whereHas('careDreams', function ($query) use ($keyword) {
+            $query->  where('name','like',$keyword)->
+            orWhere('sign','like',$keyword)->with('user','imgs');
+        });
+        return $data;
         return $this->api(compact('data'));
     }
 

+ 32 - 0
server/database/migrations/2017_06_29_093642_add_status_to_dream_info.php

xqd
@@ -0,0 +1,32 @@
+<?php
+
+use Illuminate\Support\Facades\Schema;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Database\Migrations\Migration;
+
+class AddStatusToDreamInfo extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::table('dream_info', function (Blueprint $table) {
+            $table->renameColumn('time', 'end_time');
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::table('dream_info', function (Blueprint $table) {
+            //
+        });
+    }
+}

+ 8 - 2
server/database/migrations/2017_06_02_062004_create_comments_info_table.php → server/database/migrations/2017_06_29_095155_create_comment_info_table.php

xqd xqd
@@ -4,7 +4,7 @@ use Illuminate\Support\Facades\Schema;
 use Illuminate\Database\Schema\Blueprint;
 use Illuminate\Database\Migrations\Migration;
 
-class CreateCommentsInfoTable extends Migration
+class CreateCommentInfoTable extends Migration
 {
     /**
      * Run the migrations.
@@ -16,10 +16,16 @@ class CreateCommentsInfoTable extends Migration
         Schema::create('comments_info', function (Blueprint $table) {
             $table->increments('id');
             $table->integer('interaction_id')->comment('梦想动态ID');
-            $table->integer('user_id')->comment('评价用户');
+            $table->integer('user_id')->comment('评价用户id');
+            $table->string('user_avatar')->default('')->comment('评价用户头像');
+            $table->string('user_nickname')->default('')->comment('评价用户昵称');
+            $table->integer('to_user_id')->nullable()->comment('回复用户id');
+            $table->string('to_user_avatar')->default('')->comment('回复用户头像');
+            $table->string('to_user_nickname')->default('')->comment('回复用户昵称');
             $table->tinyInteger('level')->default(0)->comment('评论星级');
             $table->text('content')->comment('评论内容');
             $table->timestamps();
+            $table->date('reply_time')->nullable()->comment('回复时间');
             $table->softDeletes();
         });
     }