A
A
AlexSer2018-04-03 14:39:30
Yii
AlexSer, 2018-04-03 14:39:30

Why doesn't Joinwith work with a parameter?

$organization_id=User::findOne(Yii::$app->user->id)->personal->organization->id;
   $query = Mani::find()->where('status!=9')->orWhere('status is Null')->joinWith(['history' => function ($q) {
            $q->where('history_mans.organization_id=:id',[':id'=>$organizaion_id]);
        }]);

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vitaly Khomenko, 2018-04-03
@AlexSer

function ($q) use ($organizaion_id)
This is a closure

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question