소스 검색

评论成功

wzq 5 년 전
부모
커밋
d136cb0ad2
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  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();