top-think/think

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

felixwann opened this issue · 3 comments

ThinkPHP版本:6.0.0
think-orm:2.0
image

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

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

image

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

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