my table and its data
id |type | email
1 |1 | [email protected]
2 |1 | [email protected]
3 |2 | [email protected]
4 |2 | [email protected]
5 |2 | [email protected]
Their is lots of type 1,2,3,4,5,..
All TYPE has dublicate emails except type 2
but,I want to make column email unique only for type 2 using yii2 model validation
You can use filter and try something like this, not tested though