Есть 2 таблицы: table1

и table2

Запросом получаю необходимые значения из `table1`:
$data = $this->db->table('table1')->select('name', 'number', 'date', 'txt')->where('imei', '5812375612387218747')->orderBy('date', 'DESC')->get()->toArray();
У взаимосвязанных элементов совпадает `rid`. Помогите модифицировать запрос, чтобы получать не только `'name', 'number', 'date', 'txt'`, но и имена файлов из `table2`