fix:修复BUG/升级1.1.6版本
This commit is contained in:
13
vendor/webman/think-orm/src/ThinkOrm.php
vendored
13
vendor/webman/think-orm/src/ThinkOrm.php
vendored
@@ -29,10 +29,15 @@ class ThinkOrm implements Bootstrap
|
||||
$manager_instance = $property->getValue();
|
||||
}
|
||||
Timer::add(55, function () use ($manager_instance) {
|
||||
$reflect = new \ReflectionClass($manager_instance);
|
||||
$property = $reflect->getProperty('instance');
|
||||
$property->setAccessible(true);
|
||||
$instances = $property->getValue($manager_instance);
|
||||
$instances = [];
|
||||
if (method_exists($manager_instance, 'getInstance')) {
|
||||
$instances = $manager_instance->getInstance();
|
||||
} else {
|
||||
$reflect = new \ReflectionClass($manager_instance);
|
||||
$property = $reflect->getProperty('instance');
|
||||
$property->setAccessible(true);
|
||||
$instances = $property->getValue($manager_instance);
|
||||
}
|
||||
foreach ($instances as $connection) {
|
||||
/* @var \think\db\connector\Mysql $connection */
|
||||
if ($connection->getConfig('type') == 'mysql') {
|
||||
|
||||
4
vendor/webman/think-orm/src/_ide_helper.php
vendored
4
vendor/webman/think-orm/src/_ide_helper.php
vendored
@@ -82,7 +82,7 @@ namespace think\facade {
|
||||
* @throws \think\db\exception\BindParamException
|
||||
* @throws \PDOException
|
||||
*/
|
||||
public function query(string $sql, array $bind = []): array
|
||||
public static function query(string $sql, array $bind = []): array
|
||||
{
|
||||
/** @var \think\Db $instance */
|
||||
return $instance->query($sql,$bind);
|
||||
@@ -108,7 +108,7 @@ namespace think\facade {
|
||||
* @throws \think\db\exception\BindParamException
|
||||
* @throws \PDOException
|
||||
*/
|
||||
public function execute(string $sql, array $bind = []): int
|
||||
public static function execute(string $sql, array $bind = []): int
|
||||
{
|
||||
/** @var \think\Db $instance */
|
||||
return $instance->execute($sql,$bind);
|
||||
|
||||
Reference in New Issue
Block a user