当前位置:首页>python>Python应用案例|获取城市天气并制作图表

Python应用案例|获取城市天气并制作图表

  • 2026-02-05 19:36:24
Python应用案例|获取城市天气并制作图表
图1. 查询城市天气页面
图2. 气象数据绘图页面
代码如下:
import requestsimport matplotlib.pyplot as pltfrom datetime import datetimeimport matplotlib.font_manager as fmimport sysimport time# ==================== 配置区域 ====================# 如果图表中文显示异常,请尝试指定系统中文字体路径(可选)# 例如Windows: r'C:\Windows\Fonts\msyh.ttc'CHINESE_FONT_PATH = None  # 备用API配置(主API wttr.in 失效时自动切换)USE_BACKUP_API = TrueBACKUP_API_URL = "http://t.weather.itboy.net/api/weather/city/"# 常用城市代码映射(可自行添加)CITY_CODE_MAP = {    '北京''101010100',    '上海''101020100',    '广州''101280101',    '深圳''101280601',    '杭州''101210101',    '南京''101190101',    '武汉''101200101',    '成都''101270101',    '济南''101120101',    '青岛''101120201',    # 更多城市代码可从 https://github.com/qwd/LocationList 获取}# =================================================class WeatherDashboard:    def __init__(self):        """初始化天气仪表板"""        # 主API(wttr.in - 国际)        self.main_api = {            'url'"https://wttr.in",            'params': {'format''j1''lang''zh'}        }        # 备用API(国内源,速度更快但需要城市代码)        self.backup_api = {            'url'"http://t.weather.itboy.net/api/weather/city/",            'city_map': CITY_CODE_MAP        }        # 初始化图表中文字体        self._setup_chinese_font()        # 请求配置        self.timeout = 15        self.max_retries = 2    def _setup_chinese_font(self):        """设置中文字体,解决乱码问题"""        if CHINESE_FONT_PATH:            try:                font_prop = fm.FontProperties(fname=CHINESE_FONT_PATH)                plt.rcParams['font.sans-serif'] = [font_prop.get_name()]            except:                print(f"警告: 无法加载指定字体 {CHINESE_FONT_PATH},使用系统默认字体")        # 设置备用字体方案        font_options = ['SimHei''Microsoft YaHei''DejaVu Sans''Arial Unicode MS''sans-serif']        current_fonts = plt.rcParams.get('font.sans-serif', [])        for font in font_options:            if font not in current_fonts:                current_fonts = [font] + current_fonts        plt.rcParams['font.sans-serif'] = current_fonts        plt.rcParams['axes.unicode_minus'] = False    def get_weather_with_retry(self, city):        """获取天气数据(带重试和备用API)"""        # 先尝试主API        print(f"正在通过主API查询 {city} 的天气...")        data = self._try_main_api(city)        # 如果主API失败且启用备用API,尝试备用API        if not data and USE_BACKUP_API:            print("主API查询失败,尝试备用API...")            data = self._try_backup_api(city)        return data    def _try_main_api(self, city):        """尝试主API(wttr.in)"""        for attempt in range(self.max_retries):            try:                url = f"{self.main_api['url']}/{requests.utils.quote(city)}"                response = requests.get(                    url,                     params=self.main_api['params'],                    timeout=self.timeout,                    headers={'User-Agent''Mozilla/5.0'}  # 模拟浏览器                )                response.raise_for_status()                return response.json()            except requests.exceptions.Timeout:                print(f"  主API超时 ({attempt+1}/{self.max_retries}),重试...")                time.sleep(1)  # 等待1秒后重试            except Exception as e:                print(f"  主API错误: {e}")                break        return None    def _try_backup_api(self, city):        """尝试备用API(国内源)"""        # 查找城市代码        city_code = None        for name, code in self.backup_api['city_map'].items():            if city in name or name in city:                city_code = code                break        if not city_code:            print(f"  备用API未找到城市 {city} 的代码")            # 尝试直接使用名称(部分API支持)            city_code = city        try:            url = f"{self.backup_api['url']}{city_code}"            response = requests.get(url, timeout=self.timeout)            response.raise_for_status()            data = response.json()            # 转换备用API数据格式以匹配主程序            return self._convert_backup_data(data, city)        except Exception as e:            print(f"  备用API错误: {e}")            return None    def _convert_backup_data(self, data, city):        """转换备用API数据格式"""        if data.get('status') != 200:            return None        # 构建与wttr.in相似的数据结构        city_data = data.get('cityInfo', {})        weather_data = data.get('data', {})        converted = {            'current_condition': [{                'temp_C': weather_data.get('wendu''N/A'),                'temp_F'str(int(float(weather_data.get('wendu'0)) * 9/5 + 32)),                'FeelsLikeC': weather_data.get('wendu''N/A'),                'humidity': weather_data.get('shidu''N/A').strip('%'if weather_data.get('shidu'else 'N/A',                'lang_zh': [{'value': weather_data.get('forecast', [{}])[0].get('type''未知')}],                'windspeedKmph': weather_data.get('forecast', [{}])[0].get('fl''N/A').replace('级'''),                'winddir16Point': weather_data.get('forecast', [{}])[0].get('fx''N/A'),                'pressure''1013',                'visibility''10',                'cloudcover''0'            }],            'nearest_area': [{                'areaName': [{'value': city_data.get('city', city)}],                'region': [{'value': city_data.get('parent''')}],                'country': [{'value''中国'}]            }],            'weather': [{                'astronomy': [{                    'sunrise': weather_data.get('forecast', [{}])[0].get('sunrise''06:00'),                    'sunset': weather_data.get('forecast', [{}])[0].get('sunset''18:00')                }],                'hourly'self._create_hourly_forecast(weather_data.get('forecast', []))            }],            'source''backup_api'        }        return converted    def _create_hourly_forecast(self, forecast):        """创建小时预报数据"""        hourly = []        if forecast and len(forecast) > 0:            today = forecast[0]            times = ['08:00''12:00''16:00''20:00']            for i, time_str in enumerate(times):                hourly.append({                    'time': time_str.replace(':00'''),                    'tempC'str(int(today.get('high''20').replace('℃''')) - i*2),                    'lang_zh': [{'value': today.get('type''晴')}],                    'chanceofrain''0'                })        return hourly[:4]    def parse_weather_data(self, data):        """解析天气数据"""        if not data:            return NoneNone        # 检查数据来源        source = data.get('source''main_api')        if source == 'backup_api':            current = data['current_condition'][0]            area = data['nearest_area'][0]            weather_info = {                'city': area['areaName'][0]['value'],                'region': area['region'][0]['value'],                'country': area['country'][0]['value'],                'temp_c': current['temp_C'],                'temp_f': current['temp_F'],                'feelslike_c': current['FeelsLikeC'],                'humidity': current['humidity'],                'weather_desc': current['lang_zh'][0]['value'],                'wind_speed': current['windspeedKmph'],                'wind_dir': current['winddir16Point'],                'pressure': current['pressure'],                'visibility': current['visibility'],                'cloud_cover': current['cloudcover'],                'sunrise': data['weather'][0]['astronomy'][0]['sunrise'],                'sunset': data['weather'][0]['astronomy'][0]['sunset'],                'source''备用API'            }            hourly_forecast = data['weather'][0]['hourly']        else:            # 原始wttr.in数据解析            current = data['current_condition'][0]            area = data['nearest_area'][0]            weather_info = {                'city': area['areaName'][0]['value'],                'region': area['region'][0]['value'],                'country': area['country'][0]['value'],                'temp_c': current['temp_C'],                'temp_f': current['temp_F'],                'feelslike_c': current['FeelsLikeC'],                'humidity': current['humidity'],                'weather_desc': current['lang_zh'][0]['value'],                'wind_speed': current['windspeedKmph'],                'wind_dir': current['winddir16Point'],                'pressure': current['pressure'],                'visibility': current['visibility'],                'cloud_cover': current['cloudcover'],                'sunrise': data['weather'][0]['astronomy'][0]['sunrise'],                'sunset': data['weather'][0]['astronomy'][0]['sunset'],                'source''主API'            }            # 获取未来几小时预报            hourly_forecast = []            for hour in data['weather'][0]['hourly'][:4]:                hourly_forecast.append({                    'time': hour['time'],                    'temp': hour['tempC'],                    'weather': hour['lang_zh'][0]['value'],                    'chance_of_rain': hour.get('chanceofrain''0')                })        return weather_info, hourly_forecast    def create_weather_chart(self, weather_info, hourly_forecast):        """创建气象图表"""        if not weather_info:            print("无有效天气数据,无法生成图表")            return        # 创建图表        fig = plt.figure(figsize=(1510))        fig.suptitle(            f'{weather_info["city"]}天气状况 - 数据来源: {weather_info.get("source""主API")}\n'            f'{datetime.now().strftime("%Y-%m-%d %H:%M")}',            fontsize=16, fontweight='bold', y=0.98        )        # 1. 主信息面板        ax1 = plt.subplot(221)        ax1.axis('off')        # 天气图标映射        weather_icons = {            '晴''☀️''多云''⛅''阴''☁️''雨''🌧️',            '雪''❄️''雷''⛈️''雾''🌫️''风''💨',            '小雨''🌦️''中雨''🌧️''大雨''⛈️'        }        current_weather = weather_info['weather_desc']        icon = '☀️'        for key in weather_icons:            if key in current_weather:                icon = weather_icons[key]                break        info_text = (            f"{icon}{current_weather}\n\n"            f"🌡️ 温度: {weather_info['temp_c']}°C (体感{weather_info['feelslike_c']}°C)\n"            f"💨 风力: {weather_info['wind_speed']} km/h {weather_info['wind_dir']}\n"            f"💧 湿度: {weather_info['humidity']}%\n"            f"📊 气压: {weather_info['pressure']} hPa\n"            f"👁️ 能见度: {weather_info['visibility']} km\n"            f"☁️ 云量: {weather_info['cloud_cover']}%\n"            f"🌅 日出: {weather_info['sunrise']} | 🌇 日落: {weather_info['sunset']}\n"            f"📍 {weather_info['city']}{weather_info['region']}{weather_info['country']}"        )        ax1.text(0.10.95, info_text, fontsize=12, verticalalignment='top',                bbox=dict(boxstyle="round,pad=0.8", facecolor="lightblue", alpha=0.7))        # 2. 温度计图        ax2 = plt.subplot(222)        temp_c = float(weather_info['temp_c']) if weather_info['temp_c'] != 'N/A' else 20        feelslike_c = float(weather_info['feelslike_c']) if weather_info['feelslike_c'] != 'N/A' else temp_c        categories = ['实际温度''体感温度']        values = [temp_c, feelslike_c]        # 根据温度选择颜色        if temp_c > 30:            colors = ['#FF4500''#FF8C00']  # 炎热        elif temp_c > 20:            colors = ['#FFD700''#FFA500']  # 温暖        elif temp_c > 10:            colors = ['#90EE90''#32CD32']  # 凉爽        else:            colors = ['#87CEEB''#1E90FF']  # 寒冷        bars = ax2.bar(categories, values, color=colors, edgecolor='black', alpha=0.8)        ax2.set_ylabel('温度 (°C)', fontsize=12)        ax2.set_title('温度对比', fontsize=14, fontweight='bold')        ax2.grid(axis='y', linestyle='--', alpha=0.3)        # 添加数值标签        for bar, value in zip(bars, values):            height = bar.get_height()            ax2.text(bar.get_x() + bar.get_width()/2., height + 0.5,                    f'{value:.1f}°C', ha='center', va='bottom', fontweight='bold')        ax2.set_ylim(0max(values) * 1.3 if max(values) > 0 else 30)        # 3. 气象指标雷达图        ax3 = plt.subplot(223, projection='polar')        categories = ['温度''湿度''风力''气压''能见度''云量']        N = len(categories)        # 数据归一化处理        try:            temp_norm = min(abs(temp_c) / 401if temp_c != 'N/A' else 0.5            humidity_norm = float(weather_info['humidity']) / 100 if weather_info['humidity'] != 'N/A' else 0.5            wind_norm = min(float(weather_info['wind_speed']) / 501if weather_info['wind_speed'] != 'N/A' else 0.3            pressure_norm = min(float(weather_info['pressure']) / 11001if weather_info['pressure'] != 'N/A' else 0.8            visibility_norm = min(float(weather_info['visibility']) / 201if weather_info['visibility'] != 'N/A' else 0.7            cloud_norm = float(weather_info['cloud_cover']) / 100 if weather_info['cloud_cover'] != 'N/A' else 0.5        except:            # 如果数据解析失败,使用默认值            temp_norm, humidity_norm, wind_norm, pressure_norm, visibility_norm, cloud_norm = 0.50.50.30.80.70.5        values = [temp_norm, humidity_norm, wind_norm, pressure_norm, visibility_norm, cloud_norm]        values += values[:1]        angles = [n / float(N) * 2 * 3.14159 for n in range(N)]        angles += angles[:1]        ax3.plot(angles, values, 'o-', linewidth=2, color='purple', alpha=0.7)        ax3.fill(angles, values, alpha=0.3, color='purple')        ax3.set_xticks(angles[:-1])        ax3.set_xticklabels(categories, fontsize=10)        ax3.set_title('气象指标雷达图', fontsize=14, fontweight='bold', pad=20)        ax3.set_ylim(01)        # 4. 小时预报        ax4 = plt.subplot(224)        if hourly_forecast and len(hourly_forecast) > 0:            hours = [f"{hour['time']}时" for hour in hourly_forecast]            temps = []            for hour in hourly_forecast:                try:                    temps.append(float(hour['temp']))                except:                    temps.append(temp_c)  # 使用当前温度作为备选            # 创建温度曲线            ax4.plot(hours, temps, 'o-', linewidth=2, color='red', alpha=0.7, label='温度')            ax4.fill_between(hours, temps, alpha=0.2, color='red')            # 添加天气图标            for i, hour in enumerate(hourly_forecast):                weather = hour['weather']                icon = '☀️'                for key in weather_icons:                    if key in weather:                        icon = weather_icons[key]                        break                ax4.text(i, temps[i] + (max(temps)-min(temps))*0.1, icon,                         ha='center', va='bottom', fontsize=16)            ax4.set_xlabel('时间', fontsize=12)            ax4.set_ylabel('温度 (°C)', fontsize=12)            ax4.set_title('未来几小时温度预报', fontsize=14, fontweight='bold')            ax4.grid(True, linestyle='--', alpha=0.3)            ax4.legend()            # 设置y轴范围            temp_min, temp_max = min(temps), max(temps)            ax4.set_ylim(temp_min - 2, temp_max + 3)        else:            ax4.text(0.50.5'无小时预报数据'                    ha='center', va='center', fontsize=14)            ax4.set_title('小时预报', fontsize=14, fontweight='bold')        plt.tight_layout()        plt.show()    def run(self):        """运行主程序"""        print("=" * 60)        print("                 智能天气查询系统")        print("=" * 60)        print("功能特点:")        print("  • 双API备份(主API失败自动切换备用API)")        print("  • 自动重试机制(网络波动时自动重试)")        print("  • 完整气象图表(温度、雷达图、小时预报)")        print("  • 中文支持(城市名、天气描述全中文化)")        print("=" * 60)        print("支持的城市示例:")        print("  • 直接输入: 北京、上海、济南、纽约、london、paris")        print("  • 支持拼音: beijing、shanghai、jinan")        print("  • 输入 'quit' 或 'q' 退出程序")        print("=" * 60)        # 检查必要库        try:            import requests            import matplotlib        except ImportError as e:            print(f"❌ 缺少必要的库: {e}")            print("请运行以下命令安装:")            print("  pip install requests matplotlib")            return        while True:            try:                city = input("\n🌍 请输入城市名称: ").strip()                if city.lower() in ['quit''exit''q']:                    print("\n感谢使用智能天气查询系统,再见!")                    break                if not city:                    print("⚠️  城市名称不能为空,请重新输入")                    continue                print(f"\n🔍 正在查询 [{city}] 的天气,请稍候...")                # 获取天气数据                data = self.get_weather_with_retry(city)                if data:                    # 解析数据                    weather_info, hourly_forecast = self.parse_weather_data(data)                    if weather_info:                        # 显示基本信息                        print(f"\n✅ 查询成功!")                        print(f"📍 位置: {weather_info['city']}{weather_info.get('region''')}")                        print(f"🌤️  天气: {weather_info['weather_desc']}")                        print(f"🌡️  温度: {weather_info['temp_c']}°C (体感{weather_info['feelslike_c']}°C)")                        print(f"💨  风速: {weather_info['wind_speed']} km/h {weather_info['wind_dir']}")                        print(f"💧  湿度: {weather_info['humidity']}%")                        # 询问是否显示图表                        show_chart = input("\n📊 是否显示详细气象图表? (y/n): ").strip().lower()                        if show_chart in ['y''yes''是''']:                            print("正在生成图表,请稍候...")                            self.create_weather_chart(weather_info, hourly_forecast)                        else:                            print("已跳过图表显示")                    else:                        print("❌ 解析天气数据失败")                else:                    print("❌ 无法获取天气信息,请检查:")                    print("  1. 城市名称是否正确")                    print("  2. 网络连接是否正常")                    print("  3. 稍后重试")            except KeyboardInterrupt:                print("\n\n程序被用户中断,退出...")                break            except Exception as e:                print(f"\n❌ 程序运行出错: {e}")                print("请重试或联系开发者")# ==================== 主程序入口 ====================def main():    """程序主函数"""    print("正在启动智能天气查询系统...")    # 创建天气仪表板实例    dashboard = WeatherDashboard()    # 运行主程序    dashboard.run()# ==================== 程序启动 ====================if __name__ == "__main__":    main()

