SQL Query: SELECT i.item_id, i.name, i.i.end_time AS postdate, i.description, i.price,
i.currency, i.category_id, i.closed, i.bold, i.hl, i.is_instant_purchase, i.is_offer,
im.media_url, u.username FROM proads_items i
LEFT JOIN proads_item_media im ON i.item_id=im.item_id AND im.media_type=1 AND im.upload_in_progress=0
LEFT JOIN proads_users u ON u.user_id=i.owner_id
WHERE i.closed=0 AND i.active=1 AND i.approved=1 AND i.deleted=0 AND
i.ad_type=1 AND i.start_time<=1558790555 AND i.end_time<=1558876955
GROUP BY i.item_id ORDER BY i.end_time ASC LIMIT 10