Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
朱继来
/
后台订单管理
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
0f672840
authored
Dec 18, 2019
by
朱继来
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
调整自营样片领取记录
parent
e42dd318
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
12 deletions
app/Model/UserSampleApplyModel.php
public/js/web/selfSampleList.js
public/js/web/selfSampleLog.js
app/Model/UserSampleApplyModel.php
View file @
0f672840
...
...
@@ -25,7 +25,7 @@ class UserSampleApplyModel extends Model
{
$page
=
$request
->
input
(
'page'
,
1
);
$limit
=
$request
->
input
(
'limit'
,
10
);
$field
=
[
'a.apply_id'
,
'a.user_id'
,
'a.account'
,
'a.order_id'
,
'order_sn'
,
'a.goods_id'
,
'a.goods_name'
,
'a.apply_num'
,
'a.create_time'
];
$field
=
[
'a.apply_id'
,
'a.user_id'
,
'a.account'
,
'a.order_id'
,
'order_sn'
,
'a.goods_id'
,
'a.goods_name'
,
'a.apply_num'
,
'a.
quota'
,
'a.
create_time'
];
$map
[
'account'
]
=
$request
->
input
(
'account'
,
''
);
// 用户账户
$map
[
'goods_name'
]
=
$request
->
input
(
'goods_name'
,
''
);
// 商品名称
...
...
@@ -98,17 +98,18 @@ class UserSampleApplyModel extends Model
$UserInfoModel
=
new
UserInfoModel
;
$v
[
'invite_count'
]
=
$UserSampleInviteModel
->
getUserInviteCount
(
$v
[
'user_id'
]);
$v
[
'apply_num_total'
]
=
$this
->
getSampleApplySum
(
$v
[
'user_id'
]);
$v
[
'apply_num_total'
]
=
$this
->
getSampleApplySum
(
$v
[
'user_id'
]);
// 获取指定用户申请的样片总数
$v
[
'quota_total'
]
=
$this
->
getSampleApplySum
(
$v
[
'user_id'
],
'quota'
);
// 获取指定用户申请的样片消耗总人数
$v
[
'apply_count'
]
=
$UserInfoModel
->
getUserApplyCount
(
$v
[
'user_id'
]);
}
return
$data
;
}
// 获取指定
用户申请的样片
总数
public
function
getSampleApplySum
(
$user_id
)
// 获取指定
字段的
总数
public
function
getSampleApplySum
(
$user_id
,
$field
=
'apply_num'
)
{
return
$this
->
where
(
'user_id'
,
$user_id
)
->
sum
(
'apply_num'
);
return
$this
->
where
(
'user_id'
,
$user_id
)
->
sum
(
$field
);
}
// 获取领取记录
...
...
@@ -118,7 +119,7 @@ class UserSampleApplyModel extends Model
$page
=
$request
->
input
(
'page'
,
1
);
$limit
=
$request
->
input
(
'limit'
,
10
);
$field
=
[
'apply_id'
,
'user_id'
,
'account'
,
'order_id'
,
'order_sn'
,
'goods_id'
,
'goods_name'
,
'apply_num'
,
'create_time'
];
$field
=
[
'apply_id'
,
'user_id'
,
'account'
,
'order_id'
,
'order_sn'
,
'goods_id'
,
'goods_name'
,
'apply_num'
,
'
quota'
,
'
create_time'
];
$list
=
$this
->
where
(
'user_id'
,
$user_id
)
->
select
(
$field
)
...
...
public/js/web/selfSampleList.js
View file @
0f672840
...
...
@@ -24,7 +24,8 @@ layui.use(['form', 'table', 'laydate'], function(){
,{
field
:
'account'
,
title
:
'用户账户'
,
width
:
150
}
,{
field
:
'invite_count'
,
title
:
'邀请人数'
,
width
:
100
}
,{
field
:
'apply_num_total'
,
title
:
'已申请样片数'
,
width
:
120
}
,{
field
:
'apply_count'
,
title
:
'剩余领取次数'
,
width
:
120
}
,{
field
:
'apply_count'
,
title
:
'剩余有效人数'
,
width
:
120
}
,{
field
:
'quota_total'
,
title
:
'总消耗人数'
,
width
:
120
}
,{
field
:
'order_id'
,
title
:
'订单ID'
,
width
:
100
}
,{
field
:
'order_sn'
,
title
:
'订单编号'
,
width
:
150
}
,{
field
:
'goods_id'
,
title
:
'样片ID'
,
width
:
100
}
...
...
public/js/web/selfSampleLog.js
View file @
0f672840
...
...
@@ -14,14 +14,15 @@ layui.use(['table'], function(){
}
,
cols
:
[[
//表头
{
title
:
'序号'
,
type
:
'numbers'
,
fixed
:
'left'
,
width
:
80
}
,{
field
:
'user_id'
,
title
:
'用户ID'
,
width
:
1
5
0
}
,{
field
:
'user_id'
,
title
:
'用户ID'
,
width
:
1
2
0
}
,{
field
:
'account'
,
title
:
'用户账户'
,
width
:
200
}
,{
field
:
'order_id'
,
title
:
'订单ID'
,
width
:
1
5
0
}
,{
field
:
'order_id'
,
title
:
'订单ID'
,
width
:
1
2
0
}
,{
field
:
'order_sn'
,
title
:
'订单编号'
,
width
:
200
}
,{
field
:
'goods_id'
,
title
:
'样片ID'
,
width
:
1
5
0
}
,{
field
:
'goods_id'
,
title
:
'样片ID'
,
width
:
1
2
0
}
,{
field
:
'goods_name'
,
title
:
'样片名称'
,
width
:
300
}
,{
field
:
'apply_num'
,
title
:
'领取数量'
,
width
:
150
}
,{
field
:
'create_time'
,
title
:
'领取时间'
,
width
:
218
}
,{
field
:
'apply_num'
,
title
:
'领取数量'
,
width
:
120
}
,{
field
:
'quota'
,
title
:
'样片消耗人数'
,
width
:
120
}
,{
field
:
'create_time'
,
title
:
'领取时间'
,
width
:
215
}
]]
,
limit
:
10
,
limits
:
[
10
,
20
,
50
,]
...
...
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