Good day!
From the table you need to get a list of fields: name , number and date , sorting by date, so that records with the most recent date go in descending order from top / down. But at the same time, it is necessary to exclude the repetition of records with the same name and number fields, and there will be a lot of similar ones.
Help to complete the query:
$info = $this->db->table('table')->select('name', 'number', 'date')->where('hash', $hash)->orderBy('created_at', 'DESC')->distinct()->get()->toArray(); This request excludes repetitions of the same name and number , but also incorrectly sorts by the created_at field ...