Commit 8e81b9fa by 蒋勇

d

parent f1a899c4
......@@ -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