0

模特协会:

Entity_Department.hasOne('entity', db.models.entity, {reverse: 'entity_departments'});  

Entity_Department.hasOne('entity_location', db.models.entity_locations, {reverse:'admin'}); 

服务器端控制器:

Entity_Location.get(entity_locations_id, function(err, entity_locations){

    entity_locations.getAdmin(function(err, departments){

        for(var i = 0; i < departments.length; i++ ){
            departments[i].ede_is_deleted = true;
            departments[i].ede_updated_at = new Date();
        }

它表明这getAdmin()不是一个函数。同样的概念也适用于其他模型,那么我哪里错了?

4

0 回答 0