The query below is returning that 3 results are available, but it is only returning one entry id.
How can I have the three entry_id\'s returned?
$this-&g
Your $this->EE->db->group_by('portfolio_number');
is causing a single row with aggregated data to be returned.
If you want all the ids to be returned as well, you can try adding
$this->EE->db->select('GROUP_CONCAT(entry_id) AS entry_ids', false);
and then splitting the entry_ids
field in PHP:
str_getcsv($submissions);
Edit: I put in the second argument for the select query to prevent backticks being placed around the custom select query.
You can handle it like this
$results = $this->EE->db
->select('entry_id')
->from('submissions')
->where('type_id', '1')
->where('member_group', $member_group)
->group_by('portfolio_number')
->get()
->result_array();
if(count($results)){
return $results
}else {
return false;
}
Can you please replace this code
$this->EE->db->group_by('portfolio_number'); //It will return only one row per portfolio_number
$this->EE->db->group_by('portfolio_number,entry_id'); // It will return one row per portfolio_number and entry_id
I think it will return 3 rows of different entry_id