多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
### delete **按条件删除记录** **参数** $conditions: 数组形式,查找条件,此参数的格式用法与find/findAll的查找条件参数是相同的。 ~~~ public function delete($conditions) { $where = ""; if (is_array ( $conditions )) { $join = array (); foreach ( $conditions as $key => $condition ) { $condition = $this->__val_escape ( $condition ); $join [] = "{$key} = '{$condition}'"; } $where = "WHERE ( " . join ( " AND ", $join ) . ")"; } else { if (null != $conditions) $where = "WHERE ( " . $conditions . ")"; } $sql = "DELETE FROM {$this->tbl_name} {$where}"; return $this->_db->query ( $sql ); } ~~~