63b0c115 by wang

init

1 parent 59b0f22e
......@@ -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);
......
......@@ -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; ?>
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!