Commit 0dd9fd18 by 王勇飞

Merge branch 'center-manage' of gitlab.gongsibao.com:jiangyong/zhichan into center-manage

parents ca46cf8a 8e81b9fa
......@@ -177,7 +177,13 @@ class Dao {
qcwhere["attributes"] = {};
qcwhere["attributes"] = aggArray;
qcwhere["raw"] = true;
var aggResult = await this.model.findOne(qcwhere);
//提高效率去掉关联和排序,数据记录数量,为聚合
let tmpwhere={
attributes:qcwhere.attributes,
raw:true,
where:qcwhere.where
}
var aggResult = await this.model.findOne(tmpwhere);
return aggResult;
} else {
return {};
......@@ -186,10 +192,14 @@ class Dao {
}
async findAndCountAll(qobj, t) {
var qc = this.buildQuery(qobj);
var apps = await this.model.findAndCountAll(qc);
let findList={}
let count=await this.findCount({where:qc.where})
var rows = await this.model.findAll(qc);
findList["count"]=count
findList["rows"]=rows
var aggresult = await this.findAggs(qobj, qc);
var rtn = {};
rtn.results = apps;
rtn.results = findList;
rtn.aggresult = aggresult;
return rtn;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment