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
2016eaba
Commit
2016eaba
authored
Feb 20, 2020
by
Aria
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix collectClass bugs
parent
f5b6f86b
Pipeline
#19458
passed with stage
in 57 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
online.js
app/service/course/v4/online.js
+3
-3
No files found.
app/service/course/v4/online.js
View file @
2016eaba
...
@@ -196,7 +196,7 @@ class OnlineService extends Service {
...
@@ -196,7 +196,7 @@ class OnlineService extends Service {
created_time
:
moment
().
format
(
'YYYY-MM-DD HH:mm:ss'
),
created_time
:
moment
().
format
(
'YYYY-MM-DD HH:mm:ss'
),
};
};
const
check
=
await
ctx
.
classModel
.
V4
.
CourseUserCollection
.
findOne
({
where
:
{
user_uuid
:
userUuid
,
type
:
5
,
type_id
:
id
,
is_deleted
:
0
}
});
const
check
=
await
ctx
.
classModel
.
V4
.
CourseUserCollection
.
findOne
({
where
:
{
user_uuid
:
userUuid
,
type
:
3
,
type_id
:
id
,
is_deleted
:
0
}
});
if
(
!
ctx
.
isEmpty
(
check
))
{
if
(
!
ctx
.
isEmpty
(
check
))
{
ctx
.
failed
(
'请勿重复收藏'
);
ctx
.
failed
(
'请勿重复收藏'
);
}
}
...
@@ -214,7 +214,7 @@ class OnlineService extends Service {
...
@@ -214,7 +214,7 @@ class OnlineService extends Service {
const
offset
=
(
page
-
1
)
*
limit
;
const
offset
=
(
page
-
1
)
*
limit
;
const
userUuid
=
ctx
.
userUuid
;
const
userUuid
=
ctx
.
userUuid
;
const
userCollection
=
await
ctx
.
classModel
.
V4
.
CourseUserCollection
.
findAndCountAll
({
where
:
{
user_uuid
:
userUuid
,
is_deleted
:
0
,
type
:
5
},
raw
:
true
,
limit
,
offset
});
const
userCollection
=
await
ctx
.
classModel
.
V4
.
CourseUserCollection
.
findAndCountAll
({
where
:
{
user_uuid
:
userUuid
,
is_deleted
:
0
,
type
:
3
},
raw
:
true
,
limit
,
offset
});
let
classIds
=
R
.
pluck
(
'type_id'
,
userCollection
.
rows
);
let
classIds
=
R
.
pluck
(
'type_id'
,
userCollection
.
rows
);
const
filter
=
{
where
:
{
id
:
{
$in
:
classIds
},
status
:
'online'
,
is_deleted
:
0
},
order
:
[[
'institution_id'
,
'desc'
]],
limit
,
offset
,
attributes
:
[
'id'
,
'institution_id'
,
'name'
,
'price'
,
'type'
,
'age'
,
'mode'
,
'time'
,
'created_time'
]
};
const
filter
=
{
where
:
{
id
:
{
$in
:
classIds
},
status
:
'online'
,
is_deleted
:
0
},
order
:
[[
'institution_id'
,
'desc'
]],
limit
,
offset
,
attributes
:
[
'id'
,
'institution_id'
,
'name'
,
'price'
,
'type'
,
'age'
,
'mode'
,
'time'
,
'created_time'
]
};
...
@@ -275,7 +275,7 @@ class OnlineService extends Service {
...
@@ -275,7 +275,7 @@ class OnlineService extends Service {
const
userUuid
=
ctx
.
userUuid
;
const
userUuid
=
ctx
.
userUuid
;
// 是否已收藏
// 是否已收藏
const
check
=
await
ctx
.
classModel
.
V4
.
CourseUserCollection
.
findOne
({
where
:
{
user_uuid
:
userUuid
,
type
:
5
,
type_id
:
id
,
is_deleted
:
0
}
});
const
check
=
await
ctx
.
classModel
.
V4
.
CourseUserCollection
.
findOne
({
where
:
{
user_uuid
:
userUuid
,
type
:
3
,
type_id
:
id
,
is_deleted
:
0
}
});
if
(
ctx
.
isEmpty
(
check
))
{
if
(
ctx
.
isEmpty
(
check
))
{
ctx
.
failed
(
'尚未收藏'
);
ctx
.
failed
(
'尚未收藏'
);
}
}
...
...
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