Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
semour
/
semour_admin
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
d5d11062
authored
Dec 06, 2022
by
宁成龙
Browse files
Options
_('Browse Files')
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
25d1b1c3
1e7721a8
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
155 additions
and
28 deletions
app/Admin/Controllers/Api/OrderApiController.php
app/Admin/Controllers/HomeController.php
app/Http/Middleware/Permission.php
config/perm.php
resources/views/dashboard/dependencies.blade.php
resources/views/dashboard/environment.blade.php
resources/views/dashboard/extensions.blade.php
resources/views/dashboard/title.blade.php
resources/views/export/order_contract_CI.blade.php
resources/views/export/order_contract_PI.blade.php
resources/views/export/order_contract_PL.blade.php
app/Admin/Controllers/Api/OrderApiController.php
View file @
d5d11062
...
@@ -27,7 +27,7 @@ class OrderApiController extends BaseController
...
@@ -27,7 +27,7 @@ class OrderApiController extends BaseController
$params
=
$request
->
all
();
$params
=
$request
->
all
();
$type
=
arrayGet
(
$params
,
"type"
);
$type
=
arrayGet
(
$params
,
"type"
);
$order_id
=
203
;
$order_id
=
69
;
$orderAddressList
=
OrderService
::
getOrderAddress
(
$order_id
);
$orderAddressList
=
OrderService
::
getOrderAddress
(
$order_id
);
$orderAddressList
=
arrayChangeKeyByField
(
$orderAddressList
,
"order_address_type"
);
$orderAddressList
=
arrayChangeKeyByField
(
$orderAddressList
,
"order_address_type"
);
// dump($orderAddressList);
// dump($orderAddressList);
...
@@ -117,6 +117,8 @@ class OrderApiController extends BaseController
...
@@ -117,6 +117,8 @@ class OrderApiController extends BaseController
$info
[
"orderList"
]
=
OrderService
::
getOrderList
(
$order_id
);
$info
[
"orderList"
]
=
OrderService
::
getOrderList
(
$order_id
);
$info
[
"orderList"
][
"adminUser"
]
=
CmsUser
::
getInfoByUserId
(
$info
[
"orderList"
][
"sale_id"
]);
// dd($info);
// dd($info);
if
(
$type
==
"1"
){
if
(
$type
==
"1"
){
...
...
app/Admin/Controllers/HomeController.php
View file @
d5d11062
...
@@ -18,20 +18,20 @@ class HomeController extends Controller
...
@@ -18,20 +18,20 @@ class HomeController extends Controller
->
header
(
'Dashboard'
)
->
header
(
'Dashboard'
)
->
description
(
'Description...'
)
->
description
(
'Description...'
)
->
body
(
function
(
Row
$row
)
{
->
body
(
function
(
Row
$row
)
{
$row
->
column
(
6
,
function
(
Column
$column
)
{
$row
->
column
(
12
,
function
(
Column
$column
)
{
$column
->
row
(
Dashboard
::
title
(
));
$column
->
row
(
view
(
'dashboard.title'
));
$column
->
row
(
new
Examples\Tickets
());
//
$column->row(new Examples\Tickets());
});
});
$row
->
column
(
6
,
function
(
Column
$column
)
{
//
$row->column(6, function (Column $column) {
$column
->
row
(
function
(
Row
$row
)
{
//
$column->row(function (Row $row) {
$row
->
column
(
6
,
new
Examples\NewUsers
());
//
$row->column(6, new Examples\NewUsers());
$row
->
column
(
6
,
new
Examples\NewDevices
());
//
$row->column(6, new Examples\NewDevices());
});
//
});
//
$column
->
row
(
new
Examples\Sessions
());
//
$column->row(new Examples\Sessions());
$column
->
row
(
new
Examples\ProductOrders
());
//
$column->row(new Examples\ProductOrders());
});
//
});
});
});
}
}
}
}
app/Http/Middleware/Permission.php
View file @
d5d11062
...
@@ -33,7 +33,7 @@ class Permission
...
@@ -33,7 +33,7 @@ class Permission
$menus
=
!
in_array
(
$request
->
user
->
userId
,
$permData
[
'admin_group'
])
?
$menus
=
!
in_array
(
$request
->
user
->
userId
,
$permData
[
'admin_group'
])
?
$this
->
menu
(
$menuData
,
$request
->
user
->
userId
)
:
$menuData
;
$this
->
menu
(
$menuData
,
$request
->
user
->
userId
)
:
$menuData
;
if
(
empty
(
$menus
))
{
if
(
empty
(
$menus
))
{
return
$this
->
view
(
'Auth'
,
'没有访问权限'
,
$permData
[
'go_url'
])
;
echo
'菜单生成错误,请联系技术'
;
}
}
$request
->
menus
=
$menus
;
$request
->
menus
=
$menus
;
...
@@ -42,12 +42,12 @@ class Permission
...
@@ -42,12 +42,12 @@ class Permission
$request
->
perms
=
$perms
;
$request
->
perms
=
$perms
;
}
}
if
(
!
in_array
(
$user
->
userId
,
$permData
[
'admin_group'
])
&&
$action
!=
'Dashboard'
)
{
//不是超级管理员
if
(
!
in_array
(
$user
->
userId
,
$permData
[
'admin_group'
])
&&
$action
!=
'Dashboard'
)
{
//不是超级管理员
$perm
=
$this
->
perm
(
$request
->
user
->
userId
,
$action
);
$perm
=
$this
->
perm
(
$request
->
user
->
userId
,
strtolower
(
$action
)
);
if
(
$perm
!==
true
)
{
if
(
$perm
!==
true
)
{
if
(
$isApi
)
{
if
(
$isApi
)
{
return
'没有权限'
;
return
'没有权限'
;
}
}
return
$this
->
view
(
'Auth'
,
'没有访问权限'
,
$permData
[
'go_url'
])
;
echo
'没有访问权限'
;
}
}
}
}
...
@@ -138,11 +138,12 @@ class Permission
...
@@ -138,11 +138,12 @@ class Permission
function
perm
(
$userId
,
$perm
=
''
)
function
perm
(
$userId
,
$perm
=
''
)
{
{
$permArr
=
config
(
'perm.perm'
);
$permArr
=
config
(
'perm.perm'
);
$notAuth
=
$permArr
[
'not
A
uth'
];
$notAuth
=
$permArr
[
'not
_a
uth'
];
$AdminID
=
$permArr
[
'admin
G
roup'
];
$AdminID
=
$permArr
[
'admin
_g
roup'
];
if
((
!
in_array
(
$perm
,
$notAuth
))
&&
!
in_array
(
$userId
,
$AdminID
))
{
//过滤不用鉴权的方法与用户
if
((
!
in_array
(
$perm
,
$notAuth
))
&&
!
in_array
(
$userId
,
$AdminID
))
{
//过滤不用鉴权的方法与用户
$permID
=
$permArr
[
'id'
];
$permID
=
$permArr
[
'id'
];
$url
=
$permArr
[
'url'
]
.
'/'
.
$userId
.
'/'
.
$permID
.
'?perms='
.
$perm
;
$url
=
$permArr
[
'url'
]
.
'/'
.
$userId
.
'/'
.
$permID
.
'?perms='
.
$perm
;
dd
(
$url
);
$result
=
json_decode
(
curl
(
$url
,
''
,
0
),
true
);
$result
=
json_decode
(
curl
(
$url
,
''
,
0
),
true
);
if
(
!
isset
(
$result
[
'retcode'
])
||
$result
[
'retcode'
]
!==
0
||
$result
[
'data'
][
'perms'
][
$perm
]
==
false
)
{
if
(
!
isset
(
$result
[
'retcode'
])
||
$result
[
'retcode'
]
!==
0
||
$result
[
'data'
][
'perms'
][
$perm
]
==
false
)
{
return
false
;
return
false
;
...
...
config/perm.php
View file @
d5d11062
...
@@ -8,6 +8,6 @@ return [
...
@@ -8,6 +8,6 @@ return [
'admin_group'
=>
explode
(
','
,
env
(
'ADMIN_GROUP'
)),
//管理员权限组,有所有权限
'admin_group'
=>
explode
(
','
,
env
(
'ADMIN_GROUP'
)),
//管理员权限组,有所有权限
'menu_id'
=>
env
(
'MENU_ID'
),
'menu_id'
=>
env
(
'MENU_ID'
),
'menu_url'
=>
env
(
'MENU_URL'
),
'menu_url'
=>
env
(
'MENU_URL'
),
'not_auth'
=>
[]
'not_auth'
=>
[
'index'
]
]
]
];
];
resources/views/dashboard/dependencies.blade.php
0 → 100644
View file @
d5d11062
<style>
.table
tr
:first-child
td
{
border-top
:
0
;
}
</style>
<div
class=
"table-responsive"
>
<table
class=
"table"
>
@foreach($dependencies as $dependency => $version)
<tr>
<td
width=
"240px"
class=
"bold text-80"
>
{{ $dependency }}
</td>
<td><span
class=
"label bg-primary"
>
{{ $version }}
</span></td>
</tr>
@endforeach
</table>
</div>
\ No newline at end of file
resources/views/dashboard/environment.blade.php
0 → 100644
View file @
d5d11062
<div
class=
"table-responsive"
>
<table
class=
"table"
>
@foreach($envs as $env)
<tr>
<td
width=
"120px"
class=
"bold text-80"
>
{{ $env['name'] }}
</td>
<td>
{{ $env['value'] }}
</td>
</tr>
@endforeach
</table>
</div>
\ No newline at end of file
resources/views/dashboard/extensions.blade.php
0 → 100644
View file @
d5d11062
<style>
.ext-icon
{
color
:
rgba
(
0
,
0
,
0
,
0.5
);
margin-left
:
10px
;
}
.installed
{
color
:
#00a65a
;
margin-right
:
15px
;
font-size
:
20px
;
}
</style>
<ul
class=
"products-list product-list-in-box"
id=
"extension-box"
style=
"margin-top:10px;min-height: 100px"
>
@foreach($extensions as $extension)
<li
class=
"item hidden"
>
<div
class=
"product-img"
>
<i
class=
"{{$extension['icon']}} fa-2x ext-icon"
></i>
</div>
<div
class=
"product-info"
data-key=
"{{$extension['key']}}"
>
<a
href=
"{{ $extension['link'] }}"
target=
"_blank"
class=
""
>
{{ $extension['name'] }}
</a>
@if($extension['installed'])
<span
class=
"pull-right installed"
><i
class=
"ti-check"
></i></span>
@endif
</div>
</li>
@endforeach
</ul>
<div
class=
"box-footer text-center"
>
<a
href=
"https://github.com/jqhph/dcat-admin#%E6%89%A9%E5%B1%95"
target=
"_blank"
class=
"uppercase"
>
View All Extensions
</a>
</div>
<script>
Dcat
.
ready
(
function
()
{
// var $box = $('#extension-box');
// $box.loading();
//
// $.ajax({
// url: 'https://jqhph.github.io/dcat-admin/extra/extensions.html',
// success: function (response) {
// $box.loading(false);
//
// $box.html(response);
// },
// error: function () {
// $box.loading(false);
//
// $box.find('.item').removeClass('hidden');
// }
// });
})
</script>
\ No newline at end of file
resources/views/dashboard/title.blade.php
0 → 100644
View file @
d5d11062
<style>
.dashboard-title
.links
{
text-align
:
center
;
margin-bottom
:
2.5rem
;
}
.dashboard-title
.links
>
a
{
padding
:
0
25px
;
font-size
:
12px
;
font-weight
:
600
;
letter-spacing
:
.1rem
;
text-decoration
:
none
;
text-transform
:
uppercase
;
color
:
#fff
;
}
.dashboard-title
h1
{
font-weight
:
200
;
font-size
:
2.5rem
;
}
.dashboard-title
.avatar
{
background
:
#fff
;
border
:
2px
solid
#fff
;
width
:
70px
;
height
:
70px
;
}
</style>
<div
class=
"dashboard-title card bg-primary"
>
<div
class=
"card-body"
style=
"min-height: 100%"
>
<div
class=
"text-center "
>
<img
class=
"avatar img-circle shadow mt-1"
style=
"width: 500px"
src=
"{{ admin_asset('@admin/images/logo.png') }}"
>
<div
class=
"text-center mb-1"
>
<h1
class=
"mb-3 mt-2 text-white"
>
Semour Admin
</h1>
<div
class=
"links"
>
{{--
<a
href=
"https://github.com/jqhph/dcat-admin"
target=
"_blank"
>
Github
</a>
--}}
{{--
<a
href=
"http://www.dcatadmin.com/"
id=
"doc-link"
target=
"_blank"
>
{{ __('admin.documentation') }}
</a>
--}}
{{--
<a
href=
"http://www.dcatadmin.com/"
id=
"demo-link"
target=
"_blank"
>
{{ __('admin.extensions') }}
</a>
--}}
{{--
<a
href=
"https://jqhph.github.io/dcat-admin/demo.html"
id=
"demo-link"
target=
"_blank"
>
{{ __('admin.demo') }}
</a>
--}}
</div>
</div>
</div>
</div>
</div>
resources/views/export/order_contract_CI.blade.php
View file @
d5d11062
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
</tr>
</tr>
<tr>
<tr>
<td
colspan=
"10"
style=
"text-align:center"
>
<td
colspan=
"10"
style=
"text-align:center"
>
SELLER /CONTACT:{{@$info["orderList"]["adminUser"]["
n
ame"]}} Email:{{@$info["orderList"]["adminUser"]["email"]}} Tel: +86{{@$info["orderList"]["adminUser"]["mobile"]}} Fax: (+86){{@$info["orderList"]["adminUser"]["fax"]}} Mob:
SELLER /CONTACT:{{@$info["orderList"]["adminUser"]["
engN
ame"]}} Email:{{@$info["orderList"]["adminUser"]["email"]}} Tel: +86{{@$info["orderList"]["adminUser"]["mobile"]}} Fax: (+86){{@$info["orderList"]["adminUser"]["fax"]}} Mob:
+86{{@$info["orderList"]["adminUser"]["mobile"]}}
+86{{@$info["orderList"]["adminUser"]["mobile"]}}
</td>
</td>
</tr>
</tr>
...
...
resources/views/export/order_contract_PI.blade.php
View file @
d5d11062
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
</tr>
</tr>
<tr>
<tr>
<td
colspan=
"10"
style=
"text-align:center"
>
<td
colspan=
"10"
style=
"text-align:center"
>
SELLER /CONTACT:{{@$info["orderList"]["adminUser"]["
n
ame"]}} Email:{{@$info["orderList"]["adminUser"]["email"]}} Tel: +86{{@$info["orderList"]["adminUser"]["mobile"]}} Fax: (+86){{@$info["orderList"]["adminUser"]["fax"]}} Mob:
SELLER /CONTACT:{{@$info["orderList"]["adminUser"]["
engN
ame"]}} Email:{{@$info["orderList"]["adminUser"]["email"]}} Tel: +86{{@$info["orderList"]["adminUser"]["mobile"]}} Fax: (+86){{@$info["orderList"]["adminUser"]["fax"]}} Mob:
+86{{@$info["orderList"]["adminUser"]["mobile"]}}
+86{{@$info["orderList"]["adminUser"]["mobile"]}}
</td>
</td>
</tr>
</tr>
...
@@ -79,10 +79,10 @@
...
@@ -79,10 +79,10 @@
<td>
{{@$bill["consignee"]}}
</td>
<td>
{{@$bill["consignee"]}}
</td>
<td>
<td>
@if(!empty($info["orderList"]["scm_user"]))
@if(!empty($info["orderList"]["scm_user"]))
@if($info["orderList"]["scm_user"]["name"])
@if($info["orderList"]["scm_user"]["company_name"])
{{$info["orderList"]["scm_user"]["name"]}}
@else
{{$info["orderList"]["scm_user"]["company_name"]}}
{{$info["orderList"]["scm_user"]["company_name"]}}
@else
{{$info["orderList"]["scm_user"]["name"]}}
@endif
@endif
@endif
@endif
</td>
</td>
...
...
resources/views/export/order_contract_PL.blade.php
View file @
d5d11062
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
</tr>
</tr>
<tr>
<tr>
<td
colspan=
"10"
style=
"text-align:center"
>
<td
colspan=
"10"
style=
"text-align:center"
>
SELLER /CONTACT:{{@$info["orderList"]["adminUser"]["
n
ame"]}} Email:{{@$info["orderList"]["adminUser"]["email"]}} Tel: +86{{@$info["orderList"]["adminUser"]["mobile"]}} Fax: (+86){{@$info["orderList"]["adminUser"]["fax"]}} Mob:
SELLER /CONTACT:{{@$info["orderList"]["adminUser"]["
engN
ame"]}} Email:{{@$info["orderList"]["adminUser"]["email"]}} Tel: +86{{@$info["orderList"]["adminUser"]["mobile"]}} Fax: (+86){{@$info["orderList"]["adminUser"]["fax"]}} Mob:
+86{{@$info["orderList"]["adminUser"]["mobile"]}}
+86{{@$info["orderList"]["adminUser"]["mobile"]}}
</td>
</td>
</tr>
</tr>
...
@@ -80,10 +80,10 @@
...
@@ -80,10 +80,10 @@
<td>
{{@$bill["consignee"]}}
</td>
<td>
{{@$bill["consignee"]}}
</td>
<td>
<td>
@if(!empty($info["orderList"]["scm_user"]))
@if(!empty($info["orderList"]["scm_user"]))
@if($info["orderList"]["scm_user"]["name"])
@if($info["orderList"]["scm_user"]["company_name"])
{{$info["orderList"]["scm_user"]["name"]}}
@else
{{$info["orderList"]["scm_user"]["company_name"]}}
{{$info["orderList"]["scm_user"]["company_name"]}}
@else
{{$info["orderList"]["scm_user"]["name"]}}
@endif
@endif
@endif
@endif
</td>
</td>
...
...
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