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
9317fa44
Commit
9317fa44
authored
Apr 29, 2020
by
任国军
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
report add categoryId & options categoryList add report_id
parent
dbafe985
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
4 deletions
+6
-4
option.js
app/service/course/v5/option.js
+4
-2
report.js
app/service/course/v5/report.js
+2
-2
No files found.
app/service/course/v5/option.js
View file @
9317fa44
...
@@ -153,9 +153,11 @@ class OptionService extends Service {
...
@@ -153,9 +153,11 @@ class OptionService extends Service {
}
}
// 智能选课要判断是否有报告
// 智能选课要判断是否有报告
let
reportFilterIds
=
[];
let
reportFilterIds
=
[];
let
userReportList
=
[];
if
(
type
===
3
)
{
if
(
type
===
3
)
{
const
userReportList
=
await
ctx
.
classModel
.
V5
.
CourseUserReport
.
findAll
({
where
:
{
user_uuid
:
ctx
.
userUuid
,
status
:
1
,
is_deleted
:
0
},
attributes
:
[
'cat_id'
]
});
userReportList
=
await
ctx
.
classModel
.
V5
.
CourseUserReport
.
findAll
({
where
:
{
user_uuid
:
ctx
.
userUuid
,
status
:
1
,
is_deleted
:
0
},
attributes
:
[
'id'
,
'cat_id'
],
raw
:
true
});
reportFilterIds
=
R
.
pluck
(
'cat_id'
,
userReportList
);
reportFilterIds
=
R
.
pluck
(
'cat_id'
,
userReportList
);
userReportList
=
_
.
groupBy
(
userReportList
,
'cat_id'
);
}
}
const
results
=
[];
const
results
=
[];
...
@@ -170,7 +172,7 @@ class OptionService extends Service {
...
@@ -170,7 +172,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
)
?
1
:
0
,
report_id
:
reportFilterIds
.
includes
(
v
.
id
)
?
(
ctx
.
isEmpty
(
userReportList
[
v
.
id
])
?
0
:
userReportList
[
v
.
id
][
0
].
id
)
:
0
,
sort
:
v
.
sort
,
sort
:
v
.
sort
,
});
});
}
}
...
...
app/service/course/v5/report.js
View file @
9317fa44
...
@@ -91,7 +91,7 @@ class ReportService extends Service {
...
@@ -91,7 +91,7 @@ class ReportService extends Service {
ctx
.
failed
(
'尚未生成报告'
);
ctx
.
failed
(
'尚未生成报告'
);
}
}
const
category
=
await
ctx
.
classModel
.
V5
.
CourseV5Category
.
findOne
({
where
:
{
id
:
userReportInfo
.
cat_id
},
attributes
:
[
'name'
,
'url'
]
});
const
category
=
await
ctx
.
classModel
.
V5
.
CourseV5Category
.
findOne
({
where
:
{
id
:
userReportInfo
.
cat_id
},
attributes
:
[
'
id'
,
'
name'
,
'url'
]
});
const
userBabyInfo
=
await
ctx
.
classModel
.
V5
.
CourseV5UserBaby
.
findOne
({
where
:
{
user_uuid
:
userReportInfo
.
user_uuid
,
status
:
1
,
is_deleted
:
0
},
attributes
:
[
'user_uuid'
,
'baby_sex'
,
'baby_name'
,
'baby_age'
]
});
const
userBabyInfo
=
await
ctx
.
classModel
.
V5
.
CourseV5UserBaby
.
findOne
({
where
:
{
user_uuid
:
userReportInfo
.
user_uuid
,
status
:
1
,
is_deleted
:
0
},
attributes
:
[
'user_uuid'
,
'baby_sex'
,
'baby_name'
,
'baby_age'
]
});
// 获取年龄对应的报告选项
// 获取年龄对应的报告选项
const
ageToReport
=
await
ctx
.
classModel
.
V5
.
CourseV5AgeToReportColumnDetail
.
findAll
({
where
:
{
age_id
:
userBabyInfo
.
baby_age
,
status
:
1
,
is_deleted
:
0
}
});
const
ageToReport
=
await
ctx
.
classModel
.
V5
.
CourseV5AgeToReportColumnDetail
.
findAll
({
where
:
{
age_id
:
userBabyInfo
.
baby_age
,
status
:
1
,
is_deleted
:
0
}
});
...
@@ -138,7 +138,7 @@ class ReportService extends Service {
...
@@ -138,7 +138,7 @@ class ReportService extends Service {
ctx
.
failed
(
'尚未生成报告'
);
ctx
.
failed
(
'尚未生成报告'
);
}
}
const
category
=
await
ctx
.
classModel
.
V5
.
CourseV5Category
.
findOne
({
where
:
{
id
:
userReportInfo
.
cat_id
},
attributes
:
[
'name'
,
'url'
]
});
const
category
=
await
ctx
.
classModel
.
V5
.
CourseV5Category
.
findOne
({
where
:
{
id
:
userReportInfo
.
cat_id
},
attributes
:
[
'
id'
,
'
name'
,
'url'
]
});
const
userBabyInfo
=
await
ctx
.
classModel
.
V5
.
CourseV5UserBaby
.
findOne
({
where
:
{
user_uuid
:
userReportInfo
.
user_uuid
,
status
:
1
,
is_deleted
:
0
},
attributes
:
[
'user_uuid'
,
'baby_sex'
,
'baby_name'
,
'baby_age'
]
});
const
userBabyInfo
=
await
ctx
.
classModel
.
V5
.
CourseV5UserBaby
.
findOne
({
where
:
{
user_uuid
:
userReportInfo
.
user_uuid
,
status
:
1
,
is_deleted
:
0
},
attributes
:
[
'user_uuid'
,
'baby_sex'
,
'baby_name'
,
'baby_age'
]
});
// 获取年龄对应的报告选项
// 获取年龄对应的报告选项
const
ageToReport
=
await
ctx
.
classModel
.
V5
.
CourseV5AgeToReportColumnDetail
.
findAll
({
where
:
{
age_id
:
userBabyInfo
.
baby_age
,
status
:
1
,
is_deleted
:
0
}
});
const
ageToReport
=
await
ctx
.
classModel
.
V5
.
CourseV5AgeToReportColumnDetail
.
findAll
({
where
:
{
age_id
:
userBabyInfo
.
baby_age
,
status
:
1
,
is_deleted
:
0
}
});
...
...
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