modify plugin name

This commit is contained in:
2022-06-09 10:40:43 +08:00
parent d9b9b78128
commit 7d5aec2716
2 changed files with 27 additions and 60 deletions
+14 -14
View File
@@ -85,7 +85,7 @@ class ActiveQuery extends Component implements ISqlBuilder
* @param int $size * @param int $size
* @param int $page * @param int $page
* @return array * @return array
* @throws Exception * @throws
*/ */
#[ArrayShape([])] #[ArrayShape([])]
public function pagination(int $size = 20, int $page = 1): array public function pagination(int $size = 20, int $page = 1): array
@@ -145,7 +145,7 @@ class ActiveQuery extends Component implements ISqlBuilder
* @param $sql * @param $sql
* @param array $params * @param array $params
* @return mixed * @return mixed
* @throws Exception * @throws
*/ */
public function execute($sql, array $params = []): Command public function execute($sql, array $params = []): Command
{ {
@@ -155,7 +155,7 @@ class ActiveQuery extends Component implements ISqlBuilder
/** /**
* @return ModelInterface|null * @return ModelInterface|null
* @throws Exception * @throws
*/ */
public function first(): ModelInterface|null public function first(): ModelInterface|null
{ {
@@ -169,7 +169,7 @@ class ActiveQuery extends Component implements ISqlBuilder
/** /**
* @return string * @return string
* @throws Exception * @throws
*/ */
public function toSql(): string public function toSql(): string
{ {
@@ -187,7 +187,7 @@ class ActiveQuery extends Component implements ISqlBuilder
/** /**
* @throws Exception * @throws
*/ */
public function flush(): array|bool|int|string|null public function flush(): array|bool|int|string|null
{ {
@@ -200,7 +200,7 @@ class ActiveQuery extends Component implements ISqlBuilder
* @param callable $callback * @param callable $callback
* @param int $offset * @param int $offset
* @return Pagination * @return Pagination
* @throws Exception * @throws
*/ */
public function page(int $size, callable $callback, int $offset = 0): Pagination public function page(int $size, callable $callback, int $offset = 0): Pagination
{ {
@@ -216,7 +216,7 @@ class ActiveQuery extends Component implements ISqlBuilder
* @param string $setKey * @param string $setKey
* *
* @return array|null * @return array|null
* @throws Exception * @throws
*/ */
public function column(string $field, string $setKey = ''): ?array public function column(string $field, string $setKey = ''): ?array
{ {
@@ -247,7 +247,7 @@ class ActiveQuery extends Component implements ISqlBuilder
/** /**
* @param $data * @param $data
* @return ModelInterface * @return ModelInterface
* @throws Exception * @throws
*/ */
public function populate($data): ModelInterface public function populate($data): ModelInterface
{ {
@@ -269,7 +269,7 @@ class ActiveQuery extends Component implements ISqlBuilder
/** /**
* @return int * @return int
* @throws Exception * @throws
*/ */
public function count(): int public function count(): int
{ {
@@ -284,7 +284,7 @@ class ActiveQuery extends Component implements ISqlBuilder
/** /**
* @param array $data * @param array $data
* @return bool * @return bool
* @throws Exception * @throws
*/ */
public function batchUpdate(array $data): bool public function batchUpdate(array $data): bool
{ {
@@ -298,7 +298,7 @@ class ActiveQuery extends Component implements ISqlBuilder
/** /**
* @param array $data * @param array $data
* @return bool * @return bool
* @throws Exception * @throws
*/ */
public function batchInsert(array $data): bool public function batchInsert(array $data): bool
{ {
@@ -312,7 +312,7 @@ class ActiveQuery extends Component implements ISqlBuilder
* @param $filed * @param $filed
* *
* @return null * @return null
* @throws Exception * @throws
*/ */
public function value($filed) public function value($filed)
{ {
@@ -321,7 +321,7 @@ class ActiveQuery extends Component implements ISqlBuilder
/** /**
* @return bool * @return bool
* @throws Exception * @throws
*/ */
public function exists(): bool public function exists(): bool
{ {
@@ -332,7 +332,7 @@ class ActiveQuery extends Component implements ISqlBuilder
/** /**
* @param bool $getSql * @param bool $getSql
* @return int|bool|string|null * @return int|bool|string|null
* @throws Exception * @throws
*/ */
public function delete(bool $getSql = FALSE): int|bool|string|null public function delete(bool $getSql = FALSE): int|bool|string|null
{ {
+13 -46
View File
@@ -116,8 +116,7 @@ trait QueryTrait
* @param string|array|Closure $condition1 * @param string|array|Closure $condition1
* @param string|array|Closure $condition2 * @param string|array|Closure $condition2
* @return $this * @return $this
* @throws NotFindClassException * @throws
* @throws ReflectionException
*/ */
public function whereIf(string|array|Closure $condition, string|array|Closure $condition1, string|array|Closure $condition2): static public function whereIf(string|array|Closure $condition, string|array|Closure $condition1, string|array|Closure $condition2): static
{ {
@@ -150,7 +149,7 @@ trait QueryTrait
/** /**
* @return string * @return string
* @throws Exception * @throws
*/ */
public function getTable(): string public function getTable(): string
{ {
@@ -195,7 +194,7 @@ trait QueryTrait
* @param string $column * @param string $column
* @return $this * @return $this
*/ */
public function whereAnnotationmpty(string $column): static public function whereNotEmpty(string $column): static
{ {
$this->where[] = $column . ' <> \'\''; $this->where[] = $column . ' <> \'\'';
return $this; return $this;
@@ -315,7 +314,7 @@ trait QueryTrait
* @param $onCondition * @param $onCondition
* @param null $param * @param null $param
* @return $this * @return $this
* @throws Exception * @throws
*/ */
public function leftJoin(string $tableName, string $alias, $onCondition, $param = NULL): static public function leftJoin(string $tableName, string $alias, $onCondition, $param = NULL): static
{ {
@@ -335,7 +334,7 @@ trait QueryTrait
* @param $onCondition * @param $onCondition
* @param null $param * @param null $param
* @return $this * @return $this
* @throws Exception * @throws
*/ */
public function rightJoin($tableName, $alias, $onCondition, $param = NULL): static public function rightJoin($tableName, $alias, $onCondition, $param = NULL): static
{ {
@@ -355,7 +354,7 @@ trait QueryTrait
* @param $onCondition * @param $onCondition
* @param null $param * @param null $param
* @return $this * @return $this
* @throws Exception * @throws
*/ */
public function innerJoin($tableName, $alias, $onCondition, $param = NULL): static public function innerJoin($tableName, $alias, $onCondition, $param = NULL): static
{ {
@@ -507,8 +506,7 @@ trait QueryTrait
* @param string $opera * @param string $opera
* @param null $value * @param null $value
* @return QueryTrait * @return QueryTrait
* @throws NotFindClassException * @throws
* @throws ReflectionException
*/ */
public function whereOr(array|Closure|string $conditionArray = [], string $opera = '=', $value = null): static public function whereOr(array|Closure|string $conditionArray = [], string $opera = '=', $value = null): static
{ {
@@ -546,7 +544,6 @@ trait QueryTrait
* @param string $columns * @param string $columns
* @param string $value * @param string $value
* @return $this * @return $this
* @throws Exception
*/ */
public function whereLike(string $columns, string $value): static public function whereLike(string $columns, string $value): static
{ {
@@ -554,10 +551,6 @@ trait QueryTrait
return $this; return $this;
} }
if (is_array($columns)) {
$columns = 'CONCAT(' . implode(',^,', $columns) . ')';
}
$this->where[] = $columns . ' LIKE \'%' . addslashes($value) . '%\''; $this->where[] = $columns . ' LIKE \'%' . addslashes($value) . '%\'';
return $this; return $this;
@@ -567,7 +560,6 @@ trait QueryTrait
* @param string $columns * @param string $columns
* @param string $value * @param string $value
* @return $this * @return $this
* @throws Exception
*/ */
public function whereLeftLike(string $columns, string $value): static public function whereLeftLike(string $columns, string $value): static
{ {
@@ -575,10 +567,6 @@ trait QueryTrait
return $this; return $this;
} }
if (is_array($columns)) {
$columns = 'CONCAT(' . implode(',^,', $columns) . ')';
}
$this->where[] = $columns . ' LLike \'%' . addslashes($value) . '\''; $this->where[] = $columns . ' LLike \'%' . addslashes($value) . '\'';
return $this; return $this;
@@ -588,7 +576,6 @@ trait QueryTrait
* @param string $columns * @param string $columns
* @param string $value * @param string $value
* @return $this * @return $this
* @throws Exception
*/ */
public function whereRightLike(string $columns, string $value): static public function whereRightLike(string $columns, string $value): static
{ {
@@ -596,10 +583,6 @@ trait QueryTrait
return $this; return $this;
} }
if (is_array($columns)) {
$columns = 'CONCAT(' . implode(',^,', $columns) . ')';
}
$this->where[] = $columns . ' RLike \'' . addslashes($value) . '%\''; $this->where[] = $columns . ' RLike \'' . addslashes($value) . '%\'';
return $this; return $this;
@@ -610,7 +593,6 @@ trait QueryTrait
* @param string $columns * @param string $columns
* @param string $value * @param string $value
* @return $this * @return $this
* @throws Exception
*/ */
public function whereNotLike(string $columns, string $value): static public function whereNotLike(string $columns, string $value): static
{ {
@@ -618,10 +600,6 @@ trait QueryTrait
return $this; return $this;
} }
if (is_array($columns)) {
$columns = 'CONCAT(' . implode(',^,', $columns) . ')';
}
$this->where[] = $columns . ' NOT LIKE \'%' . addslashes($value) . '%\''; $this->where[] = $columns . ' NOT LIKE \'%' . addslashes($value) . '%\'';
return $this; return $this;
@@ -631,7 +609,6 @@ trait QueryTrait
* @param string $column * @param string $column
* @param int $value * @param int $value
* @return $this * @return $this
* @throws Exception
* @see MathematicsCondition * @see MathematicsCondition
*/ */
public function whereEq(string $column, int $value): static public function whereEq(string $column, int $value): static
@@ -646,7 +623,6 @@ trait QueryTrait
* @param string $column * @param string $column
* @param int $value * @param int $value
* @return $this * @return $this
* @throws Exception
* @see MathematicsCondition * @see MathematicsCondition
*/ */
public function whereNeq(string $column, int $value): static public function whereNeq(string $column, int $value): static
@@ -661,7 +637,6 @@ trait QueryTrait
* @param string $column * @param string $column
* @param int $value * @param int $value
* @return $this * @return $this
* @throws Exception
* @see MathematicsCondition * @see MathematicsCondition
*/ */
public function whereGt(string $column, int $value): static public function whereGt(string $column, int $value): static
@@ -675,7 +650,6 @@ trait QueryTrait
* @param string $column * @param string $column
* @param int $value * @param int $value
* @return $this * @return $this
* @throws Exception
* @see MathematicsCondition * @see MathematicsCondition
*/ */
public function whereEgt(string $column, int $value): static public function whereEgt(string $column, int $value): static
@@ -690,7 +664,6 @@ trait QueryTrait
* @param string $column * @param string $column
* @param int $value * @param int $value
* @return $this * @return $this
* @throws Exception
* @see MathematicsCondition * @see MathematicsCondition
*/ */
public function whereLt(string $column, int $value): static public function whereLt(string $column, int $value): static
@@ -704,7 +677,6 @@ trait QueryTrait
* @param string $column * @param string $column
* @param int $value * @param int $value
* @return $this * @return $this
* @throws Exception
* @see MathematicsCondition * @see MathematicsCondition
*/ */
public function whereElt(string $column, int $value): static public function whereElt(string $column, int $value): static
@@ -718,8 +690,7 @@ trait QueryTrait
* @param string $columns * @param string $columns
* @param array|Closure $value * @param array|Closure $value
* @return $this * @return $this
* @throws NotFindClassException * @throws
* @throws ReflectionException
*/ */
public function whereIn(string $columns, array|Closure $value): static public function whereIn(string $columns, array|Closure $value): static
{ {
@@ -737,7 +708,7 @@ trait QueryTrait
/** /**
* @param $value * @param $value
* @return ActiveQuery * @return ActiveQuery
* @throws Exception * @throws
*/ */
public function makeNewQuery($value): ActiveQuery public function makeNewQuery($value): ActiveQuery
{ {
@@ -752,8 +723,7 @@ trait QueryTrait
/** /**
* @return Query * @return Query
* @throws ReflectionException * @throws
* @throws NotFindClassException
*/ */
public function makeNewSqlGenerate(): Query public function makeNewSqlGenerate(): Query
{ {
@@ -768,7 +738,7 @@ trait QueryTrait
*/ */
public function whereNotIn(string $columns, array $value): static public function whereNotIn(string $columns, array $value): static
{ {
if (empty($value) || !is_array($value)) { if (empty($value)) {
$value = [-1]; $value = [-1];
} }
$this->where[] = ['NOT IN', $columns, $value]; $this->where[] = ['NOT IN', $columns, $value];
@@ -828,8 +798,7 @@ trait QueryTrait
* @param string $opera * @param string $opera
* @param null $value * @param null $value
* @return $this * @return $this
* @throws NotFindClassException * @throws
* @throws ReflectionException
*/ */
public function where(Closure|array|string $column, string $opera = '=', $value = null): static public function where(Closure|array|string $column, string $opera = '=', $value = null): static
{ {
@@ -853,9 +822,7 @@ trait QueryTrait
/** /**
* @param Closure|array $closure * @param Closure|array $closure
* @return string * @return string
* @throws NotFindClassException * @throws
* @throws ReflectionException
* @throws Exception
*/ */
public function makeClosureFunction(Closure|array $closure): string public function makeClosureFunction(Closure|array $closure): string
{ {