Answer the question
In order to leave comments, you need to log in
How to make a dropdown list appear in the grid table filter?
I know how to implement it, but I don’t understand how to implement it in yii2, I tried everything in sql, it outputs data normally, here is the sql code that I should get
SELECT otdel.id, otdel.fio FROM `zakaz` JOIN otdel WHERE zakaz.id_sotrud = otdel.id
[
'attribute' => 'id_sotrud',
'value' => 'idSotrud.fio',
'filter' => Zakaz::getSotrudList()
],
public static function getSotrudList()
{
$sotruds = Zakaz::find()
->select(['otdel.id','otdel.fio'])
->join('JOIN','otdel', 'zakaz.id_sotrud = otdel.id')
->all();
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question