当前位置:首页>python>让ChatGPT帮我写Python脚本,这配合太舒服了

让ChatGPT帮我写Python脚本,这配合太舒服了

  • 2026-07-02 16:46:47
让ChatGPT帮我写Python脚本,这配合太舒服了

上周五下午5点,老板突然要一份跨部门的销售数据交叉分析报告,周一早上就要。要是以前,我肯定要加班到深夜。但这次,我用了ChatGPT,晚上7点就完成了报告,还顺便优化了三个自动化脚本。

这不是什么魔法,而是找到了和AI协作的正确姿势。今天,我就来分享如何让ChatGPT成为你的Python开发最佳搭档,而不是简单的代码生成器。

往期阅读>>>

Python 20 个文本分析的库:效率提升 10 倍的秘密武器

Python 金融定价利器FinancePy库深度解析

Python 适合新手的量化分析框架AKQuant解析
Python 25个数据清洗技巧:让你的数据质量提升10倍

Python 为什么会成为AI时代的头部语言

Python 40个常用的列表推导式

Python 50个提高代码开发效率的方法

Python 自动检测服务HTTPS证书过期时间并发送预警

Python 自动化操作Redis的15个实用脚本

Python 自动化管理Jenkins的15个实用脚本,提升效率

Python copyparty搭建轻量的文件服务器的方法

Python 实现2FA认证的方法,提升安全性

Python 封装20个常用API接口,提升开发效率

App2Docker:如何无需编写Dockerfile也可以创建容器镜像

Python 集成 Nacos 配置中心的方法

Python 35个JSON数据处理方法

Python 字典与列表的20个核心技巧

Python 15个文本分析的库,提升效率

Python 15个Pandas技巧,提升数据分析效率

Python 运维中30个常用的库,提升效率

Python调用远程接口的方法

Python 提取HTML文本的方法,提升效率

Python 应用容器化方法:实现“一次部署,处处运行”

Python 自动化识别Nginx配置并导出为excel文件,提升Nginx管理效率

Python 5个常见的异步任务处理框架

Python数据科学常见的30个库

Python 50个实用代码片段,优雅高效


场景一:从需求到代码,10分钟搞定数据清洗脚本

我的需求: 把市场部、销售部、财务部的Excel数据合并,清洗掉重复项和异常值,生成统一格式的分析报告。

传统方式:

  1. 查pandas文档(30分钟)

  2. 写代码调试(2小时)

  3. 处理各种异常情况(1小时)

  4. 总耗时:3.5小时+

ChatGPT协作方式:

第一步:明确需求(对话式)

我:我需要合并三个Excel文件,它们结构不同:1. 市场部:文件名 marketing.xlsx,工作表名"市场数据",有"日期"、"渠道"、"花费"列2. 销售部:文件名 sales.xlsx,工作表名"销售记录",有"销售日期"、"产品"、"销售额"列  3. 财务部:文件名 finance.xlsx,工作表"财务明细",有"date"、"item"、"amount"列要求:1. 统一列名为:date, channel/product, amount2. 删除amount为负数或大于100万的异常值3. 按日期排序,保存到 merged_data.xlsx4. 生成简单的统计报告:总金额、日均金额、最大最小值

第二步:ChatGPT生成代码骨架

