Your code looks like it actually has a further problem that you're only fetching the first order for a given user. Rather than eager loading (which is basically creating joins so that the relevant data is fetched in one go), why not use a hash map to look up each customer's set of orders? So, outside your users loop, create a separate query to fetch all ...
Allright, after digging & debugging a bit further into this issue I found it out myself!
'expiryDate' => Template::raw('<a href='.$entry->cpEditUrl.'>'.$entry->title.'</a>')
PS: don't forget to add this to the top of your php file: