Blesta Addons Posted November 9, 2017 Report Share Posted November 9, 2017 i want to to get a list of top total clients by credit, and to be very correct in our query wich table we should look at . or any built-in query (function) in a blesta model to achieve this goal ? Quote Link to comment Share on other sites More sharing options...
Tyson Posted November 10, 2017 Report Share Posted November 10, 2017 Look at the `transactions` table. There is no method to fetch a list of the clients with the most credits. You could, however, loop over every client in the system and call Transactions::getCredits(CLIENT_ID, CURRENCY), then sort them to make your own list, but that would be very slow with the number of queries you would have to execute. Michael 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.