初始化项目
This commit is contained in:
48
application/common/model/AuthRule.php
Normal file
48
application/common/model/AuthRule.php
Normal file
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | SentCMS [ WE CAN DO IT JUST THINK IT ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2013 http://www.tensent.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: molong <molong@tensent.cn> <http://www.tensent.cn>
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\common\model;
|
||||
|
||||
/**
|
||||
* 设置模型
|
||||
*/
|
||||
class AuthRule extends Base{
|
||||
|
||||
const rule_url = 1;
|
||||
const rule_mian = 2;
|
||||
|
||||
protected $type = array(
|
||||
'id' => 'integer',
|
||||
);
|
||||
|
||||
public $keyList = array(
|
||||
array('name'=>'id','title'=>'标识','type'=>'hidden'),
|
||||
array('name'=>'module','title'=>'所属模块','type'=>'hidden'),
|
||||
array('name'=>'title','title'=>'节点名称','type'=>'text','help'=>''),
|
||||
array('name'=>'name','title'=>'节点标识','type'=>'text','help'=>''),
|
||||
array('name'=>'group','title'=>'功能组','type'=>'text','help'=>'功能分组'),
|
||||
array('name'=>'status','title'=>'状态','type'=>'select','option'=>array('1'=>'启用','0'=>'禁用'),'help'=>''),
|
||||
array('name'=>'condition','title'=>'条件','type'=>'text','help'=>'')
|
||||
);
|
||||
|
||||
public function change(){
|
||||
$data = input('post.');
|
||||
if ($data['id']) {
|
||||
$result = $this->save($data, array('id'=>$data));
|
||||
}else{
|
||||
$result = $this->save($data);
|
||||
}
|
||||
if (false !== $result) {
|
||||
return true;
|
||||
}else{
|
||||
$this->error = "失败!";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user