top-think / think

ThinkPHP Framework ——十年匠心的高性能PHP框架
http://www.thinkphp.cn
Other
7.83k stars 1.62k forks source link

tp6 BelongsToMany关联模型加field报错:strpos() expects parameter 1 to be string, object given #1116

Closed felixwann closed 1 year ago

felixwann commented 2 years ago

ThinkPHP版本:6.0.0
think-orm:2.0 image

felixwann commented 2 years ago

加上这一串代码,问题解决了

if ($field instanceof \think\db\Raw) {
    $field = $field->getValue();
}

image

shirne commented 2 years ago

加上这一串代码,问题解决了

应该判断是Db::raw就跳过吧,用了raw就是不希望系统再适配的

zcenet commented 1 year ago

邮箱已收到,谢谢你的支持,祝你生活愉快~~=================================杨怀桂手机:13698971401