How can i display my store order based on the ‘marketplace_orders’ table custome field

Laraship QuestionsCategory: TechnicalHow can i display my store order based on the ‘marketplace_orders’ table custome field
SANDEEP AGGARWAL asked 3 years ago
Hello laraship team, we need to display store order info based on the marketplace_orders  table Custom field. If  custom field value  0 (zero)  mean hide row value and if 1 means need to display the order value for seller. How i  put where condition (WHERE  status == 1) to check status of custom field here. return user()->storeOrders()->select('marketplace_orders.*')->newQuery(); Let me know any way..... Thank you      
2 Answers
laraship Staff answered 3 years ago
Hello, For performance reasons, we suggest you using a field under the orders table and it will make it more efficient to query, or you can store it under the properties column and use a json query 
SANDEEP AGGARWAL replied 3 years ago

I can’t understand. Please explain the some more points. Our agenda is , If order status zero means don’t show order detail for seller other wise need to show order list in seller dashboard. Thank you for your previous response and again waiting for your response.

laraship Staff replied 3 years ago

Hello,
There is no order status with zero value in Laraship

SANDEEP AGGARWAL replied 3 years ago

Thank you for response. I am saying just example status zero.

return user()->storeOrders()->select(‘marketplace_orders.*’)->newQuery();

We need to add where condition in above query.

We research more and can’t find out how I add where conditions for above query.

Please let me know.

Thank you.

laraship Staff answered 3 years ago
Hello, If you want to add a condition at table query you can add the where to the query in the query function for example return user()->storeOrders()->where('order_status','your-status')->select(‘marketplace_orders.*’)->newQuery();