so I'm adding new key and value to each of my data and I'm creating a table in view with foreach
now I need to sort my data base of new key cut and I have no idea how can I do it because I'm using pagination and I don't have access to data array after pagination
@Tray2 yes I know but it's not a simple calculation , their cuts depends on their roles (6 different role) and what they sold (6 different product) and it needs to be live update , so if I do that I need to update the field on every sell and cut is not the only field that I have , I have separated calculation for each type of product and the sum of them so that's gonna be too many queries at same time and it could cause high loading time
we also have ~ 200 people creatung/editing/deleting selles so it's too many xD
@alirezatig3r You would be amazed over what the database can do, and your need migth be a bit tricky to acheive, but with the proper stored methods and views it shouldn't be impossible.
@Sinnbeck I can't add it on db at all , I need to have cuts base of date , for example I want to see cuts from 01/05 to 01/12 , or another date so I need to calculate cuts of their sells during that time , so if I add it on db I can't have that
I have a list of users , I'm calculating their cuts with a function called cut() , now I want to sort my table base of higher to lower cut not their user id or anything else and paginate the data
@alirezatig3r But you want to sort it by the cut and then paginate right?
If so, then you need to extract every single row from your database, calculate cuts, and then manually paginate them. If you have alot of rows in the database then this will of course be extremly slow and require alot of memory