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

Popular posts from this blog

java - Run spring boot application error: Cannot instantiate interface org.springframework.context.ApplicationListener -

reactjs - React router and this.props.children - how to pass state to this.props.children -

Excel VBA "Microsoft Windows Common Controls 6.0 (SP6)" Location Changes -