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
1d0f824d
Commit
1d0f824d
authored
Aug 10, 2020
by
任国军
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add back_column
parent
6368489b
Pipeline
#27252
passed with stage
in 4 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
3 deletions
+18
-3
courseV5Institution.js
app/model/class/v5/courseV5Institution.js
+1
-0
course.js
app/router/course.js
+1
-1
back.js
app/service/course/back.js
+16
-2
No files found.
app/model/class/v5/courseV5Institution.js
View file @
1d0f824d
...
@@ -18,6 +18,7 @@ module.exports = app => {
...
@@ -18,6 +18,7 @@ module.exports = app => {
description
:
TEXT
,
description
:
TEXT
,
title
:
STRING
,
title
:
STRING
,
pay_column
:
STRING
,
pay_column
:
STRING
,
back_column
:
STRING
,
status
:
INTEGER
,
status
:
INTEGER
,
is_deleted
:
INTEGER
,
is_deleted
:
INTEGER
,
created_time
:
{
created_time
:
{
...
...
app/router/course.js
View file @
1d0f824d
...
@@ -14,5 +14,5 @@ module.exports = app => {
...
@@ -14,5 +14,5 @@ module.exports = app => {
router
.
get
(
'third'
,
'/export/redeem'
,
auth
,
'course.back.exportRedeemCode'
);
router
.
get
(
'third'
,
'/export/redeem'
,
auth
,
'course.back.exportRedeemCode'
);
router
.
get
(
'third'
,
'/export/redeem/used'
,
auth
,
'course.back.exportUsedRedeemCode'
);
router
.
get
(
'third'
,
'/export/redeem/used'
,
auth
,
'course.back.exportUsedRedeemCode'
);
router
.
get
(
'third'
,
'/redeem/used'
,
auth
,
'course.back.getUsedRedeemCodeList'
);
router
.
get
(
'third'
,
'/redeem/used'
,
auth
,
'course.back.getUsedRedeemCodeList'
);
router
.
get
(
'third'
,
'/column/all'
,
'course.back.getBackColumns'
);
router
.
get
(
'third'
,
'/column/all'
,
auth
,
'course.back.getBackColumns'
);
};
};
app/service/course/back.js
View file @
1d0f824d
...
@@ -88,7 +88,7 @@ class BackService extends Service {
...
@@ -88,7 +88,7 @@ class BackService extends Service {
ctx
.
failed
(
'用户异常'
);
ctx
.
failed
(
'用户异常'
);
}
}
const
filter
=
{
where
:
{
type
:
1
,
status
:
1
,
is_deleted
:
0
},
limit
,
offset
,
attributes
:
[
'id'
,
'order_no'
,
'class_id'
,
'pay'
,
'pay_time'
,
'address'
,
'columns'
],
order
:
[[
'pay_time'
,
'desc'
]]
};
const
filter
=
{
where
:
{
type
:
1
,
status
:
1
,
is_deleted
:
0
},
limit
,
offset
,
attributes
:
[
'id'
,
'order_no'
,
'class_id'
,
'pay'
,
'pay_time'
,
'
redeem'
,
'
address'
,
'columns'
],
order
:
[[
'pay_time'
,
'desc'
]]
};
let
filterClassIds
=
[];
let
filterClassIds
=
[];
if
(
!
ctx
.
isEmpty
(
input
.
class_name
))
{
if
(
!
ctx
.
isEmpty
(
input
.
class_name
))
{
const
classList
=
await
ctx
.
classModel
.
V5
.
CourseV5Class
.
findAll
({
where
:
{
name
:
{
$like
:
`%
${
input
.
class_name
}
%`
}
},
attributes
:
[
'id'
]
});
const
classList
=
await
ctx
.
classModel
.
V5
.
CourseV5Class
.
findAll
({
where
:
{
name
:
{
$like
:
`%
${
input
.
class_name
}
%`
}
},
attributes
:
[
'id'
]
});
...
@@ -138,6 +138,7 @@ class BackService extends Service {
...
@@ -138,6 +138,7 @@ class BackService extends Service {
class_name
:
ctx
.
isEmpty
(
classList
[
v
.
class_id
])
?
''
:
classList
[
v
.
class_id
][
0
].
name
,
class_name
:
ctx
.
isEmpty
(
classList
[
v
.
class_id
])
?
''
:
classList
[
v
.
class_id
][
0
].
name
,
pay
:
v
.
pay
,
pay
:
v
.
pay
,
pay_time
:
v
.
pay_time
,
pay_time
:
v
.
pay_time
,
redeem_code
:
v
.
redeem
,
address
:
ctx
.
isEmpty
(
v
.
address
)
?
{}
:
JSON
.
parse
(
v
.
address
),
address
:
ctx
.
isEmpty
(
v
.
address
)
?
{}
:
JSON
.
parse
(
v
.
address
),
columns
:
ctx
.
isEmpty
(
v
.
columns
)
?
{}
:
JSON
.
parse
(
v
.
columns
),
columns
:
ctx
.
isEmpty
(
v
.
columns
)
?
{}
:
JSON
.
parse
(
v
.
columns
),
});
});
...
@@ -519,8 +520,21 @@ class BackService extends Service {
...
@@ -519,8 +520,21 @@ class BackService extends Service {
// 获取额外字段
// 获取额外字段
async
getBackColumns
()
{
async
getBackColumns
()
{
const
{
ctx
}
=
this
;
const
{
ctx
}
=
this
;
const
userUuid
=
ctx
.
userUuid
;
const
columns
=
await
ctx
.
classModel
.
CourseBackColumn
.
findAll
({
where
:
{
status
:
1
},
attributes
:
[
'title'
,
'column'
]
});
const
userInfo
=
await
ctx
.
classModel
.
CourseBackUser
.
findOne
({
where
:
{
id
:
userUuid
,
is_deleted
:
0
}
});
if
(
ctx
.
isEmpty
(
userInfo
))
{
ctx
.
failed
(
'无效用户'
);
}
let
columns
=
[];
if
(
userInfo
.
is_admin
>
0
)
{
columns
=
await
ctx
.
classModel
.
CourseBackColumn
.
findAll
({
where
:
{
status
:
1
},
attributes
:
[
'title'
,
'column'
]
});
}
else
{
columns
=
await
ctx
.
classModel
.
V5
.
CourseV5Institution
.
findOne
({
where
:
{
id
:
userInfo
.
institution_id
},
attributes
:
[
'back_column'
]
});
columns
=
(
ctx
.
isEmpty
(
columns
)
||
ctx
.
isEmpty
(
columns
.
back_column
))
?
[]
:
eval
(
columns
.
back_column
);
columns
=
await
ctx
.
classModel
.
CourseBackColumn
.
findAll
({
where
:
{
column
:
{
$in
:
columns
},
status
:
1
},
attributes
:
[
'title'
,
'column'
]
});
}
const
ret
=
{
const
ret
=
{
list
:
columns
,
list
:
columns
,
};
};
...
...
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