|
@@ -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();
|