public function powerEdit(){
$group_id = $this->md->getAuthInfo('group_id');
$group_keys = $this->m_group->where('id='.$group_id)->getField('group_keys');
$id=I('id','','int');
$baoxiu_id = $this->m_group->where('id='.$id)->getField('baoxiu');
$id = I('id',0,'int');
$baoxiu = array(
'1'=>'教室维修','2'=>'供电维修',
'3'=>'木瓦维修','4'=>'生活维修',
'5'=>'供水维修','6'=>'供暖维修',
'7' => '网络维修',
);
$dataInfo = $this->m_group->find($id);
$this->assign('dataInfo',$dataInfo);
$subNav = C('NAV');
$this->assign('subNav',$subNav);
$this->assign('baoxiu',$baoxiu);
$this->assign('baoxiu_id',$baoxiu_id);
$this->display();
}
public function powerSave(){
$temp = $this->m_group->create();
$temp['group_keys'] = implode(',',$temp['group_keys']);
$temp['baoxiu'] = implode(',',$temp['baoxiu']);
if($temp['id']){
$this->m_group->save($temp);
$this->success($GLOBALS['notice']['success'][2],U('User/power'));
}else{
$result = $this->m_group->add($temp);
if($result)$this->success('增加完毕',U('User/power'));
else $this->success('增加失败');
}
}
public function powerDel(){
$id = I('id',0,'int');
if ($this->m_group->delete($id)){
$this->success($GLOBALS['notice']['success'][1]);
}else{
$this->error($GLOBALS['notice']['error'][1]);
}
}