function get_all_activity_by_category(){
$id = $this->input->get('id');
$data['activity_category'] = $this->users_model->single_activity_category($id);
$activity_category = $data['activity_category'];
$data['activities_by_category'] = $this->users_model->list_of_activities($id);
$activities_by_category = $data['activities_by_category'];
foreach($activities_by_category as $activity)
$activity_id = $activity->activity_id;
$data['activity_session'] = $this->users_model->search_sessions_by_activity($activity_id);
$activity_session = $data['activity_session'];
header('Access-Control-Allow-Origin: *');
header('Content-Type: application/json');
return $this->output
->set_content_type('application/json')
->set_status_header(200)
->set_output(json_encode(array('activity_category'=>$activity_category,'activity'=>$activities_by_category,'activity_session'=>$activity_session),JSON_UNESCAPED_SLASHES));
}
Мне нужны результаты в массиве для сеансов и мест проведения, но я получаю пустой массив, я реализовал код для сеансов и мест проведения, но он не работает.