改名
This commit is contained in:
@@ -152,7 +152,6 @@ class ActiveRecord extends BaseActiveRecord
|
||||
if (empty($condition)) {
|
||||
$condition = [$this->getPrimary() => $this->getPrimaryValue()];
|
||||
}
|
||||
$condition = static::find()->where($condition)->getCondition();
|
||||
$execute = static::getDb()->createCommand()
|
||||
->mathematics(self::getTable(), [$action => $columns], $condition);
|
||||
if ($execute instanceof Command) {
|
||||
|
||||
@@ -144,7 +144,7 @@ class Command extends Component
|
||||
public function mathematics($tableName, $param, $condition): bool|static
|
||||
{
|
||||
$change = $this->db->getSchema()->getChange();
|
||||
$sql = $change->mathematics($tableName, $param, $condition);
|
||||
$sql = $change->mathematics($tableName, $param, [$condition]);
|
||||
if ($sql === false) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -102,7 +102,6 @@ trait Condition
|
||||
private function conditionMap($condition): string
|
||||
{
|
||||
$array = [];
|
||||
var_dump($condition);
|
||||
if (is_string($condition) || empty($condition)) {
|
||||
return $condition;
|
||||
}
|
||||
@@ -227,25 +226,4 @@ trait Condition
|
||||
return ' LIMIT ' . $query->limit;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param $value
|
||||
* @param bool $isSearch
|
||||
* @return int|string
|
||||
*/
|
||||
public function valueEncode($value, $isSearch = false): int|string
|
||||
{
|
||||
if ($isSearch) {
|
||||
return $value;
|
||||
}
|
||||
if (is_numeric($value)) {
|
||||
return $value;
|
||||
} else {
|
||||
if (!is_null(Json::decode($value))) {
|
||||
return $value;
|
||||
}
|
||||
return '\'' . Str::encode($value) . '\'';
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user