63b0c115 by wang

init

1 parent 59b0f22e
...@@ -32,10 +32,14 @@ class Perm extends CI_Controller { ...@@ -32,10 +32,14 @@ class Perm extends CI_Controller {
32 $result = file_get_contents($url); 32 $result = file_get_contents($url);
33 $json = json_decode($result); 33 $json = json_decode($result);
34 $ret = $json->data; 34 $ret = $json->data;
35 // $roles = 35 $roles = array();
36 foreach($json->data->roles as $v){
37 $roles[] = $v->id;
38 }
36 39
37 $data = array( 40 $data = array(
38 'item'=>$ret, 41 'item'=>$ret,
42 'roles'=>$roles,
39 'id'=>$id 43 'id'=>$id
40 ); 44 );
41 $this->load->view('perm/staffEdit',$data); 45 $this->load->view('perm/staffEdit',$data);
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
32 <option value="<?= $v->id ?>"><?= $v->name ?></option> 32 <option value="<?= $v->id ?>"><?= $v->name ?></option>
33 <?php if ($v->children && !empty($v->children)): ?> 33 <?php if ($v->children && !empty($v->children)): ?>
34 <?php foreach ($v->children as $kk => $vv): ?> 34 <?php foreach ($v->children as $kk => $vv): ?>
35 <option value="<?= $vv->id ?>" <?php if($item->department_id==$v->id) echo 'selected';?> ><?= $vv->name ?></option> 35 <option value="<?= $vv->id ?>" <?php if(in_array($vv->id,$roles)) echo 'selected';?> ><?= $vv->name ?></option>
36 <?php endforeach; ?> 36 <?php endforeach; ?>
37 <?php endif; ?> 37 <?php endif; ?>
38 <?php endforeach; ?> 38 <?php endforeach; ?>
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!