gpt4 book ai didi

php - yii 中的动态查询 where 子句

转载 作者:行者123 更新时间:2023-11-29 11:40:39 25 4
gpt4 key购买 nike

我有这个查询

$res = propertyDetail::find()
->joinWith('propertyImages')
->all();

$res = $res->where(['pkPropertyIDPrimary' => 1]);

我收到此错误:

Call to a member function where() on array

此查询包含属性图像和属性详细信息记录。现在我想在此动态中添加一个 where 子句。

我该怎么做?

最佳答案

你需要这样做,

$res =  propertyDetail::find()
->joinWith('propertyImages');

$res = $res->where(['pkPropertyIDPrimary' => 1])->all();

关于php - yii 中的动态查询 where 子句,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35837148/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com