SELECT t1.*,t2.companyname,t3.companyname as our_company FROM `epay_details` AS t1 
INNER JOIN vendordetails AS t2 ON t1.vendorid = t2.id
INNER JOIN company_details AS t3 ON t1.company_id = t3.id WHERE 1   ORDER BY str_to_date(t1.pay_date,'%d-%m-%Y')ASC  LIMIT 0, 10