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
a8e39254
authored
Jan 08, 2020
by
朱继来
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
调整自营退货页面客服
parent
a9a4f72a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
52 additions
and
22 deletions
app/Http/Controllers/Controller.php
app/Http/Controllers/OrderController.php
app/Http/Controllers/ReturnController.php
app/Http/Controllers/Controller.php
View file @
a8e39254
...
...
@@ -13,4 +13,23 @@ use Symfony\Component\HttpKernel\Exception\HttpException;
class
Controller
extends
BaseController
{
use
AuthorizesRequests
,
DispatchesJobs
,
ValidatesRequests
;
// 二维数组,针对某个键名去重
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
);
// 重新索引
}
}
app/Http/Controllers/OrderController.php
View file @
a8e39254
...
...
@@ -572,24 +572,6 @@ 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
)
{
...
...
app/Http/Controllers/ReturnController.php
View file @
a8e39254
...
...
@@ -11,6 +11,7 @@ use App\Model\OrderReturnItemsModel;
use
DB
;
use
App\Http\Page
;
use
App\Model\UserMainModel
;
use
Illuminate\Support\Facades\Redis
;
// 获取支付名称
function
getPayName
(
$order_id
)
...
...
@@ -164,11 +165,39 @@ class ReturnController extends Controller
$info
[
'count'
]
=
$response
[
'data'
][
'count'
];
$info
[
'page'
]
=
$show
;
$perm
=
new
PermController
;
$joint_kefu
=
$perm
->
getRoleUsers
(
$request
,
'客服'
);
$self_kefu
=
$perm
->
getRoleUsers
(
$request
,
'自营客服'
);
// $perm = new PermController;
// $joint_kefu = $perm->getRoleUsers($request, '客服');
// $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
);
}
$info
[
'sale_list'
]
=
array_merge
(
$joint_kefu
,
$self_kefu
)
;
$info
[
'sale_list'
]
=
$sale_list
;
return
$info
;
}
...
...
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