array( 'on' => '@.customer_id = ?.id', ), ); } public static function scopes() { return array( 'active' => function($q) { return $q->andWhere('@.status = 1'); }, ); } }