This should actually be:

    $this->db->order_by($this->input->get('order-'.$stream->stream_slug), $this->input->get('sort-'.$stream->stream_slug) ? $this->input->get('sort-'.$this->input->get('order-'.$stream->stream_slug)) : 'ASC');