/** * Created by Zhong on 2017/12/22. */ let rationRepositoryModel = require('../../ration_repository/models/repository_map').Model; class CompleViewModel { async getRationLib(rationRepId, callback){ try{ let rationLib = await rationRepositoryModel.find({ID: rationRepId, $or: [{deleted: null}, {deleted: false}]}); callback(0, rationLib); } catch(err) { callback(err, null); } } async getRationLibs(compilationId, callback){ try{ let rationLibs = await rationRepositoryModel.find({compilationId: compilationId, $or: [{deleted: null}, {deleted: false}]}); callback(0, rationLibs); } catch(err) { callback(err, null); } } } export default CompleViewModel;