query($sql_search); if( $result == false ) { echo "refresh success";exit(); } $list = $result->fetchAll(); $run_start_array = array(); $run_stop_array = array(); foreach( $list as $run_info ) { if( $run_info["saled_count"] > 0 ) { $run_start_array[] = $run_info["run_id"]; } else { $run_stop_array[] = $run_info["run_id"]; } } $update_sql = " UPDATE run_main SET run_status=139 WHERE run_id IN (".implode(",", $run_start_array).") AND run_status=138 "; $pdo->exec($update_sql); $update_sql2 = " UPDATE run_bus SET run_bus_status=139 WHERE run_id IN (".implode(",", $run_start_array).") AND run_bus_status=138 "; $pdo->exec($update_sql2); /* $update_sql3 = " UPDATE run_main SET run_status=142 WHERE run_id IN (".implode(",", $run_stop_array).") AND run_status=138 "; $pdo->exec($update_sql3); $update_sql4 = " UPDATE run_bus SET run_bus_status=142 WHERE run_id IN (".implode(",", $run_stop_array).") AND run_bus_status=138 "; $pdo->exec($update_sql4); */ /* //取得所有有效车信息 $sql1=" CALL SP_REFRESH_RUN_BUS_STATUS()"; $result=$pdo->query($sql1); if( $result == false ) { echo "refresh failed"; } else { echo "refresh success"; } $result->closeCursor(); */ /* $pdo3=conn3(); //取得所有有效车信息 $sql1=" CALL SP_REFRESH_RUN_BUS_STATUS()"; $result=$pdo3->query($sql1); if( $result == false ) { echo "refresh failed"; } else { echo "refresh success"; } $result->closeCursor(); */ echo "refresh success"; exit();