<pman>Intégration de la branche dev74
This commit is contained in:
commit
2a2987c4be
@ -1,6 +1,7 @@
|
||||
<?php
|
||||
namespace nulib\db;
|
||||
|
||||
use nulib\A;
|
||||
use nulib\cl;
|
||||
use nulib\php\func;
|
||||
use nulib\ValueException;
|
||||
|
@ -9,6 +9,7 @@ class _select extends _common {
|
||||
const SCHEMA = [
|
||||
"prefix" => "?string",
|
||||
"schema" => "?array",
|
||||
"distinct" => "bool",
|
||||
"cols" => "?array",
|
||||
"col_prefix" => "?string",
|
||||
"from" => "?string",
|
||||
@ -45,8 +46,16 @@ class _select extends _common {
|
||||
if (($prefix = $query["prefix"] ?? null) !== null) $sql[] = $prefix;
|
||||
|
||||
## select
|
||||
self::consume('(select(?:\s*distinct)?)\s*', $tmpsql, $ms);
|
||||
self::consume('(select(?:\s*(distinct))?)\s*', $tmpsql, $ms);
|
||||
$sql[] = $ms[1];
|
||||
if (($ms[2] ?? null) !== null) {
|
||||
# ne pas le rajouter de nouveau ci-dessous
|
||||
$distinct = false;
|
||||
} else $distinct = null;
|
||||
|
||||
## distinct
|
||||
$distinct ??= $query["distinct"] ?? false;
|
||||
if ($distinct) $sql[] = "distinct";
|
||||
|
||||
## cols
|
||||
$usercols = [];
|
||||
|
Loading…
x
Reference in New Issue
Block a user