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
1a3d4127
Commit
1a3d4127
authored
May 09, 2020
by
任国军
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix recommendClass
parent
42c487f7
Pipeline
#22949
passed with stage
in 3 seconds
Changes
1
Pipelines
2
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
report.js
app/service/course/v5/report.js
+4
-1
No files found.
app/service/course/v5/report.js
View file @
1a3d4127
...
@@ -182,7 +182,7 @@ class ReportService extends Service {
...
@@ -182,7 +182,7 @@ class ReportService extends Service {
const
{
ctx
}
=
this
;
const
{
ctx
}
=
this
;
const
userUuid
=
ctx
.
userUuid
;
const
userUuid
=
ctx
.
userUuid
;
const
userReportList
=
await
ctx
.
classModel
.
V5
.
CourseUserReport
.
findAll
({
where
:
{
user_uuid
:
userUuid
,
status
:
1
,
is_deleted
:
0
}
});
const
userReportList
=
await
ctx
.
classModel
.
V5
.
CourseUserReport
.
findAll
({
where
:
{
user_uuid
:
userUuid
,
status
:
1
,
is_deleted
:
0
}
,
order
:
[[
'id'
,
'desc'
]]
});
const
categoryIds
=
_
.
uniq
(
R
.
pluck
(
'cat_id'
,
userReportList
));
const
categoryIds
=
_
.
uniq
(
R
.
pluck
(
'cat_id'
,
userReportList
));
let
categoryList
=
await
ctx
.
classModel
.
V5
.
CourseV5Category
.
findAll
({
where
:
{
id
:
{
$in
:
categoryIds
}
}
});
let
categoryList
=
await
ctx
.
classModel
.
V5
.
CourseV5Category
.
findAll
({
where
:
{
id
:
{
$in
:
categoryIds
}
}
});
...
@@ -346,6 +346,8 @@ class ReportService extends Service {
...
@@ -346,6 +346,8 @@ class ReportService extends Service {
tmpClassList
=
await
ctx
.
classModel
.
V5
.
CourseV5ClassToColumn
.
findAll
(
tmpFilter
);
tmpClassList
=
await
ctx
.
classModel
.
V5
.
CourseV5ClassToColumn
.
findAll
(
tmpFilter
);
classIds
=
classFlag
?
_
.
intersection
(
classIds
,
R
.
pluck
(
'class_id'
,
tmpClassList
))
:
R
.
pluck
(
'class_id'
,
tmpClassList
);
classIds
=
classFlag
?
_
.
intersection
(
classIds
,
R
.
pluck
(
'class_id'
,
tmpClassList
))
:
R
.
pluck
(
'class_id'
,
tmpClassList
);
classFlag
=
true
;
classFlag
=
true
;
console
.
log
(
v
);
console
.
log
(
classIds
);
}
}
}
}
}
}
...
@@ -353,6 +355,7 @@ class ReportService extends Service {
...
@@ -353,6 +355,7 @@ class ReportService extends Service {
let
category
=
await
ctx
.
classModel
.
V5
.
CourseV5Category
.
findOne
({
where
:
{
id
:
catId
}
});
let
category
=
await
ctx
.
classModel
.
V5
.
CourseV5Category
.
findOne
({
where
:
{
id
:
catId
}
});
category
=
ctx
.
isEmpty
(
category
)
?
0
:
category
.
bind
;
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'
]
});
tmpClassList
=
await
ctx
.
classModel
.
V5
.
CourseV5ClassToCat
.
findAll
({
where
:
{
cat_id
:
category
,
status
:
1
,
is_deleted
:
0
},
attributes
:
[
'class_id'
]
});
classIds
=
classFlag
?
_
.
intersection
(
classIds
,
R
.
pluck
(
'class_id'
,
tmpClassList
))
:
R
.
pluck
(
'class_id'
,
tmpClassList
);
classIds
=
classFlag
?
_
.
intersection
(
classIds
,
R
.
pluck
(
'class_id'
,
tmpClassList
))
:
R
.
pluck
(
'class_id'
,
tmpClassList
);
// 年级筛选
// 年级筛选
tmpClassList
=
await
ctx
.
classModel
.
V5
.
CourseV5ClassToAge
.
findAll
({
where
:
{
age_id
:
babyAge
,
status
:
1
,
is_deleted
:
0
},
attributes
:
[
'class_id'
]
});
tmpClassList
=
await
ctx
.
classModel
.
V5
.
CourseV5ClassToAge
.
findAll
({
where
:
{
age_id
:
babyAge
,
status
:
1
,
is_deleted
:
0
},
attributes
:
[
'class_id'
]
});
...
...
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