hasMany(Order::className(), ['customer_id' => 'id']); } public static function active($query) { $query->andWhere(['status' => 1]); } }