tp6指定数据表连接时, 不能对查询数据集用where

浏览:945 发布日期:2020/08/13 分类:ThinkPHP6专区 关键字: tp6 指定数据表连接 数据集 where bug BUG
tp6指定数据表连接时, 不能对查询数据集用where, 如果不指定数据表连接时,是没有问题的。//User Model设置当前模型的数据库连接
protected $connection = 'db_config';
使用select()查询后不能用where$user = User::select();
return $user->where('code','0000'); // 返回 []
return User::where('code','0000')->select(); //正常返回数据
最佳答案
评论( 相关
后面还有条评论,点击查看>>