Commit 085739bc by 朱继来

调整列表业务员筛选

parent 3846a512
......@@ -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)
{
......
......@@ -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, // 缓存两小时
];
......@@ -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>
......
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