NicolaiFriis Posted June 22, 2020 Share Posted June 22, 2020 Hello. Is there any way to get all orders with a specific status and the status update datetime? Order::getOrderIdsByStatus(5); returns all orders with status "closed" OrderDetail::getList($orders[10]); gives me the details on the orders above, but without a datetime parameter. I only want to get the orders which has been "Closed" within the last hour or so. Any ideas? Link to comment Share on other sites More sharing options...
Razi Posted June 22, 2020 Share Posted June 22, 2020 yes its possible, for this you can use the variable invoice_date $sql = "SELECT * FROM ps_orders WHERE current_state = $state AND invoice_date < $date"; you can also make the condition base on different date variable 1 Link to comment Share on other sites More sharing options...
NicolaiFriis Posted June 22, 2020 Author Share Posted June 22, 2020 Thank you Razi! 1 Link to comment Share on other sites More sharing options...
Razi Posted June 29, 2020 Share Posted June 29, 2020 Thanks You can give a like by clicking on the gray heart below the posts. Link to comment Share on other sites More sharing options...
GoPure Kratom Posted November 3, 2022 Share Posted November 3, 2022 On 6/22/2020 at 7:20 PM, Razi said: yes its possible, for this you can use the variable invoice_date $sql = "SELECT * FROM ps_orders WHERE current_state = $state AND invoice_date < $date"; you can also make the condition base on different date variable Is there a way to do it by just calling a method of Order class/object? I need all orders with a certain status newer than a certain date. I know how to do it in SQL, but I'm trying to figure out if it can be done purely within the code? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now