最新文章

随机文章

基本 文件 流程 错误 SQL 调试
  1. 请求信息 : 2026-02-07 12:18:04 HTTP/2.0 GET : https://f.mffb.com.cn/a/473717.html
  2. 运行时间 : 0.090955s [ 吞吐率:10.99req/s ] 内存消耗:4,621.79kb 文件加载:140
  3. 缓存信息 : 0 reads,0 writes
  4. 会话信息 : SESSION_ID=6b7daff4f65ff1673d678931a3550fb8
  1. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/public/index.php ( 0.79 KB )
  2. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/autoload.php ( 0.17 KB )
  3. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/autoload_real.php ( 2.49 KB )
  4. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/platform_check.php ( 0.90 KB )
  5. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/ClassLoader.php ( 14.03 KB )
  6. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/autoload_static.php ( 4.90 KB )
  7. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper.php ( 8.34 KB )
  8. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-validate/src/helper.php ( 2.19 KB )
  9. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/helper.php ( 1.47 KB )
  10. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/stubs/load_stubs.php ( 0.16 KB )
  11. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Exception.php ( 1.69 KB )
  12. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-container/src/Facade.php ( 2.71 KB )
  13. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/deprecation-contracts/function.php ( 0.99 KB )
  14. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/polyfill-mbstring/bootstrap.php ( 8.26 KB )
  15. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/polyfill-mbstring/bootstrap80.php ( 9.78 KB )
  16. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/var-dumper/Resources/functions/dump.php ( 1.49 KB )
  17. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-dumper/src/helper.php ( 0.18 KB )
  18. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/var-dumper/VarDumper.php ( 4.30 KB )
  19. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/App.php ( 15.30 KB )
  20. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-container/src/Container.php ( 15.76 KB )
  21. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/container/src/ContainerInterface.php ( 1.02 KB )
  22. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/provider.php ( 0.19 KB )
  23. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Http.php ( 6.04 KB )
  24. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper/Str.php ( 7.29 KB )
  25. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Env.php ( 4.68 KB )
  26. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/common.php ( 0.03 KB )
  27. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/helper.php ( 18.78 KB )
  28. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Config.php ( 5.54 KB )
  29. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/app.php ( 0.95 KB )
  30. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/cache.php ( 0.78 KB )
  31. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/console.php ( 0.23 KB )
  32. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/cookie.php ( 0.56 KB )
  33. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/database.php ( 2.48 KB )
  34. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/Env.php ( 1.67 KB )
  35. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/filesystem.php ( 0.61 KB )
  36. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/lang.php ( 0.91 KB )
  37. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/log.php ( 1.35 KB )
  38. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/middleware.php ( 0.19 KB )
  39. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/route.php ( 1.89 KB )
  40. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/session.php ( 0.57 KB )
  41. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/trace.php ( 0.34 KB )
  42. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/view.php ( 0.82 KB )
  43. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/event.php ( 0.25 KB )
  44. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Event.php ( 7.67 KB )
  45. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/service.php ( 0.13 KB )
  46. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/AppService.php ( 0.26 KB )
  47. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Service.php ( 1.64 KB )
  48. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Lang.php ( 7.35 KB )
  49. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/lang/zh-cn.php ( 13.70 KB )
  50. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/Error.php ( 3.31 KB )
  51. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/RegisterService.php ( 1.33 KB )
  52. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/services.php ( 0.14 KB )
  53. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/PaginatorService.php ( 1.52 KB )
  54. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/ValidateService.php ( 0.99 KB )
  55. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/ModelService.php ( 2.04 KB )
  56. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/Service.php ( 0.77 KB )
  57. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Middleware.php ( 6.72 KB )
  58. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/BootService.php ( 0.77 KB )
  59. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/Paginator.php ( 11.86 KB )
  60. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-validate/src/Validate.php ( 63.20 KB )
  61. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/Model.php ( 23.55 KB )
  62. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/Attribute.php ( 21.05 KB )
  63. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/AutoWriteData.php ( 4.21 KB )
  64. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/Conversion.php ( 6.44 KB )
  65. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/DbConnect.php ( 5.16 KB )
  66. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/ModelEvent.php ( 2.33 KB )
  67. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/RelationShip.php ( 28.29 KB )
  68. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/contract/Arrayable.php ( 0.09 KB )
  69. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/contract/Jsonable.php ( 0.13 KB )
  70. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/contract/Modelable.php ( 0.09 KB )
  71. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Db.php ( 2.88 KB )
  72. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/DbManager.php ( 8.52 KB )
  73. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Log.php ( 6.28 KB )
  74. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Manager.php ( 3.92 KB )
  75. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/log/src/LoggerTrait.php ( 2.69 KB )
  76. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/log/src/LoggerInterface.php ( 2.71 KB )
  77. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Cache.php ( 4.92 KB )
  78. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/simple-cache/src/CacheInterface.php ( 4.71 KB )
  79. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper/Arr.php ( 16.63 KB )
  80. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/cache/driver/File.php ( 7.84 KB )
  81. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/cache/Driver.php ( 9.03 KB )
  82. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/CacheHandlerInterface.php ( 1.99 KB )
  83. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/Request.php ( 0.09 KB )
  84. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Request.php ( 55.78 KB )
  85. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/middleware.php ( 0.25 KB )
  86. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Pipeline.php ( 2.61 KB )
  87. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/TraceDebug.php ( 3.40 KB )
  88. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/middleware/SessionInit.php ( 1.94 KB )
  89. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Session.php ( 1.80 KB )
  90. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/session/driver/File.php ( 6.27 KB )
  91. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/SessionHandlerInterface.php ( 0.87 KB )
  92. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/session/Store.php ( 7.12 KB )
  93. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Route.php ( 23.73 KB )
  94. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleName.php ( 5.75 KB )
  95. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Domain.php ( 2.53 KB )
  96. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleGroup.php ( 22.43 KB )
  97. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Rule.php ( 26.95 KB )
  98. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleItem.php ( 9.78 KB )
  99. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/route/app.php ( 1.72 KB )
  100. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/Route.php ( 4.70 KB )
  101. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/dispatch/Controller.php ( 4.74 KB )
  102. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Dispatch.php ( 10.44 KB )
  103. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/controller/Index.php ( 4.81 KB )
  104. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/BaseController.php ( 2.05 KB )
  105. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/facade/Db.php ( 0.93 KB )
  106. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/connector/Mysql.php ( 5.44 KB )
  107. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/PDOConnection.php ( 52.47 KB )
  108. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Connection.php ( 8.39 KB )
  109. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/ConnectionInterface.php ( 4.57 KB )
  110. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/builder/Mysql.php ( 16.58 KB )
  111. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Builder.php ( 24.06 KB )
  112. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/BaseBuilder.php ( 27.50 KB )
  113. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Query.php ( 15.71 KB )
  114. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/BaseQuery.php ( 45.13 KB )
  115. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/TimeFieldQuery.php ( 7.43 KB )
  116. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/AggregateQuery.php ( 3.26 KB )
  117. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ModelRelationQuery.php ( 20.07 KB )
  118. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ParamsBind.php ( 3.66 KB )
  119. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ResultOperation.php ( 7.01 KB )
  120. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/WhereQuery.php ( 19.37 KB )
  121. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/JoinAndViewQuery.php ( 7.11 KB )
  122. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/TableFieldInfo.php ( 2.63 KB )
  123. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/Transaction.php ( 2.77 KB )
  124. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/log/driver/File.php ( 5.96 KB )
  125. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/LogHandlerInterface.php ( 0.86 KB )
  126. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/log/Channel.php ( 3.89 KB )
  127. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/event/LogRecord.php ( 1.02 KB )
  128. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/Collection.php ( 16.47 KB )
  129. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/View.php ( 1.70 KB )
  130. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/View.php ( 4.39 KB )
  131. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Response.php ( 8.81 KB )
  132. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/response/View.php ( 3.29 KB )
  133. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Cookie.php ( 6.06 KB )
  134. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-view/src/Think.php ( 8.38 KB )
  135. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/TemplateHandlerInterface.php ( 1.60 KB )
  136. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/Template.php ( 46.61 KB )
  137. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/template/driver/File.php ( 2.41 KB )
  138. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/template/contract/DriverInterface.php ( 0.86 KB )
  139. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/runtime/temp/067d451b9a0c665040f3f1bdd3293d68.php ( 11.98 KB )
  140. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/Html.php ( 4.42 KB )
  1. CONNECT:[ UseTime:0.000474s ] mysql:host=127.0.0.1;port=3306;dbname=f_mffb;charset=utf8mb4
  2. SHOW FULL COLUMNS FROM `fenlei` [ RunTime:0.000775s ]
  3. SELECT * FROM `fenlei` WHERE `fid` = 0 [ RunTime:0.000285s ]
  4. SELECT * FROM `fenlei` WHERE `fid` = 63 [ RunTime:0.000272s ]
  5. SHOW FULL COLUMNS FROM `set` [ RunTime:0.000517s ]
  6. SELECT * FROM `set` [ RunTime:0.000212s ]
  7. SHOW FULL COLUMNS FROM `article` [ RunTime:0.000628s ]
  8. SELECT * FROM `article` WHERE `id` = 473717 LIMIT 1 [ RunTime:0.000482s ]
  9. UPDATE `article` SET `lasttime` = 1770437884 WHERE `id` = 473717 [ RunTime:0.002542s ]
  10. SELECT * FROM `fenlei` WHERE `id` = 66 LIMIT 1 [ RunTime:0.000261s ]
  11. SELECT * FROM `article` WHERE `id` < 473717 ORDER BY `id` DESC LIMIT 1 [ RunTime:0.006322s ]
  12. SELECT * FROM `article` WHERE `id` > 473717 ORDER BY `id` ASC LIMIT 1 [ RunTime:0.000453s ]
  13. SELECT * FROM `article` WHERE `id` < 473717 ORDER BY `id` DESC LIMIT 10 [ RunTime:0.005241s ]
  14. SELECT * FROM `article` WHERE `id` < 473717 ORDER BY `id` DESC LIMIT 10,10 [ RunTime:0.001545s ]
  15. SELECT * FROM `article` WHERE `id` < 473717 ORDER BY `id` DESC LIMIT 20,10 [ RunTime:0.001314s ]
0.092605s