功能更新
This commit is contained in:
@@ -6,9 +6,10 @@
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: molong <molong@tensent.cn> <http://www.tensent.cn>
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\controller\admin;
|
||||
|
||||
use app\model\Attribute as AttributeModel;
|
||||
|
||||
/**
|
||||
* @title 字段管理
|
||||
* @description 字段管理
|
||||
@@ -16,32 +17,32 @@ namespace app\controller\admin;
|
||||
class Attribute extends Base {
|
||||
|
||||
//保存的Model句柄
|
||||
protected $model;
|
||||
protected $attr;
|
||||
// protected $model;
|
||||
// protected $attr;
|
||||
|
||||
//初始化
|
||||
public function _initialize() {
|
||||
parent::_initialize();
|
||||
public function initialize() {
|
||||
parent::initialize();
|
||||
$this->getContentMenu();
|
||||
$this->model = model('Attribute');
|
||||
//遍历属性列表
|
||||
foreach (get_attribute_type() as $key => $value) {
|
||||
$this->attr[$key] = $value[0];
|
||||
}
|
||||
$this->validate_rule = array(
|
||||
0 => '请选择',
|
||||
'regex' => '正则验证',
|
||||
'function' => '函数验证',
|
||||
'unique' => '唯一验证',
|
||||
'length' => '长度验证',
|
||||
'in' => '验证在范围内',
|
||||
'notin' => '验证不在范围内',
|
||||
'between' => '区间验证',
|
||||
'notbetween' => '不在区间验证',
|
||||
);
|
||||
$this->auto_type = array(0 => '请选择', 'function' => '函数', 'field' => '字段', 'string' => '字符串');
|
||||
$this->the_time = array(0 => '请选择', '3' => '始 终', '1' => '新 增', '2' => '编 辑');
|
||||
$this->field = $this->getField();
|
||||
// $this->model = model('Attribute');
|
||||
// //遍历属性列表
|
||||
// foreach (get_attribute_type() as $key => $value) {
|
||||
// $this->attr[$key] = $value[0];
|
||||
// }
|
||||
// $this->validate_rule = array(
|
||||
// 0 => '请选择',
|
||||
// 'regex' => '正则验证',
|
||||
// 'function' => '函数验证',
|
||||
// 'unique' => '唯一验证',
|
||||
// 'length' => '长度验证',
|
||||
// 'in' => '验证在范围内',
|
||||
// 'notin' => '验证不在范围内',
|
||||
// 'between' => '区间验证',
|
||||
// 'notbetween' => '不在区间验证',
|
||||
// );
|
||||
// $this->auto_type = array(0 => '请选择', 'function' => '函数', 'field' => '字段', 'string' => '字符串');
|
||||
// $this->the_time = array(0 => '请选择', '3' => '始 终', '1' => '新 增', '2' => '编 辑');
|
||||
// $this->field = $this->getField();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -52,17 +53,13 @@ class Attribute extends Base {
|
||||
if (!$model_id) {
|
||||
return $this->error('非法操作!');
|
||||
}
|
||||
$list = model('Attribute')->where('model_id', $model_id)->order('id desc')->paginate(25, false, array(
|
||||
'query' => $this->request->param(),
|
||||
));
|
||||
$list = AttributeModel::where('model_id', $model_id)->order('id desc')->paginate($this->request->pageConfig);
|
||||
|
||||
$data = array(
|
||||
$this->data = array(
|
||||
'list' => $list,
|
||||
'model_id' => $model_id,
|
||||
'page' => $list->render(),
|
||||
);
|
||||
$this->assign($data);
|
||||
$this->setMeta('字段管理');
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user