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
b1304663
Commit
b1304663
authored
Aug 25, 2020
by
任国军
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix act order
parent
2e91170c
Pipeline
#27644
failed with stage
in 26 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
3 deletions
+15
-3
user.js
app/controller/course/v5/user.js
+4
-0
courseActImage.js
app/model/class/courseActImage.js
+2
-0
user.js
app/service/course/v5/user.js
+9
-3
No files found.
app/controller/course/v5/user.js
View file @
b1304663
...
@@ -192,6 +192,10 @@ class UserController extends Controller {
...
@@ -192,6 +192,10 @@ class UserController extends Controller {
ctx
.
failed
(
'order_no is failed'
);
ctx
.
failed
(
'order_no is failed'
);
}
}
if
(
ctx
.
isEmpty
(
params
)
||
ctx
.
isEmpty
(
params
.
id
))
{
ctx
.
failed
(
'id is failed'
);
}
const
ret
=
await
service
.
course
.
v5
.
user
.
updateUserOrder
(
params
);
const
ret
=
await
service
.
course
.
v5
.
user
.
updateUserOrder
(
params
);
ctx
.
success
(
ret
);
ctx
.
success
(
ret
);
}
}
...
...
app/model/class/courseActImage.js
View file @
b1304663
...
@@ -15,6 +15,8 @@ module.exports = app => {
...
@@ -15,6 +15,8 @@ module.exports = app => {
name
:
STRING
,
name
:
STRING
,
class_id
:
INTEGER
,
class_id
:
INTEGER
,
institution_id
:
INTEGER
,
institution_id
:
INTEGER
,
h5_promote_success_url
:
STRING
,
h5_promote_middle_url
:
STRING
,
title
:
STRING
,
title
:
STRING
,
content
:
STRING
,
content
:
STRING
,
selected_image
:
STRING
,
selected_image
:
STRING
,
...
...
app/service/course/v5/user.js
View file @
b1304663
...
@@ -654,7 +654,7 @@ class UserService extends Service {
...
@@ -654,7 +654,7 @@ class UserService extends Service {
ctx
.
failed
(
'机构已下线'
);
ctx
.
failed
(
'机构已下线'
);
}
}
const
classInfo
=
await
ctx
.
classModel
.
V5
.
CourseV5Class
.
findOne
({
where
:
{
id
:
actInfo
.
class_id
,
status
:
1
,
is_deleted
:
0
},
attributes
:
[
'has_address'
,
'button_url'
]
});
const
classInfo
=
await
ctx
.
classModel
.
V5
.
CourseV5Class
.
findOne
({
where
:
{
id
:
actInfo
.
class_id
,
status
:
1
,
is_deleted
:
0
},
attributes
:
[
'has_address'
]
});
if
(
ctx
.
isEmpty
(
classInfo
))
{
if
(
ctx
.
isEmpty
(
classInfo
))
{
ctx
.
failed
(
'课程已下线'
);
ctx
.
failed
(
'课程已下线'
);
}
}
...
@@ -690,14 +690,18 @@ class UserService extends Service {
...
@@ -690,14 +690,18 @@ class UserService extends Service {
};
};
await
ctx
.
classModel
.
V5
.
CourseUserOrder
.
create
(
order
);
await
ctx
.
classModel
.
V5
.
CourseUserOrder
.
create
(
order
);
await
ctx
.
classModel
.
CourseUserActImage
.
create
({
user_uuid
:
userUuid
,
image_id
:
id
});
if
(
ctx
.
isEmpty
(
institutionInfo
.
pay_column
)
&&
classInfo
.
has_address
===
0
)
{
await
ctx
.
classModel
.
CourseUserActImage
.
create
({
user_uuid
:
userUuid
,
image_id
:
id
});
}
const
ret
=
{
const
ret
=
{
id
,
institution_pay_column
:
ctx
.
isEmpty
(
institutionInfo
.
pay_column
)
?
[]
:
eval
(
institutionInfo
.
pay_column
),
institution_pay_column
:
ctx
.
isEmpty
(
institutionInfo
.
pay_column
)
?
[]
:
eval
(
institutionInfo
.
pay_column
),
has_address
:
classInfo
.
has_address
,
has_address
:
classInfo
.
has_address
,
order_no
:
orderNo
,
order_no
:
orderNo
,
class_id
:
actInfo
.
class_id
,
class_id
:
actInfo
.
class_id
,
url
:
classInfo
.
button_url
,
h5_promote_success_url
:
actInfo
.
h5_promote_success_url
,
h5_promote_middle_url
:
actInfo
.
h5_promote_middle_url
,
};
};
return
ret
;
return
ret
;
...
@@ -725,6 +729,7 @@ class UserService extends Service {
...
@@ -725,6 +729,7 @@ class UserService extends Service {
const
{
ctx
}
=
this
;
const
{
ctx
}
=
this
;
const
orderNo
=
input
.
order_no
||
''
;
const
orderNo
=
input
.
order_no
||
''
;
const
columns
=
input
.
columns
||
''
;
const
columns
=
input
.
columns
||
''
;
const
id
=
input
.
id
||
0
;
const
order
=
await
ctx
.
classModel
.
V5
.
CourseUserOrder
.
findOne
({
where
:
{
order_no
:
orderNo
,
is_deleted
:
0
}
});
const
order
=
await
ctx
.
classModel
.
V5
.
CourseUserOrder
.
findOne
({
where
:
{
order_no
:
orderNo
,
is_deleted
:
0
}
});
if
(
ctx
.
isEmpty
(
order
))
{
if
(
ctx
.
isEmpty
(
order
))
{
...
@@ -744,6 +749,7 @@ class UserService extends Service {
...
@@ -744,6 +749,7 @@ class UserService extends Service {
}
}
await
ctx
.
classModel
.
V5
.
CourseUserOrder
.
update
({
address
,
columns
,
status
:
1
},
{
where
:
{
id
:
order
.
id
}
});
await
ctx
.
classModel
.
V5
.
CourseUserOrder
.
update
({
address
,
columns
,
status
:
1
},
{
where
:
{
id
:
order
.
id
}
});
await
ctx
.
classModel
.
CourseUserActImage
.
findOrCreate
({
user_uuid
:
ctx
.
userUuid
,
image_id
:
id
});
const
ret
=
{
const
ret
=
{
result
:
true
,
result
:
true
,
...
...
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