mirror of
https://github.com/devcode-it/openstamanager.git
synced 2025-02-09 08:08:39 +01:00
Fix select semplificati
This commit is contained in:
parent
7f1a7e1d87
commit
b3f5faba30
@ -442,7 +442,7 @@ class Database extends Util\Singleton
|
|||||||
// Valori da ottenere
|
// Valori da ottenere
|
||||||
$select = [];
|
$select = [];
|
||||||
foreach ((array) $array as $key => $value) {
|
foreach ((array) $array as $key => $value) {
|
||||||
$select[] = $value.(is_numeric($key) ? '' : ' AS '.$this->quote($key));
|
$select[] = $value.(is_numeric($key) ? '' : ' AS '.$key);
|
||||||
}
|
}
|
||||||
$select = !empty($select) ? $select : ['*'];
|
$select = !empty($select) ? $select : ['*'];
|
||||||
|
|
||||||
@ -651,20 +651,4 @@ class Database extends Util\Singleton
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Prepara il campo per l'inserimento in uno statement SQL.
|
|
||||||
*
|
|
||||||
* @since 2.3
|
|
||||||
*
|
|
||||||
* @param string $value
|
|
||||||
*
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
protected function quote($string)
|
|
||||||
{
|
|
||||||
$char = '`';
|
|
||||||
|
|
||||||
return $char.str_replace([$char, '#'], '', $string).$char;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user