diff --git a/Traits/Think/Model/Auto.php b/Traits/Think/Model/Auto.php index bdd190fe..93925867 100644 --- a/Traits/Think/Model/Auto.php +++ b/Traits/Think/Model/Auto.php @@ -16,6 +16,9 @@ trait Auto { protected $_validate = []; // 自动验证定义 protected $_auto = []; // 自动完成定义 + public function test($auto=''){ + echo 'auto'; + } /** * 创建数据对象 但不保存到数据库 * @access public diff --git a/Traits/Think/Model/Extend.php b/Traits/Think/Model/Extend.php index 1ba069c3..06d6a118 100644 --- a/Traits/Think/Model/Extend.php +++ b/Traits/Think/Model/Extend.php @@ -9,7 +9,7 @@ // | Author: liu21st // +---------------------------------------------------------------------- -namespace Traits\Think; +namespace Traits\Think\Model; trait Extend { @@ -176,34 +176,6 @@ trait Extend { } } - /** - * 批处理执行SQL语句 - * 批处理的指令都认为是execute操作 - * @access public - * @param array $sql SQL批处理指令 - * @return boolean - */ - public function patchQuery($sql=[]) { - if(!is_array($sql)) return false; - // 自动启动事务支持 - $this->startTrans(); - try{ - foreach ($sql as $_sql){ - $result = $this->execute($_sql); - if(false === $result) { - // 发生错误自动回滚事务 - $this->rollback(); - return false; - } - } - // 提交事务 - $this->commit(); - } catch (\Think\Exception $e) { - $this->rollback(); - } - return true; - } - /** * 得到分表的的数据表名 * @access public