Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
杨建斌
/
page
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
1
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
63b0c115
authored
2018-03-30 15:03:03 +0800
by
wang
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
init
1 parent
59b0f22e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
2 deletions
application/controllers/Perm.php
application/views/perm/staffEdit.php
application/controllers/Perm.php
View file @
63b0c11
...
...
@@ -32,10 +32,14 @@ class Perm extends CI_Controller {
$result
=
file_get_contents
(
$url
);
$json
=
json_decode
(
$result
);
$ret
=
$json
->
data
;
// $roles =
$roles
=
array
();
foreach
(
$json
->
data
->
roles
as
$v
){
$roles
[]
=
$v
->
id
;
}
$data
=
array
(
'item'
=>
$ret
,
'roles'
=>
$roles
,
'id'
=>
$id
);
$this
->
load
->
view
(
'perm/staffEdit'
,
$data
);
...
...
application/views/perm/staffEdit.php
View file @
63b0c11
...
...
@@ -32,7 +32,7 @@
<option
value=
"
<?=
$v
->
id
?>
"
>
<?=
$v
->
name
?>
</option>
<?php
if
(
$v
->
children
&&
!
empty
(
$v
->
children
))
:
?>
<?php
foreach
(
$v
->
children
as
$kk
=>
$vv
)
:
?>
<option
value=
"
<?=
$vv
->
id
?>
"
<?php
if
(
$item
->
department_id
==
$v
->
id
)
echo
'selected'
;
?>
>
<?=
$vv
->
name
?>
</option>
<option
value=
"
<?=
$vv
->
id
?>
"
<?php
if
(
in_array
(
$vv
->
id
,
$roles
)
)
echo
'selected'
;
?>
>
<?=
$vv
->
name
?>
</option>
<?php
endforeach
;
?>
<?php
endif
;
?>
<?php
endforeach
;
?>
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
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 post a comment