I have this bit of code which finds the ID of the logged in user, finds all of the customers that are related to that user and stores the 'custref'(id) into an array:
$chan = Yii::$app->user->identity->typedIdentity->getId();
$cust = Customer::find()->where(['channelref' => $chan])->all();
foreach($cust as $row){
$ref[] = $row->custref;
}
I want to use the values in $ref inside of a query, something like this:
$query = $model::findNongeo()->where(['custref'=>$ref->custref])->all();
But I have no idea how to do it, I have tried all sorts. Any help would be massively appreciated.