0
我想在这里创建基于类型字段的条件选择。为什么$exp->addCase()
呼叫无效,它说,addCase()
是未知方法?Cakephp 3子查询表达式
$query->select(function ($exp) use ($query) {
$concatPerson = $query->func()->concat(['lastname' => 'literal', ', ', 'firstnames' => 'literal']);
return $exp->addCase(
[
$query->newExpr()->eq('type', 1),
$query->newExpr()->eq('type', 2),
],
[$concatPerson, 'business_name'],
['string', 'string']
);
});
感谢您的。这是有用的信息。 – makallio85