改名
This commit is contained in:
@@ -123,13 +123,8 @@ trait Builder
|
||||
if (empty($where)) return '';
|
||||
if (is_string($where)) return $where;
|
||||
foreach ($where as $key => $value) {
|
||||
if (is_string($key)) {
|
||||
$_value = sprintf('%s=\'%s\'', $key, $value);
|
||||
} else if (is_string($value)) {
|
||||
$_value = $value;
|
||||
} else {
|
||||
$_value = $this->_arrayMap($value, $_tmp);
|
||||
}
|
||||
$_value = $this->resolveCondition($key, $value, $_tmp);
|
||||
|
||||
if (empty($_value)) continue;
|
||||
$_tmp[] = $_value;
|
||||
}
|
||||
@@ -140,6 +135,27 @@ trait Builder
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param $field
|
||||
* @param $condition
|
||||
* @param $_tmp
|
||||
* @return string
|
||||
* @throws NotFindClassException
|
||||
* @throws ReflectionException
|
||||
*/
|
||||
private function resolveCondition($field, $condition, $_tmp): string
|
||||
{
|
||||
if (is_string($field)) {
|
||||
$_value = sprintf('%s=\'%s\'', $field, $condition);
|
||||
} else if (is_string($condition)) {
|
||||
$_value = $condition;
|
||||
} else {
|
||||
$_value = $this->_arrayMap($condition, $_tmp);
|
||||
}
|
||||
return $_value;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param $condition
|
||||
* @param $array
|
||||
|
||||
Reference in New Issue
Block a user