Ver código fonte

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

FengR 3 meses atrás
pai
commit
e2e449b43c
1 arquivos alterados com 5 adições e 2 exclusões
  1. 5 2
      app/JsonRpc/NewsService.php

+ 5 - 2
app/JsonRpc/NewsService.php

@@ -1104,8 +1104,11 @@ class NewsService implements NewsServiceInterface
 	// 	  'is_ignore' => 1
 	// 	  '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********up_status*******
 		// 若是审核通过  则更新c_show_time
 		// 若是审核通过  则更新c_show_time
 		if($data['status'] == 1){
 		if($data['status'] == 1){