2023-01-29 10:26:52 +08:00

34 lines
1.3 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
namespace app\common\model;
/**
* 分类模型
*/
class Action extends Base{
protected function getStatusTextAttr($value, $data){
$status = array(-1=>'删除',0=>'禁用',1=>'正常',2=>'待审核');
return $status[$data['status']];
}
public $fieldlist = array(
array('name'=>'id','title'=>'ID','type'=>'hidden'),
array('name'=>'name','title'=>'行为标识','type'=>'text','help'=>'输入行为标识 英文字母'),
array('name'=>'title','title'=>'行为名称','type'=>'text','help'=>'输入行为名称'),
array('name'=>'type','title'=>'行为类型','type'=>'select','help'=>'选择行为类型','option'=>array('1'=>'系统','2'=>'用户')),
array('name'=>'remark','title'=>'行为描述','type'=>'textarea','help'=>'输入行为描述'),
array('name'=>'rule','title'=>'行为规则','type'=>'textarea','help'=>'输入行为规则,不写则只记录日志'),
array('name'=>'log','title'=>'日志规则','type'=>'textarea','help'=>'记录日志备注时按此规则来生成,支持[变量|函数]。目前变量有user,time,model,record'),
);
public function _initialize(){
parent::_initialize();
foreach ($this->fieldlist as $key => $value) {
if ($value['name'] == 'type') {
$value['option'] = get_action_type(null,true);
}
$this->fieldlist[$key] = $value;
}
}
}