wzq %!s(int64=5) %!d(string=hai) anos
pai
achega
d136cb0ad2
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      app/Repositories/PostRepositories.php

+ 2 - 2
app/Repositories/PostRepositories.php

@@ -260,12 +260,12 @@ class PostRepositories
 
         DB::beginTransaction();
         try{
-            $this->postComment->create($data);
+            $comment = $this->postComment->create($data);
             $post->data->comment_count += 1;
             $post->data->save();
 
             DB::commit();
-            return jsonSuccess();
+            return jsonSuccess(['id' => $comment->id], '评论成功');
 
         }catch (QueryException $exception){
             DB::rollBack();