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
47e0a832
authored
May 25, 2020
by
朱继来
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
调整自营销售权限
parent
40b20a99
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
48 additions
and
26 deletions
app/Http/Controllers/OrderController.php
app/Http/Controllers/PermController.php
app/Http/Controllers/ReturnController.php
config/perm_args.php
resources/views/detail/sendSales.blade.php
app/Http/Controllers/OrderController.php
View file @
47e0a832
...
@@ -397,6 +397,10 @@ Class OrderController extends Controller
...
@@ -397,6 +397,10 @@ Class OrderController extends Controller
$info
=
$this
->
getOrderInfo
(
$request
,
1
);
$info
=
$this
->
getOrderInfo
(
$request
,
1
);
$info
[
'title'
]
=
'订单列表'
;
$info
[
'title'
]
=
'订单列表'
;
if
(
$info
[
'role'
]
==
5
)
{
// 自营
return
redirect
(
'/self_order'
);
}
return
view
(
'orderlist'
,
$info
);
return
view
(
'orderlist'
,
$info
);
}
}
...
@@ -487,7 +491,7 @@ Class OrderController extends Controller
...
@@ -487,7 +491,7 @@ Class OrderController extends Controller
$info
=
$this
->
_search
(
$request
,
$tid
);
$info
=
$this
->
_search
(
$request
,
$tid
);
$perm
=
new
PermController
;
$perm
=
new
PermController
;
$sale_list
=
$perm
->
getUserBy
Condition
(
''
,
Config
(
'perm_args.sales_position
_id'
));
// 获取所有的销售
$sale_list
=
$perm
->
getUserBy
DepartmentId
(
Config
(
'perm_args.sales_department
_id'
));
// 获取所有的销售
//获取订单列表
//获取订单列表
$url
=
Config
(
'website.api_domain'
)
.
'order/getAllOrder'
;
$url
=
Config
(
'website.api_domain'
)
.
'order/getAllOrder'
;
...
@@ -689,7 +693,7 @@ Class OrderController extends Controller
...
@@ -689,7 +693,7 @@ Class OrderController extends Controller
$info
[
'buyers'
]
=
$perm
->
getUserByCondition
(
''
,
39
);
// 获取采购员, ID - 39
$info
[
'buyers'
]
=
$perm
->
getUserByCondition
(
''
,
39
);
// 获取采购员, ID - 39
$perm
=
new
PermController
;
$perm
=
new
PermController
;
$sale_list
=
$perm
->
getUserBy
Condition
(
''
,
Config
(
'perm_args.sales_position_id'
),
0
);
// 获取所有的销售 (过滤已离职的)
$sale_list
=
$perm
->
getUserBy
DepartmentId
(
Config
(
'perm_args.sales_department_id'
),
0
);
// 获取所有的销售
$info
[
'cc_sales'
]
=
$sale_list
?
array_merge
(
$info
[
'buyers'
],
$sale_list
)
:
$info
[
'buyers'
];
$info
[
'cc_sales'
]
=
$sale_list
?
array_merge
(
$info
[
'buyers'
],
$sale_list
)
:
$info
[
'buyers'
];
}
}
...
@@ -972,8 +976,7 @@ Class OrderController extends Controller
...
@@ -972,8 +976,7 @@ Class OrderController extends Controller
$info
[
'offline_sales_chief'
]
=
$perm
->
getUserByCondition
(
40
,
90
,
0
);
// 线下销售-39 线下销售总监-90
$info
[
'offline_sales_chief'
]
=
$perm
->
getUserByCondition
(
40
,
90
,
0
);
// 线下销售-39 线下销售总监-90
$info
[
'offline_sales_all'
]
=
$perm
->
getDepartmentUser
(
40
,
62
);
// 线下销售各组人员
$info
[
'offline_sales_all'
]
=
$perm
->
getDepartmentUser
(
40
,
62
);
// 线下销售各组人员
$info
[
'self_manager'
]
=
$perm
->
getUserByCondition
(
38
,
[
63
,
66
]);
// 自营销售部总监、主管
$info
[
'self_kefu'
]
=
$perm
->
getUserByDepartmentId
(
38
,
0
);
// 自营销售部
$info
[
'self_kefu'
]
=
$perm
->
getUserByCondition
(
38
,
62
);
// 自营销售部客服
$info
[
'test'
]
=
$perm
->
getUserByCondition
(
''
,
Config
(
'perm_args.test_position_id'
),
0
);
// 测试
$info
[
'test'
]
=
$perm
->
getUserByCondition
(
''
,
Config
(
'perm_args.test_position_id'
),
0
);
// 测试
...
...
app/Http/Controllers/PermController.php
View file @
47e0a832
...
@@ -370,6 +370,42 @@
...
@@ -370,6 +370,42 @@
}
}
/* 订单系统权限调整 --- 20200511 */
/* 订单系统权限调整 --- 20200511 */
// 获取部门人员
public
function
getUserByDepartmentId
(
$department_id
,
$status
=
''
)
{
$department_ids
=
[];
$this
->
getSubDepartmentId
(
$department_id
,
$department_ids
);
$data
=
DB
::
table
(
'user_info'
)
->
whereIn
(
'department_id'
,
$department_ids
)
->
where
(
function
(
$query
)
use
(
$status
)
{
if
(
$status
!==
''
)
{
$query
->
where
(
'status'
,
'='
,
$status
);
}
})
->
select
(
'userId'
,
'name'
,
'status'
)
->
get
();
return
$data
;
}
// 获取下级部门ID
public
function
getSubDepartmentId
(
$department_id
,
&
$department_ids
)
{
// 获取下级部门
$sub_department
=
DB
::
table
(
'user_department'
)
->
where
(
'parent_id'
,
$department_id
)
->
select
(
'department_id'
,
'department_name'
)
->
get
();
if
(
$sub_department
)
{
foreach
(
$sub_department
as
$v
)
{
$this
->
getSubDepartmentId
(
$v
->
department_id
,
$department_ids
);
}
}
$department_ids
[]
=
$department_id
;
return
$department_ids
;
}
/**
/**
* 根据指定条件获取用户
* 根据指定条件获取用户
* @param string $department_id [description]
* @param string $department_id [description]
...
...
app/Http/Controllers/ReturnController.php
View file @
47e0a832
...
@@ -171,7 +171,7 @@ class ReturnController extends Controller
...
@@ -171,7 +171,7 @@ class ReturnController extends Controller
// $info['sale_list'] = array_merge($joint_kefu, $self_kefu);
// $info['sale_list'] = array_merge($joint_kefu, $self_kefu);
$perm
=
new
PermController
;
$perm
=
new
PermController
;
$sale_list
=
$perm
->
getUserBy
Condition
(
''
,
Config
(
'perm_args.sales_position
_id'
));
// 获取所有的销售
$sale_list
=
$perm
->
getUserBy
DepartmentId
(
Config
(
'perm_args.sales_department
_id'
));
// 获取所有的销售
$info
[
'sale_list'
]
=
$sale_list
;
$info
[
'sale_list'
]
=
$sale_list
;
...
...
config/perm_args.php
View file @
47e0a832
...
@@ -79,10 +79,11 @@ return [
...
@@ -79,10 +79,11 @@ return [
'查看下级'
=>
2
,
'查看下级'
=>
2
,
'查看自己'
=>
3
,
'查看自己'
=>
3
,
'查看订单'
=>
4
,
'查看订单'
=>
4
,
'自营查看全部'
=>
5
,
],
],
// 销售
职位ID (62-销售,63-销售经理,64-销售主管,65-销售助理,66-线上销售总监, 90-线下销售总监)
// 销售
部门ID
'sales_
position_id'
=>
[
62
,
63
,
64
,
65
,
66
,
90
],
'sales_
department_id'
=>
7
,
// 测试人员职位ID
// 测试人员职位ID
'test_position_id'
=>
[
23
,
24
,
25
],
'test_position_id'
=>
[
23
,
24
,
25
],
...
...
resources/views/detail/sendSales.blade.php
View file @
47e0a832
...
@@ -170,28 +170,10 @@
...
@@ -170,28 +170,10 @@
</td>
</td>
</tr>
</tr>
@endif
@endif
@if (!empty($self_manager))
<tr>
<td
class=
"check-table-title"
width=
"10%"
>
自营客服主管:
</td>
<td>
<ul>
@foreach ($self_manager as $v)
@if ($v->userId == $order_info['sale_id'])
<li><label><input
type=
"radio"
name=
"sale_id"
value=
"{{$v->userId}}"
checked
/><span>
{{$v->name}}
</span></label></li>
@else
<li><label><input
type=
"radio"
name=
"sale_id"
value=
"{{$v->userId}}"
/><span>
{{$v->name}}
</span></label></li>
@endif
@endforeach
</ul>
</td>
</tr>
@endif
@if (!empty($self_kefu))
@if (!empty($self_kefu))
<tr>
<tr>
<td
class=
"check-table-title"
>
自营
客服
:
</td>
<td
class=
"check-table-title"
>
自营
销售部
:
</td>
<td>
<td>
<ul>
<ul>
@foreach ($self_kefu as $vo)
@foreach ($self_kefu as $vo)
...
...
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