importpandasaspdimportosfromdatetimeimportdatetimedefmerge_and_clean_excel_files():"""    合并和清洗三个部门的Excel数据    返回:        pandas.DataFrame: 清洗后的合并数据        dict: 统计报告    """# 读取三个文件try:marketing_df = pd.read_excel('marketing.xlsx'sheet_name='市场数据')sales_df = pd.read_excel('sales.xlsx'sheet_name='销售记录')finance_df = pd.read_excel('finance.xlsx'sheet_name='财务明细')exceptFileNotFoundErrorase:print(f"文件不存在: {e}")returnNoneNone# 重命名列以统一格式marketing_df = marketing_df.rename(columns={'日期''date','渠道''item','花费''amount'    })sales_df = sales_df.rename(columns={'销售日期''date''产品''item','销售额''amount'    })finance_df = finance_df.rename(columns={'date''date','item''item','amount''amount'    })# 合并数据combined_df = pd.concat([marketing_dfsales_dffinance_df], ignore_index=True)# 清洗数据# 1. 删除amount异常值(负数或大于100万)cleaned_df = combined_df[        (combined_df['amount'>0&        (combined_df['amount'<1000000)    ].copy()# 2. 确保date是日期类型cleaned_df['date'] = pd.to_datetime(cleaned_df['date'], errors='coerce')# 3. 删除日期无效的行cleaned_df = cleaned_df.dropna(subset=['date'])# 4. 按日期排序cleaned_df = cleaned_df.sort_values('date').reset_index(drop=True)# 生成统计报告report = {'total_amount'cleaned_df['amount'].sum(),'average_daily'cleaned_df.groupby('date')['amount'].sum().mean(),'max_amount'cleaned_df['amount'].max(),'min_amount'cleaned_df['amount'].min(),'row_count'len(cleaned_df),'data_range': {'start'cleaned_df['date'].min().strftime('%Y-%m-%d'),'end'cleaned_df['date'].max().strftime('%Y-%m-%d')        }    }# 保存到Excelcleaned_df.to_excel('merged_data.xlsx'index=False)# 同时保存报告report_df = pd.DataFrame([report])report_df.to_excel('statistics_report.xlsx'index=False)returncleaned_dfreportif__name__ == "__main__":datareport = merge_and_clean_excel_files()ifdataisnotNone:print("数据处理完成!")print(f"处理了 {len(data)} 行数据")print(f"总金额: {report['total_amount']:,.2f}")print(f"数据时间范围: {report['data_range']['start']} 到 {report['data_range']['end']}")

第三步:我优化和增强(关键步骤)

# 我添加的部分:错误处理、日志记录、进度显示importloggingfromtqdmimporttqdmfrompathlibimportPath# 设置日志logging.basicConfig(level=logging.INFO,format='%(asctime)s - %(levelname)s - %(message)s',handlers=[logging.FileHandler('data_merge.log'),logging.StreamHandler()    ])defenhanced_merge():"""增强版的数据合并函数"""logger = logging.getLogger(__name__)# 检查文件是否存在required_files = ['marketing.xlsx''sales.xlsx''finance.xlsx']missing_files = [fforfinrequired_filesifnotPath(f).exists()]ifmissing_files:logger.error(f"缺少文件: {missing_files}")returnNoneNonelogger.info("开始合并三个部门的Excel数据...")try:# 使用tqdm显示进度withtqdm(total=100desc="处理进度"aspbar:datareport = merge_and_clean_excel_files()pbar.update(100)ifdataisnotNone:logger.info(f"成功处理 {len(data)} 行数据")logger.info(f"总金额: {report['total_amount']:,.2f}")# 额外分析:按部门统计# 我手动添加的部门识别逻辑data['department'] = data['item'].apply(identify_department)dept_stats = data.groupby('department')['amount'].agg(['sum''mean''count'])dept_stats.to_excel('department_stats.xlsx')logger.info("部门统计已生成")returndatareportexceptExceptionase:logger.exception(f"数据处理失败: {e}")returnNoneNonedefidentify_department(item):"""根据item内容识别部门(这是我根据业务知识添加的)"""item_str = str(item).lower()ifany(channelinitem_strforchannelin ['微信''微博''抖音''广告']):return'市场部'elifany(productinitem_strforproductin ['产品a''产品b''产品c']):return'销售部'elifany(financeinitem_strforfinancein ['办公''差旅''采购']):return'财务部'else:return'其他'

第四步:测试和微调

