think\db\Raw could not be converted to string 错误的处理方式

我使用的是thinkphp 8.0.2 版本,在分页查询使用fileld出现提示think\db\Raw could not be converted to string的问题。

解决方案为,在文件vendor\topthink\think-orm\src\db\Raw中重写tostring即可。

public function __toString()
{
    return (string) $this->value;
}

  

posted @ 2023-12-19 11:41  fogwu  阅读(132)  评论(0编辑  收藏  举报