Ändern Sie Ihre Abfrage, entfernen Sie den t2
Alias aus den Join-Anweisungen wie folgt:
if ($this->table == 'tbl_leads') {
$this->db->select ('tbl_leads.*, tbl_users.username as namexx');
$this->db->join("tbl_users", "tbl_users.user_id = JSON_UNQUOTE(JSON_EXTRACT(JSON_KEYS(tbl_leads.permission), '$[0]'))", "LEFT");
}
$query = $this->db->get();