use $wpdb filterting for dates comparision and zip code matching to improve speed of that code

Job ID: 31577709

Budget: $30 – $250 USD

the small function that already exists, it is to calculate the appointment form 6 months ago.( I will provide it to you )
1. After the pickup is completed today, the order status is changed to completed, the completed order, and the total amount.
2. The pick-up was completed yesterday, and the order status was changed to completed, the total amount of the completed order.

//i want that code to use $wpdb filterting for dates comparision and zip code matching to improve speed of that code
//By grabbing the time of the system, it is automatically defined. The first six appointments of time are achieved without manual setting

My budget is 30~50 dollars
Related categories: PHP SQL WooCommerce