Revert "改名"

This reverts commit fdf58326
This commit is contained in:
2022-01-08 18:49:06 +08:00
parent 614b601afa
commit ef3e874c0c
55 changed files with 29 additions and 92 deletions
+78
View File
@@ -0,0 +1,78 @@
<?php
declare(strict_types=1);
namespace Database\Condition;
/**
* Class MathematicsCondition
* @package Database\Condition
*/
class MathematicsCondition extends Condition
{
public string $type = '';
/**
* @return mixed
*/
public function builder(): mixed
{
return $this->{strtolower($this->type)}((float)$this->value);
}
/**
* @param $value
* @return string
*/
public function eq($value): string
{
return $this->column . ' = ' . $value;
}
/**
* @param $value
* @return string
*/
public function neq($value): string
{
return $this->column . ' <> ' . $value;
}
/**
* @param $value
* @return string
*/
public function gt($value): string
{
return $this->column . ' > ' . $value;
}
/**
* @param $value
* @return string
*/
public function egt($value): string
{
return $this->column . ' >= ' . $value;
}
/**
* @param $value
* @return string
*/
public function lt($value): string
{
return $this->column . ' < ' . $value;
}
/**
* @param $value
* @return string
*/
public function elt($value): string
{
return $this->column . ' <= ' . $value;
}
}