LiamC

I almost need to make my get say only get the people that have all of the answers not if they have 1

LiamC

that bottom person is not a winner. They got 1 right answer not 2 :@

LiamC
  1. $Winners = CustomEntryRecord::get()->filterAny(array('CustomDrawID' => $this->ID, 'Entries.ID' => $win_array_data));
LiamC

Hi all, I have a winners ID array, I am getting 5 entries to check whos won. 4 of those are winners because they have IDs 1 & 2. The one person thats not a winner has IDs 3 and 4. I only want to retrieve the winners who have or consist of 1,2,3 but my filterAny() and filter() is picking up the person who is 3 , 4 when they has 1 wrong answer.? 😕

LiamC

This is of course dynamic so it could be 25 fixtures with 10 winners. Or 11 winners. But we only want and need 10

LiamC

Hmm strange, maybe I could use filter any or partial match? I have an array of 3 IDs (winning numbers) but the dataobject I am getting only needs to have 2 of the 3 items in array. So it might not be working because its trying to find an entry with the 3 winning numbers not 2/3?

LiamC

$win_array_data would have a list of IDs?

Joe

@LiamC does this not already work? I could’ve sworn I’ve done this before.

LiamC

$Winners = CustomEntryRecord::get()->filter(array('CustomDrawID' => $this->ID, 'Entries.ID' => $win_array_data));