|
@@ -302,6 +302,9 @@ class PostRepositories
|
|
|
$comment = $this->postComment->create($data);
|
|
|
|
|
|
DB::commit();
|
|
|
+ if(!$comment->parent_id){
|
|
|
+ Redis::DEL('post_new_comment_'.$comment->post_id);
|
|
|
+ }
|
|
|
return jsonSuccess(['id' => $comment->id], '评论成功');
|
|
|
|
|
|
}catch (QueryException $exception){
|
|
@@ -339,6 +342,9 @@ class PostRepositories
|
|
|
$comment->save();
|
|
|
|
|
|
DB::commit();
|
|
|
+ if(!$comment->parent_id){
|
|
|
+ Redis::DEL('post_new_comment_'.$comment->post_id);
|
|
|
+ }
|
|
|
Redis::SADD('delete_post_comment_ids', $comment->id);
|
|
|
return jsonSuccess('删除评论成功');
|
|
|
|