Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yoho-activity-platform
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
李奇
6 years ago
Commit
d8edffd5ba3c91ef61627395c9ad36445023dbb6
1 parent
11bbd163
管理员查看用户中奖信息
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
38 deletions
apps/admin/controllers/wheel-surf.js
apps/admin/models/wheel-surf.js
public/vue/wheel-surf/prize-sent-list.vue
apps/admin/controllers/wheel-surf.js
View file @
d8edffd
...
...
@@ -267,12 +267,11 @@ const whSurfController = {
userFind
:
async
function
(
req
,
res
)
{
let
obj
=
req
.
body
;
// let result = await req.ctx(wheelSurfModel).userFind(obj);
let
result
=
await
req
.
ctx
(
wheelSurfModel
).
userFind
(
obj
);
return
res
.
json
({
code
:
200
,
data
:
{}
data
:
result
});
},
...
...
apps/admin/models/wheel-surf.js
View file @
d8edffd
...
...
@@ -26,9 +26,28 @@ class ActWheelSurfModel extends global.yoho.BaseModel {
return
Activity
.
findOne
({
where
:
{
id
:
act_id
}});
}
userFind
(
obj
)
{
async
userFind
(
obj
)
{
let
pageNo
=
obj
.
pageNo
||
1
;
let
pageSize
=
obj
.
pageSize
||
20
;
let
actId
=
obj
.
act_id
;
let
len
=
await
this
.
client
.
llenAsync
(
`
turntable
:
$
{
actId
}:
prize
:
users
`
);
return
this
.
client
.
lrangeAsync
(
`
turntable
:
$
{
actId
}:
prize
:
users
`
,
(
pageNo
-
1
)
*
pageSize
,
pageNo
*
pageSize
-
1
).
then
(
prizes
=>
{
let
afters
=
prizes
.
map
(
prize
=>
{
prize
=
prize
.
split
(
':::'
);
return
{
uid
:
prize
[
0
],
type
:
prize
[
1
],
name
:
prize
[
2
],
time
:
+
prize
[
3
]
}
});
return
{
total
:
len
,
list
:
afters
}
});
}
async
exportRecords
(
actId
)
{
...
...
public/vue/wheel-surf/prize-sent-list.vue
View file @
d8edffd
...
...
@@ -35,36 +35,17 @@
},
{
title: '奖品类型',
key: 'type',
render: (h, {row}) => {
return h('span', {}, pirzeType[row.type]);
}
key: 'type'
},
{
title: '奖品名称',
key: 'name'
},
{
title: '奖品图片',
key: 'img',
render: (h, {row}) => {
return h('img', {
attrs: {
src: row.img
},
style: {
width: '100%',
height: 'auto',
maxWidth: '70px'
}
});
}
},
{
title: '中奖时间',
key: '
endT
ime',
key: '
t
ime',
render: (h, {row}) => {
return h('span', {}, moment(
new Date(row.create_time).getTime()).format('YYYY-MM-DD HH:mm:ss
'));
return h('span', {}, moment(
row.time).format('YYYY-MM-DD HH:mm:ss
'));
}
}
],
...
...
@@ -94,18 +75,6 @@
pageSize: this.pageSize
};
if (this.uid) {
params.uid = this.uid;
}
if (this.type) {
params.type = this.type;
}
if (this.name) {
params.name = this.name;
}
this.list(params);
},
output() {
...
...
Please
register
or
login
to post a comment