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
319a7d4e
Commit
319a7d4e
authored
Apr 17, 2020
by
任国军
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
report add userInfo
parent
79bfefd0
Pipeline
#21796
passed with stage
in 12 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
report.js
app/service/course/v5/report.js
+8
-2
No files found.
app/service/course/v5/report.js
View file @
319a7d4e
...
@@ -104,9 +104,12 @@ class ReportService extends Service {
...
@@ -104,9 +104,12 @@ class ReportService extends Service {
const
tags
=
await
this
.
getReportTags
(
userReportInfo
);
const
tags
=
await
this
.
getReportTags
(
userReportInfo
);
const
recommendClassList
=
await
this
.
getRecommendClassListByReport
(
userReportInfo
.
answer
);
const
recommendClassList
=
await
this
.
getRecommendClassListByReport
(
userReportInfo
.
answer
);
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'
]
});
const
ret
=
{
const
ret
=
{
tags
,
tags
,
report
,
report
,
user
:
userBabyInfo
,
recommend_class_list
:
recommendClassList
,
recommend_class_list
:
recommendClassList
,
};
};
...
@@ -116,7 +119,7 @@ class ReportService extends Service {
...
@@ -116,7 +119,7 @@ class ReportService extends Service {
async
getReportById
(
reportId
)
{
async
getReportById
(
reportId
)
{
const
{
ctx
}
=
this
;
const
{
ctx
}
=
this
;
const
userReportInfo
=
await
ctx
.
classModel
.
V5
.
CourseUserReport
.
findOne
({
user_uuid
:
ctx
.
userUuid
,
id
:
reportId
,
status
:
1
,
is_deleted
:
0
});
const
userReportInfo
=
await
ctx
.
classModel
.
V5
.
CourseUserReport
.
findOne
({
id
:
reportId
,
status
:
1
,
is_deleted
:
0
});
if
(
ctx
.
isEmpty
(
userReportInfo
))
{
if
(
ctx
.
isEmpty
(
userReportInfo
))
{
ctx
.
failed
(
'尚未生成报告'
);
ctx
.
failed
(
'尚未生成报告'
);
}
}
...
@@ -140,9 +143,12 @@ class ReportService extends Service {
...
@@ -140,9 +143,12 @@ class ReportService extends Service {
const
tags
=
await
this
.
getReportTags
(
userReportInfo
);
const
tags
=
await
this
.
getReportTags
(
userReportInfo
);
const
recommendClassList
=
await
this
.
getRecommendClassListByReport
(
userReportInfo
.
answer
);
const
recommendClassList
=
await
this
.
getRecommendClassListByReport
(
userReportInfo
.
answer
);
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'
]
});
const
ret
=
{
const
ret
=
{
tags
,
tags
,
report
,
report
,
user
:
userBabyInfo
,
recommend_class_list
:
recommendClassList
,
recommend_class_list
:
recommendClassList
,
};
};
...
@@ -186,7 +192,7 @@ class ReportService extends Service {
...
@@ -186,7 +192,7 @@ class ReportService extends Service {
// 获取标签
// 获取标签
async
getReportTags
(
report
)
{
async
getReportTags
(
report
)
{
const
{
ctx
}
=
this
;
const
{
ctx
}
=
this
;
const
userBabyInfo
=
await
ctx
.
classModel
.
V5
.
CourseV5UserBaby
.
findOne
({
where
:
{
user_uuid
:
ctx
.
userU
uid
,
status
:
1
,
is_deleted
:
0
}
});
const
userBabyInfo
=
await
ctx
.
classModel
.
V5
.
CourseV5UserBaby
.
findOne
({
where
:
{
user_uuid
:
report
.
user_u
uid
,
status
:
1
,
is_deleted
:
0
}
});
const
tags
=
[];
const
tags
=
[];
if
(
userBabyInfo
.
baby_sex
===
1
)
{
if
(
userBabyInfo
.
baby_sex
===
1
)
{
...
...
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