modify
This commit is contained in:
+1
-1
@@ -320,7 +320,7 @@ class Db
|
|||||||
|
|
||||||
$table = [' const TABLE = \'select * from %s where REFERENCED_TABLE_NAME=%s\';'];
|
$table = [' const TABLE = \'select * from %s where REFERENCED_TABLE_NAME=%s\';'];
|
||||||
|
|
||||||
return $db->createCommand((new Sql())
|
return $db->createCommand((new Query())
|
||||||
->select('*')
|
->select('*')
|
||||||
->from('INFORMATION_SCHEMA.KEY_COLUMN_USAGE')
|
->from('INFORMATION_SCHEMA.KEY_COLUMN_USAGE')
|
||||||
->where(['REFERENCED_TABLE_NAME' => $table])
|
->where(['REFERENCED_TABLE_NAME' => $table])
|
||||||
|
|||||||
@@ -14,10 +14,10 @@ use Database\Traits\QueryTrait;
|
|||||||
use Exception;
|
use Exception;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class Sql
|
* Class Query
|
||||||
* @package Database
|
* @package Database
|
||||||
*/
|
*/
|
||||||
class Sql implements ISqlBuilder
|
class Query implements ISqlBuilder
|
||||||
{
|
{
|
||||||
|
|
||||||
use QueryTrait;
|
use QueryTrait;
|
||||||
@@ -20,7 +20,7 @@ class SqlBuilder extends Component
|
|||||||
use Builder;
|
use Builder;
|
||||||
|
|
||||||
|
|
||||||
public ActiveQuery|Sql|null $query;
|
public ActiveQuery|Query|null $query;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ use Database\ActiveQuery;
|
|||||||
use Database\Base\ConditionClassMap;
|
use Database\Base\ConditionClassMap;
|
||||||
use Database\Condition\HashCondition;
|
use Database\Condition\HashCondition;
|
||||||
use Database\Condition\OrCondition;
|
use Database\Condition\OrCondition;
|
||||||
use Database\Sql;
|
use Database\Query;
|
||||||
use Database\SqlBuilder;
|
use Database\SqlBuilder;
|
||||||
use Exception;
|
use Exception;
|
||||||
use JetBrains\PhpStorm\Pure;
|
use JetBrains\PhpStorm\Pure;
|
||||||
@@ -103,10 +103,10 @@ trait Builder
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param ActiveQuery|Sql $query
|
* @param ActiveQuery|Query $query
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
#[Pure] private function builderLimit(ActiveQuery|Sql $query): string
|
#[Pure] private function builderLimit(ActiveQuery|Query $query): string
|
||||||
{
|
{
|
||||||
if (!is_numeric($query->limit) || $query->limit < 1) {
|
if (!is_numeric($query->limit) || $query->limit < 1) {
|
||||||
return "";
|
return "";
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ use Closure;
|
|||||||
use Database\ActiveQuery;
|
use Database\ActiveQuery;
|
||||||
use Database\ActiveRecord;
|
use Database\ActiveRecord;
|
||||||
use Database\Condition\MathematicsCondition;
|
use Database\Condition\MathematicsCondition;
|
||||||
use Database\Sql;
|
use Database\Query;
|
||||||
use Exception;
|
use Exception;
|
||||||
use JetBrains\PhpStorm\Pure;
|
use JetBrains\PhpStorm\Pure;
|
||||||
use ReflectionException;
|
use ReflectionException;
|
||||||
@@ -730,13 +730,13 @@ trait QueryTrait
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return Sql
|
* @return Query
|
||||||
* @throws ReflectionException
|
* @throws ReflectionException
|
||||||
* @throws NotFindClassException
|
* @throws NotFindClassException
|
||||||
*/
|
*/
|
||||||
public function makeNewSqlGenerate(): Sql
|
public function makeNewSqlGenerate(): Query
|
||||||
{
|
{
|
||||||
return Snowflake::createObject(Sql::class);
|
return Snowflake::createObject(Query::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ namespace Database\Traits;
|
|||||||
|
|
||||||
|
|
||||||
use Database\ActiveQuery;
|
use Database\ActiveQuery;
|
||||||
use Database\Sql;
|
use Database\Query;
|
||||||
use Exception;
|
use Exception;
|
||||||
use JetBrains\PhpStorm\Pure;
|
use JetBrains\PhpStorm\Pure;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user