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
db5af258
authored
Sep 04, 2020
by
朱继来
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
调整样片
parent
637dd9a4
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
22 additions
and
16 deletions
app/Http/Controllers/WebController.php
app/Model/UserSampleApplyModel.php
app/Model/UserSampleInviteModel.php
public/js/web/selfSampleList.js
public/js/web/selfSampleLog.js
app/Http/Controllers/WebController.php
View file @
db5af258
...
@@ -301,8 +301,8 @@ class WebController extends Controller
...
@@ -301,8 +301,8 @@ class WebController extends Controller
if
(
!
$user_id
)
return
redirect
(
'/web/selfSampleList'
);
if
(
!
$user_id
)
return
redirect
(
'/web/selfSampleList'
);
$data
[
'title'
]
=
'
自营样片
领取和邀约记录'
;
$data
[
'title'
]
=
'领取和邀约记录'
;
$data
[
'paths'
]
=
[[
"title"
=>
'自营订单'
,
"href"
=>
'#'
],
[
"title"
=>
'自营订单领取列表'
,
"href"
=>
'/web/selfSampleList'
],
[
"title"
=>
'
自营样片
领取和邀约记录'
,
"href"
=>
'#'
]];
$data
[
'paths'
]
=
[[
"title"
=>
'自营订单'
,
"href"
=>
'#'
],
[
"title"
=>
'自营订单领取列表'
,
"href"
=>
'/web/selfSampleList'
],
[
"title"
=>
'领取和邀约记录'
,
"href"
=>
'#'
]];
$data
[
'user_id'
]
=
$user_id
;
$data
[
'user_id'
]
=
$user_id
;
$UserMainModel
=
new
UserMainModel
;
$UserMainModel
=
new
UserMainModel
;
...
...
app/Model/UserSampleApplyModel.php
View file @
db5af258
...
@@ -103,13 +103,14 @@ class UserSampleApplyModel extends Model
...
@@ -103,13 +103,14 @@ class UserSampleApplyModel extends Model
$UserSampleInviteModel
=
new
UserSampleInviteModel
;
$UserSampleInviteModel
=
new
UserSampleInviteModel
;
$UserInfoModel
=
new
UserInfoModel
;
$UserInfoModel
=
new
UserInfoModel
;
foreach
(
$data
as
&
$v
)
{
foreach
(
$data
as
&
$v
)
{
$v
[
'type_val'
]
=
$v
[
'type'
]
==
1
?
'样片'
:
'工具尺'
;
$v
[
'type_val'
]
=
$v
[
'type'
]
==
1
?
'样片'
:
'工具尺'
;
$v
[
'work_function'
]
=
$UserInfoModel
->
getWorkFunction
(
$v
[
'user_id'
]);
$v
[
'work_function'
]
=
$UserInfoModel
->
getWorkFunction
(
$v
[
'user_id'
]);
$v
[
'invite_count'
]
=
$UserSampleInviteModel
->
getUserInviteCount
(
$v
[
'user_id'
]);
$v
[
'sample_invite_count'
]
=
$UserSampleInviteModel
->
getUserInviteCount
(
$v
[
'user_id'
]);
$v
[
'apply_num_total'
]
=
$this
->
getSampleApplySum
(
$v
[
'user_id'
]);
// 获取指定用户申请的样片总数
$v
[
'ruler_invite_count'
]
=
$UserSampleInviteModel
->
getUserInviteCount
(
$v
[
'user_id'
],
2
);
$v
[
'quota_total'
]
=
$this
->
getSampleApplySum
(
$v
[
'user_id'
],
'quota'
);
// 获取指定用户申请的样片消耗总人数
$v
[
'apply_num_total'
]
=
$this
->
getSampleApplySum
(
$v
[
'user_id'
]);
// 获取指定用户申请的样片总数
// $v['quota_total'] = $this->getUsedCount($v['user_id']); //
$v
[
'quota_total'
]
=
$this
->
getSampleApplySum
(
$v
[
'user_id'
],
'quota'
);
// 获取指定用户申请的样片消耗总人数
$v
[
'apply_count'
]
=
$UserInfoModel
->
getUserApplyCount
(
$v
[
'user_id'
]);
// $v['quota_total'] = $this->getUsedCount($v['user_id']); //
$v
[
'apply_count'
]
=
$UserInfoModel
->
getUserApplyCount
(
$v
[
'user_id'
]);
}
}
return
$data
;
return
$data
;
...
...
app/Model/UserSampleInviteModel.php
View file @
db5af258
...
@@ -55,9 +55,13 @@ class UserSampleInviteModel extends Model
...
@@ -55,9 +55,13 @@ class UserSampleInviteModel extends Model
}
}
// 获取指定用户邀约人数
// 获取指定用户邀约人数
public
function
getUserInviteCount
(
$user_id
)
public
function
getUserInviteCount
(
$user_id
,
$type
=
1
)
{
{
return
$this
->
where
(
'user_id'
,
$user_id
)
->
where
(
'is_expire'
,
1
)
->
count
();
$map
=
[];
$map
[
'user_id'
]
=
$user_id
;
$map
[
'type'
]
=
$type
;
return
$this
->
where
(
$map
)
->
where
(
'is_expire'
,
1
)
->
count
();
}
}
// 获取用户邀约列表
// 获取用户邀约列表
...
...
public/js/web/selfSampleList.js
View file @
db5af258
...
@@ -23,8 +23,9 @@ layui.use(['form', 'table', 'laydate'], function(){
...
@@ -23,8 +23,9 @@ layui.use(['form', 'table', 'laydate'], function(){
,{
field
:
'user_id'
,
title
:
'用户ID'
,
width
:
100
}
,{
field
:
'user_id'
,
title
:
'用户ID'
,
width
:
100
}
,{
field
:
'account'
,
title
:
'用户账户'
,
width
:
150
}
,{
field
:
'account'
,
title
:
'用户账户'
,
width
:
150
}
,{
field
:
'type_val'
,
title
:
'活动名称'
,
width
:
100
}
,{
field
:
'type_val'
,
title
:
'活动名称'
,
width
:
100
}
,{
field
:
'work_function'
,
title
:
'用户职务'
,
width
:
150
}
,{
field
:
'work_function'
,
title
:
'用户职务'
,
width
:
120
}
,{
field
:
'invite_count'
,
title
:
'邀请人数'
,
width
:
100
}
,{
field
:
'sample_invite_count'
,
title
:
'样片邀请人数'
,
width
:
130
}
,{
field
:
'ruler_invite_count'
,
title
:
'工具尺邀请人数'
,
width
:
130
}
,{
field
:
'apply_num_total'
,
title
:
'已申请样片数'
,
width
:
120
}
,{
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
:
'quota_total'
,
title
:
'总消耗人数'
,
width
:
120
}
...
...
public/js/web/selfSampleLog.js
View file @
db5af258
...
@@ -20,10 +20,10 @@ layui.use(['table'], function(){
...
@@ -20,10 +20,10 @@ layui.use(['table'], function(){
,{
field
:
'order_id'
,
title
:
'订单ID'
,
width
:
120
}
,{
field
:
'order_id'
,
title
:
'订单ID'
,
width
:
120
}
,{
field
:
'order_sn'
,
title
:
'订单编号'
,
width
:
200
}
,{
field
:
'order_sn'
,
title
:
'订单编号'
,
width
:
200
}
,{
field
:
'order_status'
,
title
:
'订单状态'
,
width
:
100
}
,{
field
:
'order_status'
,
title
:
'订单状态'
,
width
:
100
}
,{
field
:
'goods_id'
,
title
:
'
样片
ID'
,
width
:
120
}
,{
field
:
'goods_id'
,
title
:
'
商品
ID'
,
width
:
120
}
,{
field
:
'goods_name'
,
title
:
'
样片
名称'
,
width
:
300
}
,{
field
:
'goods_name'
,
title
:
'
商品
名称'
,
width
:
300
}
,{
field
:
'apply_num'
,
title
:
'领取数量'
,
width
:
120
}
,{
field
:
'apply_num'
,
title
:
'领取数量'
,
width
:
120
}
,{
field
:
'quota'
,
title
:
'
样片
消耗人数'
,
width
:
120
}
,{
field
:
'quota'
,
title
:
'消耗人数'
,
width
:
120
}
,{
field
:
'is_expire'
,
title
:
'是否过期'
,
templet
:
'#is_expire'
,
width
:
120
}
,{
field
:
'is_expire'
,
title
:
'是否过期'
,
templet
:
'#is_expire'
,
width
:
120
}
,{
field
:
'create_time'
,
title
:
'领取时间'
,
width
:
215
}
,{
field
:
'create_time'
,
title
:
'领取时间'
,
width
:
215
}
]]
]]
...
...
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