我:生成的代码有个问题,finance.xlsx的date列格式不一致,有的"2023-01-01",有的"2023/01/01",怎么处理?ChatGPT:可以这样修改日期转换部分:# 修改日期处理逻辑def parse_date(date_val):    try:        # 尝试多种格式        for fmt in ['%Y-%m-%d', '%Y/%m/%d', '%Y年%m月%d日', '%d/%m/%Y']:            try:                return pd.to_datetime(date_val, format=fmt)            except:                continue        return pd.NaT    except:        return pd.NaTcleaned_df['date'] = cleaned_df['date'].apply(parse_date)

最终效果:

  • ChatGPT生成时间:2分钟

  • 我优化时间:8分钟

  • 总耗时:10分钟

  • 代码质量:生产可用,有完整错误处理


场景二:调试复杂bug,AI帮我快速定位问题

上周遇到一个诡异的问题:脚本在测试环境正常,生产环境随机失败。

传统调试:

  1. 加print语句(1小时)

  2. 查日志(30分钟)

  3. 复现问题(不确定)

  4. 总耗时:无法估计

ChatGPT协作调试:

第一步:提供错误信息和代码片段

我:我的Python脚本在生产环境随机出现这个错误:Traceback (most recent call last):  File "data_processor.py", line 147, in process_batch    result = complex_calculation(data_chunk)  File "data_processor.py", line 89, in complex_calculation    return sum(x * y for x, y in zip(values_x, values_y)) / len(values_x)ZeroDivisionError: division by zero但values_x应该永远不会为空。代码片段:def process_batch(batch_data):    for chunk in batch_data:        if should_process(chunk):  # 这里可能过滤掉所有数据            results = complex_calculation(chunk)            save_results(results)def complex_calculation(data):    values_x = extract_x(data)  # 可能返回空列表    values_y = extract_y(data)    if not values_x or not values_y:  # 我漏掉了这个检查!        return 0    # 计算逻辑...

第二步:ChatGPT分析并提供解决方案

ChatGPT:问题可能出现在几个地方:1. extract_x()或extract_y()可能返回空列表2. should_process()可能过滤了所有数据,导致chunk为空3. 生产环境的数据可能与测试环境不同建议的修复:def complex_calculation(data):    values_x = extract_x(data)    values_y = extract_y(data)    # 添加防御性检查    if not values_x or not values_y:        logger.warning(f"空数据: values_x={len(values_x)}, values_y={len(values_y)}")        return 0  # 或抛出明确异常    # 确保长度一致    min_len = min(len(values_x), len(values_y))    values_x = values_x[:min_len]    values_y = values_y[:min_len]    if min_len == 0:        return 0    try:        result = sum(x * y for x, y in zip(values_x, values_y)) / min_len        return result    except ZeroDivisionError:        logger.error("计算出现除零错误,返回0")        return 0同时改进should_process函数:def should_process(chunk):    if not chunk:        return False    # 添加更多检查...

第三步:我实施并添加监控

