Commit ea2a2ef7 by 朱继来

调整客服搜索权限

parent b151ce60
Showing with 17 additions and 6 deletions
......@@ -429,17 +429,28 @@ Class OrderController extends Controller
if (strpos($info['role'], ',') !== false) { // 多角色情况下
$res = $perm->checkUserRoles($request, $info['role']);
if ($res) {
$info['role'] = $res['role_id'];
$res['sale_id'] && $map['sale_id'] = $res['sale_id'];
}
$map['order_send'] && $map['sale_id'] = $map['order_send']; // 若存在查询指定客服
// 若无指定客服,则返回客服组里的所有订单
if (!$map['order_send']) {
$map['sale_id'] = $res['sale_id'];
} else if (!in_array($map['order_send'], $res['sale_id'])) { // 若指定客服不存在与客服组,则不能筛选
$map['sale_id'] = -1;
} else {
if (in_array($info['role'], Config('perm_args.kefu_order'))) { // 交易员、联营客服(线销一组、二组、三组客服)、自营客服、自营内部采购
$map['sale_id'] = $map['order_send'];
}
} else if (in_array($info['role'], Config('perm_args.kefu_order'))) { // 交易员、联营客服(线销一组、二组、三组客服)、自营客服、自营内部采购
$map['sale_id'] = $request->user->userId; // 筛选自己的订单
} else if (in_array($info['role'], Config('perm_args.manager_order'))) { // 线销一组、二组、三组主管(查看自己及其下组员的订单)
$map['sale_id'] = $perm->getGroupSalesId($request, $info['role']);
$sale_ids = $perm->getGroupSalesId($request, $info['role']);
// 若无指定客服,则返回客服组里的所有订单
if (!$map['order_send']) {
$map['sale_id'] = $sale_ids;
} else if (!in_array($map['order_send'], $sale_ids)) { // 若指定客服不存在与客服组,则不能筛选
$map['sale_id'] = -1;
} else {
$map['sale_id'] = $map['order_send'];
}
}
......
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