/** * 删除记录 * * @param string $table * @param array $params * 更新条件 * array( * '字段名' => '值' * ) * @param string $gule * 可以为AND OR * @return mixed */ function pdo_delete($table, $params = array(), $gule = 'AND') { global $_W; $condition = pdo_implode($params, $gule); $sql = "DELETE FROM {$_W['config']['db']['tablepre']}{$table} "; $sql .= $condition['fields'] ? ' WHERE ' . $condition['fields'] : ''; return pdo_query($sql, $condition['params']); }
function pdo_delete($table, $params = [], $glue = 'AND') { return db()->createCommand()->delete(tablename($table), pdo_implode($params, $glue))->delete(); }