function getOrderCountDownData(option) { const orderCountDownData = {}; const option_str = "page=" + option.page +"&per_page="+ option.per_page + "&with_fulfillments=true" return Promise.all([fetch('/api/orders.json?'+option_str),fetch('/api/zeelool_unpaid_orders')]).then((res) => { return Promise.all([res[0].json(),res[1].json()]) }).then((data) => { data[0].order_list.orders.forEach((item) => { item.expired_time = data[1] || {}; }); return data[0]; }); } exportFunction('getOrderCountDownData', getOrderCountDownData);