swoft-cloud / swoft

🚀 PHP Microservice Full Coroutine Framework
https://swoft.org
Apache License 2.0
5.58k stars 786 forks source link

不能切换数据库 #331

Closed webphplove closed 6 years ago

webphplove commented 6 years ago
Q A
Bug report? yes
Feature request? no
Swoft version v1.0.21
Swoole version 4.0.0
PHP version php7.20
Runtime environment deepin
Swoft-db v1.1.18

使用selectInstance不能切换数据库

$result = Query::table('sms_recv')->selectInstance('spcard')->get()->getResult();

错误返回的是

{
    "msg": "the pool of spcard.master is not exist!",
    "file": "/media/project/swoft/vendor/swoft/framework/src/App.php",
    "line": 197,
    "code": 0
}

我在.env已经配置了spcard的链接

limingxinleo commented 6 years ago

你Pool写了么? 你是否是只配置了.env 。。。

huangzhhui commented 6 years ago

如Pool配置配置正确后仍旧重现再开启此issue,先关掉了