|
@@ -127,7 +127,7 @@ class CircleArticleRepository
|
|
DB::beginTransaction();
|
|
DB::beginTransaction();
|
|
try {
|
|
try {
|
|
$article->delete();
|
|
$article->delete();
|
|
- $this->interestCircle->decrement('article_count');
|
|
|
|
|
|
+ $this->interestCircle->where('id',$request['circle_id'])->decrement('article_count');
|
|
$isRef = $this->interestCircleArticle->where('post_id', $request['post_id'])->exists();
|
|
$isRef = $this->interestCircleArticle->where('post_id', $request['post_id'])->exists();
|
|
if (!$isRef) {
|
|
if (!$isRef) {
|
|
//移出后需要检测该帖子在其他圈子有没有设为精品,如没有,则删除该帖子的精品标识
|
|
//移出后需要检测该帖子在其他圈子有没有设为精品,如没有,则删除该帖子的精品标识
|
|
@@ -169,7 +169,7 @@ class CircleArticleRepository
|
|
DB::beginTransaction();
|
|
DB::beginTransaction();
|
|
try {
|
|
try {
|
|
$this->interestCircleArticle->insert(['post_id' => $request['post_id'], 'circle_id' => $request['circle_id']]);
|
|
$this->interestCircleArticle->insert(['post_id' => $request['post_id'], 'circle_id' => $request['circle_id']]);
|
|
- $this->interestCircle->increment('article_count');
|
|
|
|
|
|
+ $this->interestCircle->where('id',$request['circle_id'])->increment('article_count');
|
|
//修改帖子为精品贴
|
|
//修改帖子为精品贴
|
|
$this->post->where('id', $request['post_id'])->update(['is_fine' => 1]);
|
|
$this->post->where('id', $request['post_id'])->update(['is_fine' => 1]);
|
|
Redis::HSET('post_info_' . $request['post_id'],'is_fine',1);
|
|
Redis::HSET('post_info_' . $request['post_id'],'is_fine',1);
|