dblayeroo: Update Alias support
git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@3822 bf3deb0d-5f1a-0410-827f-c0cc1f45334c
This commit is contained in:
@@ -2724,12 +2724,16 @@ class dblayeroo
|
|||||||
$columns = array ();
|
$columns = array ();
|
||||||
foreach ($this->displayGet (false) as $col)
|
foreach ($this->displayGet (false) as $col)
|
||||||
{
|
{
|
||||||
$pos = strpos ($col, "(");
|
$col = str_replace ($this->sep.$this->tableprefix.$this->table.
|
||||||
if ($pos !== false)
|
$this->sep.".", "", $col);
|
||||||
$columns[] = substr ($col, 0, $pos+1).
|
if ($col[0] === $this->sep)
|
||||||
substr ($col, $pos+2, -2).")";
|
$col = substr ($col, 1);
|
||||||
else
|
if (substr ($col, -1) === $this->sep &&
|
||||||
$columns[] = substr ($col, 1 + strrpos ($col, $this->sep, -2), -1);
|
strpos ($col, " AS ".$this->sep) === false)
|
||||||
|
{
|
||||||
|
$col = substr ($col, 0, -1);
|
||||||
|
}
|
||||||
|
$columns[] = $col;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -2754,6 +2758,12 @@ class dblayeroo
|
|||||||
elseif (strtolower ($fieldsAll[$columns[$colNb]][0]) ===
|
elseif (strtolower ($fieldsAll[$columns[$colNb]][0]) ===
|
||||||
"integer")
|
"integer")
|
||||||
$val = intval ($val);
|
$val = intval ($val);
|
||||||
|
if (($pos = strpos ($columns[$colNb], " AS ".$this->sep)) !== false)
|
||||||
|
{
|
||||||
|
$pos += strlen (" AS ".$this->sep);
|
||||||
|
$colName = substr ($columns[$colNb], $pos, -1);
|
||||||
|
}
|
||||||
|
else
|
||||||
$colName = str_replace ($this->sep, "", $columns[$colNb]);
|
$colName = str_replace ($this->sep, "", $columns[$colNb]);
|
||||||
$result[$rownb][$colName] = $val;
|
$result[$rownb][$colName] = $val;
|
||||||
unset ($result[$rownb][$colNb]);
|
unset ($result[$rownb][$colNb]);
|
||||||
|
|||||||
Reference in New Issue
Block a user