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
ae520181
Commit
ae520181
authored
May 08, 2020
by
任国军
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ageToReportColumnDetail add catId
parent
b5ab652c
Pipeline
#22881
passed with stage
in 18 seconds
Changes
3
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
5 deletions
+6
-5
courseV5AgeToReportColumnDetail.js
app/model/class/v5/courseV5AgeToReportColumnDetail.js
+1
-0
report.js
app/service/course/v5/report.js
+2
-2
user.js
app/service/course/v5/user.js
+3
-3
No files found.
app/model/class/v5/courseV5AgeToReportColumnDetail.js
View file @
ae520181
...
@@ -13,6 +13,7 @@ module.exports = app => {
...
@@ -13,6 +13,7 @@ module.exports = app => {
autoIncrement
:
true
,
autoIncrement
:
true
,
},
},
age_id
:
INTEGER
,
age_id
:
INTEGER
,
cat_id
:
INTEGER
,
report_column_detail_id
:
INTEGER
,
report_column_detail_id
:
INTEGER
,
status
:
INTEGER
,
status
:
INTEGER
,
is_deleted
:
INTEGER
,
is_deleted
:
INTEGER
,
...
...
app/service/course/v5/report.js
View file @
ae520181
...
@@ -95,7 +95,7 @@ class ReportService extends Service {
...
@@ -95,7 +95,7 @@ class ReportService extends Service {
const
category
=
await
ctx
.
classModel
.
V5
.
CourseV5Category
.
findOne
({
where
:
{
id
:
userReportInfo
.
cat_id
},
attributes
:
[
'id'
,
'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
,
cat_id
:
userReportInfo
.
cat_id
,
status
:
1
,
is_deleted
:
0
}
});
const
ageReportColumnDetailList
=
await
ctx
.
classModel
.
V5
.
CourseV5ReportColumnDetail
.
findAll
({
where
:
{
id
:
{
$in
:
R
.
pluck
(
'report_column_detail_id'
,
ageToReport
)
},
status
:
1
,
is_deleted
:
0
},
attributes
:
[
'id'
,
'report_column_id'
,
'sub_title'
,
'level'
,
'content'
,
'advice'
],
raw
:
true
});
const
ageReportColumnDetailList
=
await
ctx
.
classModel
.
V5
.
CourseV5ReportColumnDetail
.
findAll
({
where
:
{
id
:
{
$in
:
R
.
pluck
(
'report_column_detail_id'
,
ageToReport
)
},
status
:
1
,
is_deleted
:
0
},
attributes
:
[
'id'
,
'report_column_id'
,
'sub_title'
,
'level'
,
'content'
,
'advice'
],
raw
:
true
});
let
reportColumnDetailList
=
ctx
.
isEmpty
(
userReportInfo
.
report_column_detail_ids
)
?
[]
:
await
ctx
.
classModel
.
V5
.
CourseV5ReportColumnDetail
.
findAll
({
where
:
{
id
:
{
$in
:
eval
(
userReportInfo
.
report_column_detail_ids
)
},
status
:
1
,
is_deleted
:
0
},
attributes
:
[
'id'
,
'report_column_id'
,
'sub_title'
,
'level'
,
'content'
,
'advice'
],
raw
:
true
});
let
reportColumnDetailList
=
ctx
.
isEmpty
(
userReportInfo
.
report_column_detail_ids
)
?
[]
:
await
ctx
.
classModel
.
V5
.
CourseV5ReportColumnDetail
.
findAll
({
where
:
{
id
:
{
$in
:
eval
(
userReportInfo
.
report_column_detail_ids
)
},
status
:
1
,
is_deleted
:
0
},
attributes
:
[
'id'
,
'report_column_id'
,
'sub_title'
,
'level'
,
'content'
,
'advice'
],
raw
:
true
});
...
@@ -142,7 +142,7 @@ class ReportService extends Service {
...
@@ -142,7 +142,7 @@ class ReportService extends Service {
const
category
=
await
ctx
.
classModel
.
V5
.
CourseV5Category
.
findOne
({
where
:
{
id
:
userReportInfo
.
cat_id
},
attributes
:
[
'id'
,
'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
,
cat_id
:
userReportInfo
.
cat_id
,
status
:
1
,
is_deleted
:
0
}
});
const
ageReportColumnDetailList
=
await
ctx
.
classModel
.
V5
.
CourseV5ReportColumnDetail
.
findAll
({
where
:
{
id
:
{
$in
:
R
.
pluck
(
'report_column_detail_id'
,
ageToReport
)
},
status
:
1
,
is_deleted
:
0
},
attributes
:
[
'id'
,
'report_column_id'
,
'sub_title'
,
'level'
,
'content'
,
'advice'
],
raw
:
true
});
const
ageReportColumnDetailList
=
await
ctx
.
classModel
.
V5
.
CourseV5ReportColumnDetail
.
findAll
({
where
:
{
id
:
{
$in
:
R
.
pluck
(
'report_column_detail_id'
,
ageToReport
)
},
status
:
1
,
is_deleted
:
0
},
attributes
:
[
'id'
,
'report_column_id'
,
'sub_title'
,
'level'
,
'content'
,
'advice'
],
raw
:
true
});
let
reportColumnDetailList
=
ctx
.
isEmpty
(
userReportInfo
.
report_column_detail_ids
)
?
[]
:
await
ctx
.
classModel
.
V5
.
CourseV5ReportColumnDetail
.
findAll
({
where
:
{
id
:
{
$in
:
eval
(
userReportInfo
.
report_column_detail_ids
)
},
status
:
1
,
is_deleted
:
0
},
attributes
:
[
'id'
,
'report_column_id'
,
'sub_title'
,
'level'
,
'content'
,
'advice'
],
raw
:
true
});
let
reportColumnDetailList
=
ctx
.
isEmpty
(
userReportInfo
.
report_column_detail_ids
)
?
[]
:
await
ctx
.
classModel
.
V5
.
CourseV5ReportColumnDetail
.
findAll
({
where
:
{
id
:
{
$in
:
eval
(
userReportInfo
.
report_column_detail_ids
)
},
status
:
1
,
is_deleted
:
0
},
attributes
:
[
'id'
,
'report_column_id'
,
'sub_title'
,
'level'
,
'content'
,
'advice'
],
raw
:
true
});
...
...
app/service/course/v5/user.js
View file @
ae520181
...
@@ -94,7 +94,7 @@ class UserService extends Service {
...
@@ -94,7 +94,7 @@ class UserService extends Service {
};
};
await
ctx
.
app
.
memcache
.
set
(
key
,
value
,
7
*
24
*
3600
);
await
ctx
.
app
.
memcache
.
set
(
key
,
value
,
7
*
24
*
3600
);
const
authToken
=
await
this
.
service
.
jwt
.
apply
({
user_uuid
:
userInfo
.
uuid
,
openid
:
userInfo
.
openid
});
const
authToken
=
await
this
.
service
.
jwt
.
apply
({
user_uuid
:
userInfo
.
uuid
,
openid
:
userInfo
.
openid
});
await
app
.
memcache
.
set
(
'course_auth_token_'
+
userInfo
.
uuid
,
authToken
,
7
*
24
*
3600
);
await
app
.
memcache
.
set
(
'course_auth_token_'
+
userInfo
.
uuid
,
authToken
,
30
*
24
*
3600
);
const
ret
=
{
const
ret
=
{
user_uuid
:
userInfo
.
uuid
,
user_uuid
:
userInfo
.
uuid
,
...
@@ -139,7 +139,7 @@ class UserService extends Service {
...
@@ -139,7 +139,7 @@ class UserService extends Service {
await
app
.
memcache
.
set
(
key
,
value
,
7
*
24
*
3600
);
await
app
.
memcache
.
set
(
key
,
value
,
7
*
24
*
3600
);
const
authToken
=
ctx
.
isEmpty
(
userInfo
.
phone
)
?
''
:
await
this
.
service
.
jwt
.
apply
({
user_uuid
:
userInfo
.
uuid
,
openid
:
userInfo
.
openid
});
const
authToken
=
ctx
.
isEmpty
(
userInfo
.
phone
)
?
''
:
await
this
.
service
.
jwt
.
apply
({
user_uuid
:
userInfo
.
uuid
,
openid
:
userInfo
.
openid
});
if
(
!
ctx
.
isEmpty
(
authToken
))
{
if
(
!
ctx
.
isEmpty
(
authToken
))
{
await
app
.
memcache
.
set
(
'course_auth_token_'
+
userInfo
.
uuid
,
authToken
,
7
*
24
*
3600
);
await
app
.
memcache
.
set
(
'course_auth_token_'
+
userInfo
.
uuid
,
authToken
,
30
*
24
*
3600
);
}
}
const
ret
=
{
const
ret
=
{
user_uuid
:
userInfo
.
uuid
,
user_uuid
:
userInfo
.
uuid
,
...
@@ -232,7 +232,7 @@ class UserService extends Service {
...
@@ -232,7 +232,7 @@ class UserService extends Service {
};
};
await
app
.
memcache
.
set
(
key
,
value
,
7
*
24
*
3600
);
await
app
.
memcache
.
set
(
key
,
value
,
7
*
24
*
3600
);
const
authToken
=
await
this
.
service
.
jwt
.
apply
({
user_uuid
:
data
.
uuid
,
openid
:
user
.
openid
});
const
authToken
=
await
this
.
service
.
jwt
.
apply
({
user_uuid
:
data
.
uuid
,
openid
:
user
.
openid
});
await
app
.
memcache
.
set
(
'course_auth_token_'
+
data
.
uuid
,
authToken
,
7
*
24
*
3600
);
await
app
.
memcache
.
set
(
'course_auth_token_'
+
data
.
uuid
,
authToken
,
30
*
24
*
3600
);
const
ret
=
{
const
ret
=
{
user_uuid
:
data
.
uuid
,
user_uuid
:
data
.
uuid
,
...
...
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