Commit d0929449 by 朱继来

调整退货页面

parent 667e8e68
Showing with 4 additions and 28 deletions
......@@ -125,8 +125,8 @@ class ReturnController extends Controller
$map['order_goods_type'] = $type; // 类型
$map['sale_id'] = $request->input('sale_id', '');
// 非管理员、经理、自营主管、自营主管助理,只能看到自己的退货单
if (!in_array($info['role'], [1, 2, 10, 11])) {
// 非管理员、查看下级,只能看到自己的退货单
if (!in_array($info['role'], [1, 2])) {
$map['create_uid'] = $request->user->userId;
}
......@@ -170,32 +170,8 @@ class ReturnController extends Controller
// $self_kefu = $perm->getRoleUsers($request, '自营客服');
// $info['sale_list'] = array_merge($joint_kefu, $self_kefu);
$key = 'search_self_sales';
$redis = Redis::connection('read');
$sale_list = $redis->get($key);
if (!$sale_list) {
// 获取所有的业务员 (包括经理、交易员、客服、测试)
$perm = new PermController;
$sale_list = [];
$search_sales = Config('perm_args.search_self_sales');
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);
}
}
$sale_list = $this->assoc_unique($sale_list);
$expire = Config('perm_args.redis_search_sales_expire'); // 缓存两小时
Redis::setex($key, $expire, json_encode($sale_list));
} else {
$sale_list = json_decode($sale_list);
}
$perm = new PermController;
$sale_list = $perm->getUserByCondition('', Config('perm_args.sales_position_id')); // 获取所有的销售
$info['sale_list'] = $sale_list;
......
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