'{$limit_time}' "; } $sql = "select a.run_id, min(a.start_time) as start_time FROM run_station a, run_station b, run_main c, opera_product d WHERE a.run_id = b.run_id AND a.run_id = c.run_id AND a.PROD_ID = d.prod_id AND a.area_id = " . $start_area . " AND b.area_id = " . $end_area . " AND c.run_date = '" . $time . "' {$run_time_sql} AND c.RUN_STATUS=138 AND a.station_inout_type in (108,109) and b.station_inout_type in (109,110) AND d.bus_type IN (" . $bus_type . ") GROUP BY run_id"; $result = $pdo->query($sql); $run_time = $result->fetchAll(PDO::FETCH_ASSOC); if(count($run_time) > 0){ $code = 0; $info = $CODE[0]; $list = $run_time; }else{ $code = 0; $info = $CODE[7]; $list = ""; } $json = array(); $json['code'] = $code; $json['info'] = $info; $json['list'] = $list; //print_r($json); echo json_encode($json); ?>