# 我根据ChatGPT建议修改,并添加了详细监控classDataProcessor:def__init__(self):self.stats = {'total_chunks'0,'empty_chunks'0,'calculation_errors'0,'successful_calculations'0        }defprocess_batch(selfbatch_data):"""处理数据批次,带有完整监控"""self.stats['total_chunks'] += len(batch_data)forichunkinenumerate(batch_data):chunk_id = f"chunk_{i}"ifnotself.should_process(chunk):self.stats['empty_chunks'] += 1logger.debug(f"跳过 {chunk_id}: 数据为空")continuetry:result = self.complex_calculation(chunkchunk_id)ifresultisnotNone:self.save_results(result)self.stats['successful_calculations'] += 1exceptExceptionase:self.stats['calculation_errors'] += 1logger.error(f"处理 {chunk_id} 失败: {e}")# 记录失败的数据片段以便分析self.log_failed_chunk(chunk_idchunkstr(e))self.report_stats()defcomplex_calculation(selfdatachunk_id=""):"""增强版的计算函数"""values_x = extract_x(data)values_y = extract_y(data)logger.debug(f"{chunk_id}: values_x={len(values_x)}, values_y={len(values_y)}")# 详细的检查逻辑ifnotvalues_x:logger.warning(f"{chunk_id}: values_x为空")returnNoneifnotvalues_y:logger.warning(f"{chunk_id}: values_y为空")returnNone# 长度对齐min_len = min(len(values_x), len(values_y))ifmin_len == 0:logger.warning(f"{chunk_id}: 对齐后长度为0")returnNonevalues_x = values_x[:min_len]values_y = values_y[:min_len]try:# 计算,添加更多检查ifany(y == 0foryinvalues_y):logger.warning(f"{chunk_id}: 存在0值,可能影响计算")result = sum(x*yforxyinzip(values_xvalues_y)) /min_len# 结果验证ifnotmath.isfinite(result):logger.error(f"{chunk_id}: 计算结果无效: {result}")returnNonereturnresultexceptZeroDivisionErrorase:logger.error(f"{chunk_id}: 除零错误,min_len={min_len}")returnNoneexceptExceptionase:logger.error(f"{chunk_id}: 计算错误: {e}")returnNone

调试效果:

  • 定位问题时间:从不确定 → 15分钟

  • 修复质量:不仅修复了bug,还预防了类似问题

  • 监控能力:添加了完整的运行监控


场景三:学习新技术,让AI当我的私人导师

最近需要学习FastAPI,传统方式要看文档、看教程、写demo,至少一天。用ChatGPT,2小时就能上手。

学习路径:

第一步:基础知识问答

我:我想用FastAPI创建一个用户管理系统,需要哪些基本组件?ChatGPT:一个基本的FastAPI用户管理系统需要:1. 数据模型(Pydantic)2. 数据库模型(SQLAlchemy或Tortoise-ORM)3. 路由(API端点)4. 认证和授权(JWT或OAuth2)5. 错误处理6. 中间件(可选)我给你一个最小可工作示例:

第二步:生成学习代码

fromfastapiimportFastAPIHTTPExceptionDependsfrompydanticimportBaseModelfromtypingimportListOptionalimportuuidfromdatetimeimportdatetimeapp = FastAPI(title="用户管理系统")# 数据模型classUserBase(BaseModel):usernamestremailstrfull_nameOptional[str] = NoneclassUserCreate(UserBase):passwordstrclassUser(UserBase):idstrcreated_atdatetimeclassConfig:orm_mode = True# 内存存储(实际项目用数据库)users_db = {}# API端点@app.get("/")defread_root():return {"message""用户管理系统 API"}@app.post("/users/"response_model=User)defcreate_user(userUserCreate):"""创建新用户"""user_id = str(uuid.uuid4())# 检查用户名是否已存在forexisting_userinusers_db.values():ifexisting_user["username"] == user.username:raiseHTTPException(status_code=400detail="用户名已存在")db_user = {"id"user_id,"username"user.username,"email"user.email,"full_name"user.full_name,"created_at"datetime.now()    }users_db[user_id] = db_userreturndb_user@app.get("/users/"response_model=List[User])defread_users(skipint = 0limitint = 100):"""获取用户列表"""returnlist(users_db.values())[skip:skip+limit]@app.get("/users/{user_id}"response_model=User)defread_user(user_idstr):"""获取单个用户"""ifuser_idnotinusers_db:raiseHTTPException(status_code=404detail="用户不存在")returnusers_db[user_id]@app.put("/users/{user_id}"response_model=User)defupdate_user(user_idstruser_updateUserBase):"""更新用户"""ifuser_idnotinusers_db:raiseHTTPException(status_code=404detail="用户不存在")# 检查用户名冲突(排除自己)foruidexisting_userinusers_db.items():ifuid!user_idandexisting_user["username"] == user_update.username:raiseHTTPException(status_code=400detail="用户名已存在")users_db[user_id].update(user_update.dict(exclude_unset=True))returnusers_db[user_id]@app.delete("/users/{user_id}")defdelete_user(user_idstr):"""删除用户"""ifuser_idnotinusers_db:raiseHTTPException(status_code=404detail="用户不存在")delusers_db[user_id]return {"message""用户删除成功"}# 运行:uvicorn main:app --reload

