|
@@ -126,9 +126,9 @@ class SearchDao{
|
|
|
//搜索定额
|
|
//搜索定额
|
|
|
let stdGljIds = [],
|
|
let stdGljIds = [],
|
|
|
comGljIds = [];
|
|
comGljIds = [];
|
|
|
- let stdRations = rationRepId.length === 0 ? [] : await stdRationModel.find(filter).sort({code: 1}).skip(skip.std).limit(limit);
|
|
|
|
|
|
|
+ let stdRations = rationRepId.length === 0 ? [] : await stdRationModel.find(filter).lean().sort({code: 1}).skip(skip.std).limit(limit);
|
|
|
for(let i = 0, len = stdRations.length; i < len; i++){
|
|
for(let i = 0, len = stdRations.length; i < len; i++){
|
|
|
- stdRations[i]._doc.type = 'std';
|
|
|
|
|
|
|
+ stdRations[i].type = 'std';
|
|
|
for(let glj of stdRations[i].rationGljList){
|
|
for(let glj of stdRations[i].rationGljList){
|
|
|
stdGljIds.push(glj.gljId);
|
|
stdGljIds.push(glj.gljId);
|
|
|
}
|
|
}
|
|
@@ -136,9 +136,9 @@ class SearchDao{
|
|
|
let compleRations = [];
|
|
let compleRations = [];
|
|
|
let residueLimit = limit - stdRations.length;
|
|
let residueLimit = limit - stdRations.length;
|
|
|
if (residueLimit > 0) {
|
|
if (residueLimit > 0) {
|
|
|
- compleRations = findCompleRtion ? await compleRationModel.find(compleFilter).sort({code: 1}).skip(skip.comple).limit(residueLimit) : [];
|
|
|
|
|
|
|
+ compleRations = findCompleRtion ? await compleRationModel.find(compleFilter).lean().sort({code: 1}).skip(skip.comple).limit(residueLimit) : [];
|
|
|
for(let i = 0, len = compleRations.length; i <len; i++){
|
|
for(let i = 0, len = compleRations.length; i <len; i++){
|
|
|
- compleRations[i]._doc.type = 'complementary';
|
|
|
|
|
|
|
+ compleRations[i].type = 'complementary';
|
|
|
for(let glj of compleRations[i].rationGljList){
|
|
for(let glj of compleRations[i].rationGljList){
|
|
|
if(glj.type === 'std'){
|
|
if(glj.type === 'std'){
|
|
|
stdGljIds.push(glj.gljId);
|
|
stdGljIds.push(glj.gljId);
|
|
@@ -198,7 +198,7 @@ class SearchDao{
|
|
|
hintsArr.push(`附注:`);
|
|
hintsArr.push(`附注:`);
|
|
|
hintsArr = hintsArr.concat(ration.annotation.split('\n'));
|
|
hintsArr = hintsArr.concat(ration.annotation.split('\n'));
|
|
|
}
|
|
}
|
|
|
- ration._doc.hint = hintsArr.join('<br>');
|
|
|
|
|
|
|
+ ration.hint = hintsArr.join('<br>');
|
|
|
}
|
|
}
|
|
|
for(let ration of compleRations){
|
|
for(let ration of compleRations){
|
|
|
let hintsArr = [];
|
|
let hintsArr = [];
|
|
@@ -217,7 +217,7 @@ class SearchDao{
|
|
|
hintsArr.push(`附注:`);
|
|
hintsArr.push(`附注:`);
|
|
|
hintsArr = hintsArr.concat(ration.annotation.split('\n'));
|
|
hintsArr = hintsArr.concat(ration.annotation.split('\n'));
|
|
|
}
|
|
}
|
|
|
- ration._doc.hint = hintsArr.join('<br>');
|
|
|
|
|
|
|
+ ration.hint = hintsArr.join('<br>');
|
|
|
}
|
|
}
|
|
|
rst.data = stdRations.concat(compleRations);
|
|
rst.data = stdRations.concat(compleRations);
|
|
|
callback(0, rst);
|
|
callback(0, rst);
|