$sql = "SELECT car_model.*,car_body_name,(select count(*)car_list_id from car_list left join tent as tn on car_list.tent_id = tn.tent_id where car_model_id=car_model.car_model_id and tn.tent_verify=1 and car_list.expire_date >= '".date('Y-m-d')."')as total_car FROM car_model left join car_list on car_model.car_model_id = car_list.car_model_id left join car_body on car_body.car_body_id= car_list.car_body_id left join car_brand on car_brand.car_brand_id=car_model.car_brand_id WHERE car_model.car_brand_id = '$brand' $type_id group by car_model_name ORDER BY car_model_name";