mirror of
https://github.com/devcode-it/openstamanager.git
synced 2025-02-03 01:08:08 +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
|
||||
$select = [];
|
||||
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 : ['*'];
|
||||
|
||||
@ -651,20 +651,4 @@ class Database extends Util\Singleton
|
||||
|
||||
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