select DISTINCT s.id from product_supplier s LEFT JOIN product_photo p ON s.id = p.company_id WHERE s.active = "1" and promotion_date!='0000-00-00' and promotion_date>='2025-04-24' order by rand() limit 8MySQL server has gone away