We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TP6官方文档中只提供部分数据库事件,不如模型事件齐全;当需要多Db和Model的增删改成都进行监听时,只能使用Db事件,而Db事件不齐全,相关业务需求无法实现。 (think\db\PDOConnection)新增before_update事件示例:
/** * 更新记录 * @access public * @param BaseQuery $query 查询对象 * @return integer * @throws PDOException */ public function update(BaseQuery $query): int { $query->parseOptions(); $flag = $this->db->trigger('before_update', $query); if($flag === true) return 0; // 生成UPDATE SQL语句 $sql = $this->builder->update($query); // 执行操作 $result = '' == $sql ? 0 : $this->pdoExecute($query, $sql, $query->getBind()); if ($result) { $this->db->trigger('after_update', $query); } return $result; }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
TP6官方文档中只提供部分数据库事件,不如模型事件齐全;当需要多Db和Model的增删改成都进行监听时,只能使用Db事件,而Db事件不齐全,相关业务需求无法实现。
(think\db\PDOConnection)新增before_update事件示例:
The text was updated successfully, but these errors were encountered: