Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
5
51business
Project
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
方斌
51business
Commits
79bfefd0
Commit
79bfefd0
authored
Apr 17, 2020
by
任国军
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
category add more params
parent
15643861
Pipeline
#21794
passed with stage
in 14 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
5 deletions
+18
-5
courseV5Category.js
app/model/class/v5/courseV5Category.js
+2
-0
option.js
app/service/course/v5/option.js
+2
-0
report.js
app/service/course/v5/report.js
+14
-5
No files found.
app/model/class/v5/courseV5Category.js
View file @
79bfefd0
...
@@ -18,6 +18,8 @@ module.exports = app => {
...
@@ -18,6 +18,8 @@ module.exports = app => {
selected_icon
:
STRING
,
selected_icon
:
STRING
,
unselected_icon
:
STRING
,
unselected_icon
:
STRING
,
report_icon
:
STRING
,
report_icon
:
STRING
,
is_open
:
INTEGER
,
url
:
STRING
,
status
:
INTEGER
,
status
:
INTEGER
,
is_deleted
:
INTEGER
,
is_deleted
:
INTEGER
,
sort
:
INTEGER
,
sort
:
INTEGER
,
...
...
app/service/course/v5/option.js
View file @
79bfefd0
...
@@ -133,6 +133,8 @@ class OptionService extends Service {
...
@@ -133,6 +133,8 @@ class OptionService extends Service {
name
:
v
.
name
,
name
:
v
.
name
,
selected_icon
:
v
.
selected_icon
,
selected_icon
:
v
.
selected_icon
,
unselected_icon
:
v
.
unselected_icon
,
unselected_icon
:
v
.
unselected_icon
,
is_open
:
v
.
is_open
,
url
:
v
.
url
,
sort
:
v
.
sort
,
sort
:
v
.
sort
,
});
});
}
}
...
...
app/service/course/v5/report.js
View file @
79bfefd0
...
@@ -154,21 +154,30 @@ class ReportService extends Service {
...
@@ -154,21 +154,30 @@ class ReportService extends Service {
const
{
ctx
}
=
this
;
const
{
ctx
}
=
this
;
const
userUuid
=
ctx
.
userUuid
;
const
userUuid
=
ctx
.
userUuid
;
le
t
userReportList
=
await
ctx
.
classModel
.
V5
.
CourseUserReport
.
findAll
({
where
:
{
user_uuid
:
userUuid
,
status
:
1
,
is_deleted
:
0
}
});
cons
t
userReportList
=
await
ctx
.
classModel
.
V5
.
CourseUserReport
.
findAll
({
where
:
{
user_uuid
:
userUuid
,
status
:
1
,
is_deleted
:
0
}
});
const
categoryIds
=
_
.
uniq
(
R
.
pluck
(
'cat_id'
,
userReportList
));
const
categoryIds
=
_
.
uniq
(
R
.
pluck
(
'cat_id'
,
userReportList
));
userReportList
=
_
.
groupBy
(
userReportList
,
'cat_id'
);
let
categoryList
=
await
ctx
.
classModel
.
V5
.
CourseV5Category
.
findAll
({
where
:
{
id
:
{
$in
:
categoryIds
}
}
});
let
categoryList
=
await
ctx
.
classModel
.
V5
.
CourseV5Category
.
findAll
({
where
:
{
id
:
{
$in
:
categoryIds
}
}
});
categoryList
=
_
.
groupBy
(
categoryList
,
'id'
);
categoryList
=
_
.
groupBy
(
categoryList
,
'id'
);
const
results
=
[];
const
results
=
[];
for
(
const
i
in
userReportList
)
{
const
checkIds
=
[];
for
(
const
v
of
userReportList
)
{
if
(
!
checkIds
.
includes
(
v
.
cat_id
))
{
const
category
=
ctx
.
isEmpty
(
categoryList
[
v
.
cat_id
])
?
''
:
categoryList
[
v
.
cat_id
][
0
].
name
;
results
.
push
({
id
:
v
.
id
,
title
:
category
+
'选课报告'
,
icon
:
ctx
.
isEmpty
(
categoryList
[
v
.
cat_id
])
?
''
:
categoryList
[
v
.
cat_id
][
0
].
report_icon
,
created_time
:
v
.
created_time
,
});
checkIds
.
push
(
v
.
cat_id
);
}
}
}
const
ret
=
{
const
ret
=
{
list
:
results
,
list
:
results
,
total_count
:
0
,
total_count
:
results
.
length
,
};
};
return
ret
;
return
ret
;
...
...
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