skip to Main Content

Javascript – How get total in an array of object

I have this array, and i want to get the sum amount of each Order.item [ {"OrderReceiverId":"6698eea782e24cc9d42eab7f", "Order":{ "CustomerId":"669aa55079cce2e96f9a7e69", "CustomerName":"Erigbemi", "Date":"2024/07/19", "TrackingId":"43035", "Status":"Processing", "Amount":{"$numberInt":"25000"}, "Item":"Orange" } }, {"OrderReceiverId":"6698eea782e24cc9d42eab7f", "Order":{ "CustomerId":"669aa55079cce2e96f96t77", "CustomerName":"James", "Date":"2024/07/19", "TrackingId":"42335", "Status":"Processing", "Amount":{"$numberInt":"15000"}, "Item":"Tomatoes" }, {"OrderReceiverId":"6698eea782e24cc9d42eab7f", "Order":{ "CustomerId":"669aa55079cce2e96f9a7e69",…

VIEW QUESTION

Javascript : Find node value through recursive iteration

I have the following structure : var content = { "id": "RkktMTA1OC0wNTE3QElNQi82NTAwNC9YLzAwSDc", "name": "FI-1058-0517", "category": "FTTH", "place": { "id": "SU1CLzY1MDA0L1gvMDBINw", "href": "/geographicSite/SU1CLzY1MDA0L1gvMDBINw", "name": "IMB/65004/X/00H7", "isSiteInfoAvailable": true, "place": [ { "geographicSubAddress": [ { "internalBuildingReference": "SSS0100000000000198332600", "internalFloorReference": "", "buildingName": "_NA_", "levelNumber": "0",…

VIEW QUESTION

Php versions – Which method to use for Laravel Collection to find a Date between two DateTime

$period = new DatePeriod( new DateTime('2024-03-20 00:00:00'), new DateInterval('P1D'), new DateTime('2024-03-28 23:59:59') ); $suppliersInfo = OrderProduct::whereNotNull('brand') ->whereBetween('updated_at', [$startDate, $endDate ])->get(); $labels = []; foreach ($period as $date){ $labels[] = $date->format('d-m-Y'); $dateToSearch = $date->format('Y-m-d'); $orderCount = $suppliersInfo->where( 'updated_at' , $dateToSearch )…

VIEW QUESTION
Back To Top
Search