if (count($article_ids)) {
                    $query->where("story_id", "NOT IN", $article_ids); 
                }