Commit bf0e2d6d by 朱继来

调整推送人员

parent 4c0e2838
......@@ -480,6 +480,18 @@ Class OrderController extends Controller
$perm = new PermController;
if ($tid == 1) {
// $search_joint_sales = Config('perm_args.search_joint_sales');
// if ($search_joint_sales) {
// $sale_list = [];
// foreach ($search_joint_sales as $v) {
// $role_name = array_keys(Config('perm_args.roles'), $v);
// $temp = $perm->getRoleUsers($request, $role_name[0]);
// }
// }
$manager = $perm->getRoleUsers($request, '经理');
$test = $perm->getRoleUsers($request, '测试');
$sales = $perm->getRoleUsers($request, '交易员');
......@@ -865,10 +877,15 @@ Class OrderController extends Controller
$tags = $request->input('tags', '');
// 联营
$joint_manager = $perm->getRoleUsers($request, '经理');
$joint_kefu = $perm->getRoleUsers($request, '客服');
$sale_list = $perm->getRoleUsers($request, '交易员');
$test = $perm->getRoleUsers($request, '测试');
$joint_manager = $perm->getRoleUsers($request, '经理');
$joint_in_charge_1 = $perm->getRoleUsers($request, '线销一组主管');
$joint_in_charge_2 = $perm->getRoleUsers($request, '线销二组主管');
$joint_in_charge_3 = $perm->getRoleUsers($request, '线销三组主管');
$joint_kefu_1 = $perm->getRoleUsers($request, '线销一组客服');
$joint_kefu_2 = $perm->getRoleUsers($request, '线销二组客服');
$joint_kefu_3 = $perm->getRoleUsers($request, '线销三组客服');
$sale_list = $perm->getRoleUsers($request, '交易员');
$test = $perm->getRoleUsers($request, '测试');
$self_manager = $self_kefu = '';
......@@ -879,19 +896,47 @@ Class OrderController extends Controller
$self_kefu = array_merge($self_assistant, $self_kefu);
}
$info['joint_manager'] = $this->filterLeave($joint_manager);
$info['joint_kefu'] = $this->filterLeave($joint_kefu);
$info['sale_list'] = $this->filterLeave($sale_list);
$info['test'] = $this->filterLeave($test);
$info['self_manager'] = $this->filterLeave($self_manager);
$info['self_kefu'] = $this->filterLeave($self_kefu);
$info['sale_id'] = $request->user->userId;
$info['role'] = $perm->getUserRole($request);
$info['joint_manager'] = $this->filterLeave($joint_manager);
$joint_in_charge_1 = $this->filterLeave($joint_in_charge_1);
$joint_in_charge_2 = $this->filterLeave($joint_in_charge_2);
$joint_in_charge_3 = $this->filterLeave($joint_in_charge_3);
$info['joint_in_charge'] = $this->remove_duplicate(array_merge($joint_in_charge_1, $joint_in_charge_2, $joint_in_charge_3));
$info['joint_kefu_1'] = $this->filterLeave($joint_kefu_1);
$info['joint_kefu_2'] = $this->filterLeave($joint_kefu_2);
$info['joint_kefu_3'] = $this->filterLeave($joint_kefu_3);
$info['sale_list'] = $this->filterLeave($sale_list);
$info['test'] = $this->filterLeave($test);
$info['self_manager'] = $this->filterLeave($self_manager);
$info['self_kefu'] = $this->filterLeave($self_kefu);
$info['sale_id'] = $request->user->userId;
$info['role'] = $perm->getUserRole($request);
return view('detail', $info);
}
// 二维数组去重
public function remove_duplicate($array)
{
$result = array();
foreach ($array as $key => $value) {
$has = false;
foreach($result as $val){
if($val->userId == $value->userId){
$has = true;
break;
}
}
if(!$has) $result[] = $value;
}
return $result;
}
// 去掉已离职人员
public function filterLeave(&$data)
{
......
......@@ -210,7 +210,23 @@
// 获取主管及其下对应组员的sale_id
public function getGroupSalesId($request, $role_id)
{
$manager_to_kefu = Config('perm_args.manager_to_kefu'); // 线销主管对应的客服
$sale_id = [];
// 主管ID
$manager_role_name = array_keys(Config('perm_args.roles'), $role_id);
if (!$manager_role_name) {
$manager_sales = $this->getRoleUsers($request, $manager_role_name[0]);
if ($manager_sales) {
foreach ($manager_sales as $v) {
$sale_id[] = $v->userId;
}
}
}
// 线销主管对应的客服
$manager_to_kefu = Config('perm_args.manager_to_kefu');
if (!in_array($role_id, array_keys($manager_to_kefu))) return 0;
......@@ -219,9 +235,6 @@
if (!$role_name) return 0;
$sale_id = [];
$sale_id[] = $request->user->userId; // 主管ID
$sales = $this->getRoleUsers($request, $role_name[0]);
if ($sales) {
......
......@@ -42,4 +42,10 @@ 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],
];
......@@ -27,18 +27,69 @@
</tr>
@endif
@if (!empty($joint_kefu))
@if (!empty($joint_in_charge))
<tr>
<td class="check-table-title">联营客服:</td>
<td>
<ul>
@foreach ($joint_kefu as $key => $vo)
@if ($vo->userId == $order_info['sale_id'])
<li><label><input type="radio" name="sale_id" value="{{$vo->userId}}" checked /><span>{{$vo->name}}</span></label></li>
@else
<li><label><input type="radio" name="sale_id" value="{{$vo->userId}}"/><span>{{$vo->name}}</span></label></li>
@endif
@endforeach
<table class="table table-bordered table-hover">
<tr>
<td width="10%">主管:</td>
<td>
<ul>
@foreach ($joint_in_charge as $vo)
@if ($vo->userId == $order_info['sale_id'])
<li><label><input type="radio" name="sale_id" value="{{$vo->userId}}" checked /><span>{{$vo->name}}</span></label></li>
@else
<li><label><input type="radio" name="sale_id" value="{{$vo->userId}}"/><span>{{$vo->name}}</span></label></li>
@endif
@endforeach
</ul>
</td>
</tr>
<tr>
<td>线销一组:</td>
<td>
<ul>
@foreach ($joint_kefu_1 as $vo)
@if ($vo->userId == $order_info['sale_id'])
<li><label><input type="radio" name="sale_id" value="{{$vo->userId}}" checked /><span>{{$vo->name}}</span></label></li>
@else
<li><label><input type="radio" name="sale_id" value="{{$vo->userId}}"/><span>{{$vo->name}}</span></label></li>
@endif
@endforeach
</ul>
</td>
</tr>
<tr>
<td>线销二组:</td>
<td>
<ul>
@foreach ($joint_kefu_2 as $vo)
@if ($vo->userId == $order_info['sale_id'])
<li><label><input type="radio" name="sale_id" value="{{$vo->userId}}" checked /><span>{{$vo->name}}</span></label></li>
@else
<li><label><input type="radio" name="sale_id" value="{{$vo->userId}}"/><span>{{$vo->name}}</span></label></li>
@endif
@endforeach
</ul>
</td>
</tr>
<tr>
<td>线销三组:</td>
<td>
<ul>
@foreach ($joint_kefu_3 as $vo)
@if ($vo->userId == $order_info['sale_id'])
<li><label><input type="radio" name="sale_id" value="{{$vo->userId}}" checked /><span>{{$vo->name}}</span></label></li>
@else
<li><label><input type="radio" name="sale_id" value="{{$vo->userId}}"/><span>{{$vo->name}}</span></label></li>
@endif
@endforeach
</ul>
</td>
</tr>
</table>
</ul>
</td>
</tr>
......@@ -49,7 +100,7 @@
<td class="check-table-title">交易员:</td>
<td>
<ul>
@foreach ($sale_list as $key => $vo)
@foreach ($sale_list as $vo)
@if ($vo->userId == $order_info['sale_id'])
<li><label><input type="radio" name="sale_id" value="{{$vo->userId}}" checked /><span>{{$vo->name}}</span></label></li>
@else
......@@ -67,7 +118,7 @@
<td>
<ul>
@foreach ($self_manager as $k => $v)
@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
......@@ -84,7 +135,7 @@
<td class="check-table-title">自营客服:</td>
<td>
<ul>
@foreach ($self_kefu as $key => $vo)
@foreach ($self_kefu as $vo)
@if ($vo->userId == $order_info['sale_id'])
<li><label><input type="radio" name="sale_id" value="{{$vo->userId}}" checked /><span>{{$vo->name}}</span></label></li>
@else
......@@ -101,7 +152,7 @@
<td class="check-table-title">测试:</td>
<td>
<ul>
@foreach ($test as $key => $vo)
@foreach ($test as $vo)
@if ($vo->userId == $order_info['sale_id'])
<li><label><input type="radio" name="sale_id" value="{{$vo->userId}}" checked /><span>{{$vo->name}}</span></label></li>
@else
......@@ -114,7 +165,7 @@
@endif
<!-- 查看权限:当前推送人 或 管理员、经理、测试、运营助理 或 自营客服主管 -->
@if ($sale_id == $order_info['sale_id'] || (in_array($role, [1, 2, 5, 8]) || in_array($role, [1, 10]) ))
@if ($sale_id == $order_info['sale_id'] || in_array($role, [1, 2, 5, 8, 10, 11, 14, 16, 18]))
<tr>
<td class="check-table-title">备注信息:</td>
<td>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment