AI写作智能体 自主规划任务,支持联网查询和网页读取,多模态高效创作各类分析报告、商业计划、营销方案、教学内容等。 广告
# 查询事件 ## 查询事件(V5.0.4+) 从`5.0.4+`版本开始,增加了数据库的CURD操作事件支持,包括: 事件描述before\_select`select`查询前回调before\_find`find`查询前回调after\_insert`insert`操作成功后回调after\_update`update`操作成功后回调after\_delete`delete`操作成功后回调查询事件仅支持`find`、`select`、`insert`、`update`和`delete`方法。 ## 注册事件 使用下面的方法注册数据库查询事件 ``` Query::event('after_insert','callback'); Query::event('before_select',function($options,$query){ // 事件处理 return $result; }); ```