modify
This commit is contained in:
@@ -47,17 +47,9 @@ abstract class Condition extends BaseObject
|
||||
*/
|
||||
public function setValue($params): void
|
||||
{
|
||||
if (is_object($params)) {
|
||||
var_dump($params);
|
||||
$params = get_object_vars($params);
|
||||
};
|
||||
if (is_array($params)) {
|
||||
$values = [];
|
||||
foreach ($params as $item => $value) {
|
||||
if (is_object($value)) {
|
||||
var_dump($value);
|
||||
continue;
|
||||
};
|
||||
$values[$item] = is_numeric($value) ? $value : '\'' . $value . '\'';
|
||||
}
|
||||
$this->value = $value;
|
||||
|
||||
@@ -200,15 +200,17 @@ trait Builder
|
||||
if (!is_string($condition[2])) {
|
||||
$condition[2] = $this->_hashMap($condition[2]);
|
||||
}
|
||||
return Snowflake::createObject(['class' => OrCondition::class, 'value' => $condition[2], 'column' => $condition[1], 'oldParams' => $array]);
|
||||
}
|
||||
if (isset(ConditionClassMap::$conditionMap[$stroppier])) {
|
||||
$builder = Snowflake::createObject(['class' => OrCondition::class, 'value' => $condition[2], 'column' => $condition[1], 'oldParams' => $array]);
|
||||
}else if (isset(ConditionClassMap::$conditionMap[$stroppier])) {
|
||||
$defaultConfig = ConditionClassMap::$conditionMap[$stroppier];
|
||||
$create = array_merge($defaultConfig, ['column' => $condition[1], 'value' => $condition[2]]);
|
||||
$array[] = Snowflake::createObject($create);
|
||||
$builder = Snowflake::createObject($create);
|
||||
} else {
|
||||
$array[] = Snowflake::createObject(['class' => HashCondition::class, 'value' => $condition]);
|
||||
$builder = Snowflake::createObject(['class' => HashCondition::class, 'value' => $condition]);
|
||||
}
|
||||
|
||||
$array[] = $builder->builder();
|
||||
|
||||
return implode(' AND ', $array);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user