Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Z
zhichan
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
蒋勇
zhichan
Commits
8e81b9fa
Commit
8e81b9fa
authored
Jun 25, 2020
by
蒋勇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d
parent
f1a899c4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
3 deletions
+13
-3
center-manage/app/base/db/dao.base.js
+13
-3
No files found.
center-manage/app/base/db/dao.base.js
View file @
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
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment