Browse Source

修改b端接口:修改资讯状态

FengR 3 months ago
parent
commit
e2e449b43c
1 changed files with 5 additions and 2 deletions
  1. 5 2
      app/JsonRpc/NewsService.php

+ 5 - 2
app/JsonRpc/NewsService.php

@@ -1104,8 +1104,11 @@ class NewsService implements NewsServiceInterface
 	// 	  'is_ignore' => 1
     //     ];
     //   }
-      DB::table('article_ignore')->where('article_id', $data['id'])->whereIn('website_id',$website_ids)->update(['is_ignore' => 1]);
-    }else{
+      DB::table('article_ignore')->where('article_id', $data['id'])
+      ->when(!empty($website_ids), function ($query) use ($website_ids) {
+        $query->whereIn('website_id', $website_ids);
+      })
+      ->update(['is_ignore' => !empty($website_ids) ? 1 : 0]);
 		// ------c_show_time********up_status*******
 		// 若是审核通过  则更新c_show_time
 		if($data['status'] == 1){