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
085739bc
authored
Oct 29, 2019
by
朱继来
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
调整列表业务员筛选
parent
3846a512
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
73 additions
and
24 deletions
app/Http/Controllers/OrderController.php
config/perm_args.php
resources/views/selfOrder/content.blade.php
app/Http/Controllers/OrderController.php
View file @
085739bc
...
...
@@ -477,35 +477,53 @@ Class OrderController extends Controller
{
$info
=
$this
->
_search
(
$request
,
$tid
);
$key
=
Config
(
'perm_args.redis_search_sales'
)[
$tid
];
$redis
=
Redis
::
connection
(
'read'
);
$sale_list
=
$redis
->
get
(
$key
);
if
(
!
$sale_list
)
{
// 获取所有的业务员 (包括经理、交易员、客服、测试)
$perm
=
new
PermController
;
$sale_list
=
[];
if
(
$tid
==
1
)
{
// $search_joint_sales = Config('perm_args.search_joint_sales');
$search_sales
=
Config
(
'perm_args.search_joint_sales'
);
}
else
{
$search_sales
=
Config
(
'perm_args.search_self_sales'
);
// if ($search_joint_sales) {
// $sale_list = [];
$sale_list
[]
=
(
object
)
array
(
'userId'
=>
1000
,
'name'
=>
'admin'
,
'status'
=>
0
);
}
// foreach ($search_joint_sales as $v) {
// $role_name = array_keys(Config('perm_args.roles'), $v);
if
(
$search_sales
)
{
foreach
(
$search_sales
as
$v
)
{
$role_name
=
array_keys
(
Config
(
'perm_args.roles'
),
$v
);
$temp
=
$perm
->
getRoleUsers
(
$request
,
$role_name
[
0
]);
$sale_list
=
array_merge
(
$sale_list
,
$temp
);
}
}
// $temp = $perm->getRoleUsers($request, $role_name[0]);
// }
// }
$sale_list
=
$this
->
assoc_unique
(
$sale_list
);
$manager
=
$perm
->
getRoleUsers
(
$request
,
'经理'
);
$test
=
$perm
->
getRoleUsers
(
$request
,
'测试'
);
$sales
=
$perm
->
getRoleUsers
(
$request
,
'交易员'
);
$kefu
=
$perm
->
getRoleUsers
(
$request
,
'客服'
);
$sale_list
=
array_merge
(
$manager
,
$sales
,
$test
,
$kefu
);
}
else
if
(
$tid
==
2
)
{
$manager
=
$perm
->
getRoleUsers
(
$request
,
'自营客服主管'
);
$test
=
$perm
->
getRoleUsers
(
$request
,
'测试'
);
$assistant
=
$perm
->
getRoleUsers
(
$request
,
'自营客服主管助理'
);
$purchase
=
$perm
->
getRoleUsers
(
$request
,
'自营内部采购'
);
$kefu
=
$perm
->
getRoleUsers
(
$request
,
'自营客服'
);
$sale_list
=
array_merge
(
$manager
,
$test
,
$assistant
,
$purchase
,
$kefu
);
}
$expire
=
Config
(
'perm_args.redis_search_sales_expire'
);
// 缓存两小时
Redis
::
setex
(
$key
,
$expire
,
json_encode
(
$sale_list
));
}
else
{
$sale_list
=
json_decode
(
$sale_list
);
}
// if ($tid == 1) {
// $manager = $perm->getRoleUsers($request, '经理');
// $test = $perm->getRoleUsers($request, '测试');
// $sales = $perm->getRoleUsers($request, '交易员');
// $kefu = $perm->getRoleUsers($request, '客服');
// $sale_list = array_merge($manager, $sales, $test, $kefu);
// } else if ($tid == 2) {
// $manager = $perm->getRoleUsers($request, '自营客服主管');
// $test = $perm->getRoleUsers($request, '测试');
// $assistant = $perm->getRoleUsers($request, '自营客服主管助理');
// $purchase = $perm->getRoleUsers($request, '自营内部采购');
// $kefu = $perm->getRoleUsers($request, '自营客服');
// $sale_list = array_merge($manager, $test, $assistant, $purchase, $kefu);
// }
//获取订单列表
$url
=
Config
(
'website.api_domain'
)
.
'order/getAllOrder'
;
...
...
@@ -533,6 +551,24 @@ Class OrderController extends Controller
return
$info
;
}
// 二维数组,针对某个键名去重
public
function
assoc_unique
(
$arr
,
$key
=
'userId'
)
{
if
(
!
$arr
)
return
false
;
$tmp
=
[];
foreach
(
$arr
as
$k
=>
$v
)
{
if
(
in_array
(
$v
->
$key
,
$tmp
))
{
unset
(
$arr
[
$k
]);
}
else
{
$tmp
[]
=
$v
->
$key
;
}
}
return
array_merge
(
$arr
);
// 重新索引
}
// 订单其他信息
public
function
orderOtherInfoLoading
(
Request
$request
)
{
...
...
config/perm_args.php
View file @
085739bc
...
...
@@ -42,10 +42,17 @@ return [
// 审单时权限 (用于调价权限 changeOrder.blade.php)
'is_manager_perm'
=>
[
1
,
2
,
10
,
11
,
14
,
16
,
18
],
// 筛选业务员 -- 联营
// 筛选业务员 -- 联营
列表
'search_joint_sales'
=>
[
3
,
4
,
5
,
14
,
15
,
16
,
17
,
18
,
19
],
// 筛选业务员 -- 自营
'search_self_sales'
=>
[
5
,
7
,
10
,
11
,
12
],
// 筛选业务员 -- 自营
列表 (包含联营、自营客服)
'search_self_sales'
=>
[
3
,
4
,
5
,
7
,
10
,
11
,
12
,
14
,
15
,
16
,
17
,
18
,
19
],
// 缓存筛选业务员
'redis_search_sales'
=>
[
1
=>
'search_joint_sales'
,
2
=>
'search_self_sales'
,
],
'redis_search_sales_expire'
=>
7200
,
// 缓存两小时
];
resources/views/selfOrder/content.blade.php
View file @
085739bc
...
...
@@ -38,6 +38,12 @@
</dd>
</dl>
<dl>
<dt>
ERP订单号:
</dt>
<dd>
<input
type=
"text"
name=
"erp_sn"
value=
"{{$condition['erp_sn']}}"
placeholder=
"请输入ERP订单号"
>
</dd>
</dl>
<dl>
<dt>
订单状态:
</dt>
<dd>
<select
id=
"order_status"
name=
"order_status"
class=
"form-control order_status selectpicker"
title=
"全部"
multiple
>
...
...
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