update db options
This commit is contained in:
parent
9252c3d537
commit
454dd3deff
@ -231,17 +231,20 @@ trait BaseOptionsTrait
|
|||||||
*
|
*
|
||||||
* @time 2020年01月13日
|
* @time 2020年01月13日
|
||||||
* @param $field
|
* @param $field
|
||||||
|
* @param string $table
|
||||||
* @return array|string
|
* @return array|string
|
||||||
*/
|
*/
|
||||||
public function aliasField($field)
|
public function aliasField($field, $table = '')
|
||||||
{
|
{
|
||||||
|
$table = $table ? Utils::tableWithPrefix($table) : $this->getTable();
|
||||||
|
|
||||||
if (is_string($field)) {
|
if (is_string($field)) {
|
||||||
return sprintf('%s.%s', $this->getTable(), $field);
|
return sprintf('%s.%s', $table, $field);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_array($field)) {
|
if (is_array($field)) {
|
||||||
foreach ($field as &$value) {
|
foreach ($field as &$value) {
|
||||||
$value = sprintf('%s.%s', $this->getTable(), $value);
|
$value = sprintf('%s.%s', $table, $value);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $field;
|
return $field;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user