php - Dynamic query where clause in yii -
i have query
$res = propertydetail::find() ->joinwith('propertyimages') ->all(); $res = $res->where(['pkpropertyidprimary' => 1]);
i receive error:
call member function where() on array
this query contains property image , property detail records. want add clause in dynamic.
how can this?
you need way,
$res = propertydetail::find() ->joinwith('propertyimages'); $res = $res->where(['pkpropertyidprimary' => 1])->all();
Comments
Post a Comment