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
8af0ae18
Commit
8af0ae18
authored
Apr 23, 2020
by
任国军
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
category add is_have & report add id
parent
769f9563
Pipeline
#22093
passed with stage
in 32 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
0 deletions
+9
-0
option.js
app/service/course/v5/option.js
+8
-0
report.js
app/service/course/v5/report.js
+1
-0
No files found.
app/service/course/v5/option.js
View file @
8af0ae18
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
const
Service
=
require
(
'egg'
).
Service
;
const
Service
=
require
(
'egg'
).
Service
;
const
moment
=
require
(
'moment'
);
const
moment
=
require
(
'moment'
);
const
R
=
require
(
'ramda'
);
const
MODE
=
[
const
MODE
=
[
{
{
...
@@ -150,6 +151,12 @@ class OptionService extends Service {
...
@@ -150,6 +151,12 @@ class OptionService extends Service {
}
}
}
}
}
}
// 智能选课要判断是否有报告
let
reportFilterIds
=
[];
if
(
type
===
3
)
{
const
userReportList
=
await
ctx
.
classModel
.
V5
.
CourseUserReport
.
findAll
({
where
:
{
user_uuid
:
ctx
.
userUuid
,
status
:
1
,
is_deleted
:
0
},
attributes
:
[
'cat_id'
]
});
reportFilterIds
=
R
.
pluck
(
'cat_id'
,
userReportList
);
}
const
results
=
[];
const
results
=
[];
for
(
const
v
of
categoryList
)
{
for
(
const
v
of
categoryList
)
{
...
@@ -163,6 +170,7 @@ class OptionService extends Service {
...
@@ -163,6 +170,7 @@ class OptionService extends Service {
is_open
:
v
.
is_open
,
is_open
:
v
.
is_open
,
url
:
v
.
url
,
url
:
v
.
url
,
is_valid
:
filterIds
.
includes
(
v
.
id
)
?
0
:
1
,
is_valid
:
filterIds
.
includes
(
v
.
id
)
?
0
:
1
,
is_have
:
reportFilterIds
.
includes
(
v
.
id
)
?
0
:
1
,
sort
:
v
.
sort
,
sort
:
v
.
sort
,
});
});
}
}
...
...
app/service/course/v5/report.js
View file @
8af0ae18
...
@@ -113,6 +113,7 @@ class ReportService extends Service {
...
@@ -113,6 +113,7 @@ class ReportService extends Service {
const
ret
=
{
const
ret
=
{
id
:
userReportInfo
.
id
,
category
:
ctx
.
isEmpty
(
category
)
?
{}
:
category
,
category
:
ctx
.
isEmpty
(
category
)
?
{}
:
category
,
tags
,
tags
,
report
,
report
,
...
...
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