Compare commits

...

4 Commits

Author SHA1 Message Date
as2252258 731af328d7 1 2021-11-27 17:43:28 +08:00
as2252258 5756573d8d 改名 2021-11-24 16:56:16 +08:00
as2252258 eb75e69d60 改名 2021-11-24 16:48:25 +08:00
as2252258 6745036672 改名 2021-11-13 04:08:25 +08:00
3 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -822,8 +822,8 @@ abstract class Model extends Component implements ModelInterface, ArrayAccess, T
throw new Exception('You need add static method `tableName` and return table name.'); throw new Exception('You need add static method `tableName` and return table name.');
} }
$table = trim($this->table, '{{%}}'); $table = trim($this->table, '{{%}}');
if (!empty($tablePrefix) && !str_starts_with($this->table, $tablePrefix)) { if (!empty($tablePrefix) && !str_starts_with($table, $tablePrefix)) {
$table = $tablePrefix . $this->table; $table = $tablePrefix . $table;
} }
return '`' . $connection->database . '`.' . $table; return '`' . $connection->database . '`.' . $table;
} }
+1 -1
View File
@@ -194,7 +194,7 @@ trait Builder
$class = $defaultConfig['class']; $class = $defaultConfig['class'];
unset($defaultConfig['class']); unset($defaultConfig['class']);
$builder = Kiri::getDi()->get($class, [], $defaultConfig); $builder = Kiri::getDi()->make($class, [], $defaultConfig);
$builder->setValue($condition[2]); $builder->setValue($condition[2]);
$builder->setColumn($condition[1]); $builder->setColumn($condition[1]);
} else { } else {
+1 -1
View File
@@ -522,7 +522,7 @@ trait QueryTrait
$conditionArray = $this->sprintf($conditionArray, $value, $opera); $conditionArray = $this->sprintf($conditionArray, $value, $opera);
} }
$this->where = ['(' . implode(' AND ', $this->where) . ') OR (' . $conditionArray . ')']; $this->where = ['((' . implode(' AND ', $this->where) . ') OR (' . $conditionArray . '))'];
return $this; return $this;
} }