/** * 更改记录信息 * @param array $fdata 字段数组 * @param string $where 条件 * @return 成功返回true 否则返回false */ public function update($fdata = [], $where) { parent::update($this->_tablesql, $fdata, $where); $sql = $this->getSql(); //获取updatesql语句 $tables = $this->getTablesName(); $tsql = []; if (count($tables) > 1) { //多表 foreach ($tables as $s) { $tsql[] = str_replace($this->_tablesql, $s, $sql); } } else { //单表 $tsql[] = str_replace($this->_tablesql, $tables[0], $sql); } $this->setSql($tsql); //执行多条查询 return $this; }
/** * * * @param mixed * @return */ public static function update($row, $condition = '', $params = []) { $command = new Command(get_called_class()); return $command->update($row, $condition, $params); }
/** * 更改记录信息 * @param string $table 数据表名 * @param array $fdata 字段数组 * @param string $where 条件 * @return 成功返回true 否则返回false */ public function update($table, $fdata = [], $where) { parent::update($table, $fdata, $where); $sql = parent::getSql(); //获取单条时的SQL语句 self::setBuildSql($sql); return $this; }
/** * 更改记录信息 * @param array $fdata 字段数组 * @param string $where 条件 * @return 成功返回true 否则返回false */ public function update($fdata = [], $where) { parent::update($this->_tablesql, $fdata, $where); $this->_unionSql(); return $this; }