第三步:我追问和深化

我:这个例子很好,但实际项目还需要:1. 数据库连接(用SQLAlchemy)2. 密码哈希(不能存明文)3. JWT认证4. 单元测试5. 分页和过滤能帮我逐步实现这些吗?ChatGPT:当然,我们一步步来。首先添加数据库支持...

第四步:实际项目应用基于ChatGPT的指导,我快速搭建了项目骨架:

my_user_system/├── app/│   ├── __init__.py│   ├── main.py          # FastAPI应用│   ├── database.py      # 数据库连接│   ├── models.py        # 数据模型│   ├── schemas.py       # Pydantic模型│   ├── crud.py          # 数据库操作│   ├── auth.py          # 认证逻辑│   └── dependencies.py  # 依赖注入├── tests/               # 单元测试├── requirements.txt└── README.md

学习效果:

  • 学习时间:2小时 vs 1天

  • 理解深度:通过问答深入理解原理

  • 实践能力:立即能写实际代码


场景四:代码重构,AI帮我优化架构

有一个祖传的500行脚本,结构混乱,难以维护。

ChatGPT协助重构:

第一步:分析现有代码

我:我有一个数据处理脚本,主要问题:1. 一个函数做了太多事情(200行)2. 全局变量多3. 错误处理混乱4. 没有类型提示你能帮我分析如何重构吗?ChatGPT:请提供代码结构,我帮你分析。

第二步:提供重构建议

# ChatGPT的分析和建议:原始问题:1.process_data()函数太长(责任过多)2.使用全局变量config、logger、db_connection3.错误处理混在业务逻辑中4.没有类型提示,难以理解数据结构重构建议:# 1. 将大函数拆分为小函数(单一职责)原始:defprocess_data(input_fileoutput_file):重构:-defload_config() ->Config-defsetup_logging(configConfig->Logger-defcreate_db_connection(configConfig->Connection-defread_input_data(file_pathstr->DataFrame-defvalidate_data(dataDataFrame->bool-deftransform_data(dataDataFrame->DataFrame-defsave_results(dataDataFrameoutput_pathstr)# 2. 使用类组织相关功能classDataProcessor:def__init__(selfconfig_pathstr):self.config = self.load_config(config_path)self.logger = self.setup_logging()self.db_conn = self.create_connection()defprocess(selfinput_filestroutput_filestr):"""主处理流程"""data = self.read_data(input_file)ifself.validate_data(data):transformed = self.transform_data(data)self.save_data(transformedoutput_file)self.logger.info("处理完成")else:self.logger.error("数据验证失败")# 3. 添加类型提示fromtypingimportOptionalDictAnyfrompandasimportDataFrameimportpandasaspd# 4. 统一错误处理classDataProcessingError(Exception):passdefsafe_process():try:processor = DataProcessor("config.yaml")processor.process("input.csv""output.csv")exceptDataProcessingErrorase:logger.error(f"数据处理失败: {e}")# 清理资源exceptExceptionase:logger.exception(f"未预期的错误: {e}")raise

第三步:逐步重构我按照建议,分步骤重构:

# 第一步:定义数据类fromdataclassesimportdataclassfromtypingimportOptionalDictAnyfromdatetimeimportdatetime@dataclassclassProcessingConfig:input_encodingstr = "utf-8"output_formatstr = "csv"chunk_sizeint = 1000log_levelstr = "INFO"@dataclassclassProcessingResult:successboolinput_rowsintoutput_rowsinterrorsList[str]start_timedatetimeend_timedatetimeduration_secondsfloat# 第二步:创建处理器类classDataProcessor:def__init__(selfconfigProcessingConfig):self.config = configself.logger = self._setup_logger()self._reset_state()def_reset_state(self):"""重置处理状态"""self.current_file = Noneself.processed_rows = 0self.errors = []defprocess_file(selfinput_pathstroutput_pathstr->ProcessingResult:"""处理单个文件"""start_time = datetime.now()try:self._reset_state()self.current_file = input_pathself.logger.info(f"开始处理文件: {input_path}")# 读取数据data = self._read_input(input_path)input_rows = len(data)# 验证数据ifnotself._validate_data(data):raiseDataValidationError("数据验证失败")# 转换数据transformed = self._transform_data(data)# 保存结果self._save_output(transformedoutput_path)output_rows = len(transformed)# 记录成功self.processed_rows = output_rowsself.logger.info(f"处理完成: {input_rows} -> {output_rows} 行")returnProcessingResult(success=True,input_rows=input_rows,output_rows=output_rows,errors=self.errors,start_time=start_time,end_time=datetime.now(),duration_seconds=(datetime.now() -start_time).total_seconds()            )exceptExceptionase:self.logger.error(f"处理失败: {e}")returnProcessingResult(success=False,input_rows=0,output_rows=0,errors=[str(e)] +self.errors,start_time=start_time,end_time=datetime.now(),duration_seconds=(datetime.now() -start_time).total_seconds()            )def_read_input(selffile_pathstr->pd.DataFrame:"""读取输入文件"""# 实现...passdef_validate_data(selfdatapd.DataFrame->bool:"""验证数据"""# 实现...passdef_transform_data(selfdatapd.DataFrame->pd.DataFrame:"""转换数据"""# 实现...passdef_save_output(selfdatapd.DataFrameoutput_pathstr):"""保存输出"""# 实现...pass# 第三步:使用工厂模式创建处理器classProcessorFactory:@staticmethoddefcreate_processor(config_pathOptional[str] = None->DataProcessor:"""创建数据处理器"""ifconfig_path:config = ProcessorFactory._load_config(config_path)else:config = ProcessingConfig()  # 默认配置returnDataProcessor(config)@staticmethoddef_load_config(config_pathstr->ProcessingConfig:"""加载配置文件"""# 实现...pass

重构效果:

  • 代码行数:500行 → 300行(更清晰)

  • 可维护性:大幅提升

  • 可测试性:每个函数都可单独测试

  • 错误处理:统一且完整


和ChatGPT协作的最佳实践

经过实践,我总结了和ChatGPT协作写Python代码的最佳实践:

1. 明确需求,分步骤进行

不好的提问:帮我写个数据处理脚本好的提问:我需要一个Python脚本,实现以下功能:1. 从API获取JSON数据2. 解析并转换为DataFrame3. 过滤掉异常值(数值大于3倍标准差)4. 保存为CSV文件5. 添加错误处理和日志记录

2. 提供上下文和约束

提供:- 输入数据格式示例- 期望的输出格式- 性能要求(如处理100万行数据)- 环境约束(Python版本、可用库)- 已有的代码片段(如果需要集成)

3. 迭代改进,不要一次求全

第一轮:生成核心功能代码第二轮:添加错误处理第三轮:优化性能第四轮:添加文档和测试

4. 理解而非复制

  • 阅读ChatGPT生成的代码,理解其思路

  • 为什么这样写而不仅仅是怎么写

  • 修改和优化生成的代码,加入自己的思考

5. 验证和测试

# 对ChatGPT生成的代码,一定要测试deftest_chatgpt_code():# 1. 单元测试assertfunction_works_correctly()# 2. 边界测试test_edge_cases()# 3. 性能测试ifis_too_slow():ask_chatgpt_to_optimize()# 4. 安全测试check_for_security_issues()

6. 保持批判性思维

  • ChatGPT可能生成过时的代码(如用Python 2语法)

  • 可能推荐不安全的实践

  • 可能不理解你的具体业务逻辑

  • 你才是最终的责任人

ChatGPT的局限性(要知道什么时候不用它)

虽然ChatGPT很强大,但有些情况不适合:

1. 安全性要求高的代码

  • 加密算法实现

  • 认证授权逻辑

  • 支付处理代码

2. 性能关键代码

  • 高频交易系统

  • 实时数据处理

  • 算法核心优化

3. 复杂的业务逻辑

  • 领域特定的复杂规则

  • 公司内部业务逻辑

  • 需要深度领域知识的代码

4. 学习初期的基础代码

  • Python基础语法练习

  • 算法和数据结构实现

  • 面向对象设计练习

刚开始用ChatGPT写代码时,我也有顾虑:会不会让我变懒?会不会降低代码质量?会不会失去思考能力?

几个月用下来,我发现正好相反:ChatGPT不是替代我思考,而是放大我的思考能力。

就像有了计算器,我们并没有忘记算术,而是能处理更复杂的数学问题。有了ChatGPT,我并没有停止思考,而是能思考更复杂的编程问题。

“无他,惟手熟尔”!有需要的用起来!
如果你觉得这篇文章有用,欢迎点赞、转发、收藏、留言、推荐

最新文章

随机文章

基本 文件 流程 错误 SQL 调试
  1. 请求信息 : 2026-07-02 21:57:27 HTTP/2.0 GET : https://f.mffb.com.cn/a/502959.html
  2. 运行时间 : 0.258199s [ 吞吐率:3.87req/s ] 内存消耗:4,770.67kb 文件加载:140
  3. 缓存信息 : 0 reads,0 writes
  4. 会话信息 : SESSION_ID=d193cd70959e4c319c447e6f6fb25619
  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.000671s ] mysql:host=127.0.0.1;port=3306;dbname=f_mffb;charset=utf8mb4
  2. SHOW FULL COLUMNS FROM `fenlei` [ RunTime:0.000912s ]
  3. SELECT * FROM `fenlei` WHERE `fid` = 0 [ RunTime:0.009672s ]
  4. SELECT * FROM `fenlei` WHERE `fid` = 63 [ RunTime:0.025662s ]
  5. SHOW FULL COLUMNS FROM `set` [ RunTime:0.001022s ]
  6. SELECT * FROM `set` [ RunTime:0.008355s ]
  7. SHOW FULL COLUMNS FROM `article` [ RunTime:0.000908s ]
  8. SELECT * FROM `article` WHERE `id` = 502959 LIMIT 1 [ RunTime:0.048920s ]
  9. UPDATE `article` SET `lasttime` = 1783000647 WHERE `id` = 502959 [ RunTime:0.016537s ]
  10. SELECT * FROM `fenlei` WHERE `id` = 66 LIMIT 1 [ RunTime:0.006035s ]
  11. SELECT * FROM `article` WHERE `id` < 502959 ORDER BY `id` DESC LIMIT 1 [ RunTime:0.006119s ]
  12. SELECT * FROM `article` WHERE `id` > 502959 ORDER BY `id` ASC LIMIT 1 [ RunTime:0.000768s ]
  13. SELECT * FROM `article` WHERE `id` < 502959 ORDER BY `id` DESC LIMIT 10 [ RunTime:0.010683s ]
  14. SELECT * FROM `article` WHERE `id` < 502959 ORDER BY `id` DESC LIMIT 10,10 [ RunTime:0.001318s ]
  15. SELECT * FROM `article` WHERE `id` < 502959 ORDER BY `id` DESC LIMIT 20,10 [ RunTime:0.044790s ]
0.259766s