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
dac926c3
Commit
dac926c3
authored
Sep 01, 2020
by
任国军
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix category
parent
0323988c
Pipeline
#27799
passed with stage
in 4 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
3 deletions
+9
-3
institution.js
app/service/course/v5/institution.js
+4
-1
option.js
app/service/course/v5/option.js
+1
-1
report.js
app/service/course/v5/report.js
+4
-1
No files found.
app/service/course/v5/institution.js
View file @
dac926c3
...
...
@@ -415,7 +415,10 @@ class InstitutionSubService extends Service {
}
// 科目类型
if
(
!
ctx
.
isEmpty
(
input
.
category
))
{
const
filterByCategory
=
await
ctx
.
classModel
.
V5
.
CourseV5ClassToCat
.
findAll
({
where
:
{
cat_id
:
input
.
category
,
status
:
1
,
is_deleted
:
0
},
attributes
:
[
'class_id'
]
});
let
categoryList
=
await
ctx
.
classModel
.
V5
.
CourseV5Category
.
findAll
({
where
:
{
parent_id
:
input
.
category
,
type
:
1
,
status
:
1
,
is_deleted
:
0
},
attributes
:
[
'id'
]
});
categoryList
=
R
.
pluck
(
'id'
,
categoryList
);
categoryList
.
push
(
input
.
category
);
const
filterByCategory
=
await
ctx
.
classModel
.
V5
.
CourseV5ClassToCat
.
findAll
({
where
:
{
cat_id
:
{
$in
:
categoryList
},
status
:
1
,
is_deleted
:
0
},
attributes
:
[
'class_id'
]
});
filterIds
=
flag
?
_
.
intersection
(
filterIds
,
R
.
pluck
(
'class_id'
,
filterByCategory
))
:
R
.
pluck
(
'class_id'
,
filterByCategory
);
flag
=
true
;
}
...
...
app/service/course/v5/option.js
View file @
dac926c3
...
...
@@ -129,7 +129,7 @@ class OptionService extends Service {
const
type
=
Number
(
input
.
type
)
||
1
;
const
filter
=
{
where
:
{
type
,
is_deleted
:
0
,
status
:
1
},
order
:
[[
'sort'
,
'asc'
],
[
'id'
,
'asc'
]]
};
if
(
type
===
2
)
{
if
(
type
===
2
||
type
===
1
)
{
filter
.
where
.
parent_id
=
parentId
;
}
...
...
app/service/course/v5/report.js
View file @
dac926c3
...
...
@@ -377,7 +377,10 @@ class ReportService extends Service {
// 分类筛选
let
category
=
await
ctx
.
classModel
.
V5
.
CourseV5Category
.
findOne
({
where
:
{
id
:
catId
}
});
category
=
ctx
.
isEmpty
(
category
)
?
0
:
category
.
bind
;
tmpClassList
=
await
ctx
.
classModel
.
V5
.
CourseV5ClassToCat
.
findAll
({
where
:
{
cat_id
:
category
,
status
:
1
,
is_deleted
:
0
},
attributes
:
[
'class_id'
]
});
let
categoryList
=
await
ctx
.
classModel
.
V5
.
CourseV5Category
.
findAll
({
where
:
{
parent_id
:
category
,
type
:
1
,
status
:
1
,
is_deleted
:
0
},
attributes
:
[
'id'
]
});
categoryList
=
R
.
pluck
(
'id'
,
categoryList
);
categoryList
.
push
(
category
);
tmpClassList
=
await
ctx
.
classModel
.
V5
.
CourseV5ClassToCat
.
findAll
({
where
:
{
cat_id
:
{
$in
:
categoryList
},
status
:
1
,
is_deleted
:
0
},
attributes
:
[
'class_id'
]
});
classIds
=
classFlag
?
_
.
intersection
(
classIds
,
R
.
pluck
(
'class_id'
,
tmpClassList
))
:
R
.
pluck
(
'class_id'
,
tmpClassList
);
// 年级筛选
...
...
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