In your model class there should be a method call relations and it should be like -
public function relations()
// NOTE: you may need to adjust the relation name and the related
// class name for the relations automatically generated below.
'location'=>array(self::BELONGS_TO, 'location', 'LocationId'),
Here is the sample code to give you an example. Here my current model has LocationId as a foreign key which is pointing to my location table. I didn't understand your relations between the tables, so I couldn't write specific to your need. You need to read about - how to define relations in AR.
While calling your way is correct, other way is -
and in the function getEmployeesNotInStruct,it’s should be:
public function getEmployeesNotInStruct($groupID)
))->findAll('t.id NOT IN (SELECT employee_id FROM groupstruct WHERE group_id = '.$groupID.')'
the results is what i want.
Thank you ps_sach,you give me some idea,and thank you Horacio Segura,he give me help too in another post.