HasMany issue

hi,

i am trying to implement hasMany function however the query generated is wrong

i have two tables modules and menu

    return $this->hasMany(menu::className(), ['moduleapp' => 'module'])->onCondition(['menutype' => 'MAINMENU']);

the generated query is

SELECT * FROM menu WHERE (0=1) AND (menutype=‘MAINMENU’)

why its not joining the other table? and why its showing 0=1

regards,

Please show your model properties, classname, etc. The problem could also be in how you set up your database schema.