报错如下:
[think\exception\ErrorException]
Argument 4 passed to think\db\Builder::parseExp() must be an instance of think\db\Expression, string given, called in /data/wwwroot/default/dbwd/thinkphp/library/think/db/Builder.php on line 424 and defined
文件/thinkphp/library/think/db/Builder.php第424行的代码
$whereStr = $this->$fun($query, $key, $exp, $value, $field, $bindType, isset($val[2]) ? $val[2] : 'AND');
这里的$fun第四个参数$value为啥传递字符串而下面这里却要求ex第499到503行的代码
protected function parseExp(Query $query, $key, $exp, Expression $value, $field, $bindType)
{
// 表达式查询
return '( ' . $key . ' ' . $value->getValue() . ' )';
}
最佳答案
