소스 검색

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

FengR 4 달 전
부모
커밋
e2e449b43c
1개의 변경된 파일5개의 추가작업 그리고 2개의 파일을 삭제
  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){