I just learn and work with Yii2 and I was problem with filter in the LoanSearch model.
I have 3 tables, Customer, Person, and Loan.
for customerModel has relation:
public function getPerson()
{
return $this->hasOne(Person::className(), ['id' => 'person_id']);
}
for LoanModel has relation:
public function getCustomer()
{
return $this->hasOne(Customer::className(), ['id' => 'customer_id']);
}
Purpose: In the loan gridview, i want to filter with person name while the Customer table contain the foreign key of the Person.
Please help to guide me.
thanks.