2016-03-07 67 views
0

条款我有这个疑问其中警予

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

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

动态查询我收到此错误:

Call to a member function where() on array

此查询包含一个属性图片和财产明细记录。现在我想在这个动态中添加一个where子句。

我该怎么做?

回答

1

你需要做的这种方式,

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

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

由于ANS先生 –