修复后台模块
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
namespace app\controller\admin;
|
||||
|
||||
use app\model\Model as ModelM;
|
||||
use app\model\Attribute;
|
||||
|
||||
/**
|
||||
* @title 模型管理
|
||||
@@ -74,11 +75,11 @@ class Model extends Base {
|
||||
return $this->error($this->model->getError());
|
||||
}
|
||||
} else {
|
||||
$info = $this->model->where('id', $request->param('id'))->find();
|
||||
$info = ModelM::find($request->param('id'));
|
||||
|
||||
$field_group = parse_config_attr($info['attribute_group']);
|
||||
//获取字段列表
|
||||
$rows = db('Attribute')->where('model_id', $request->param('id'))->where('is_show', 1)->order('group_id asc, sort asc')->select();
|
||||
$rows = Attribute::where('model_id', $request->param('id'))->where('is_show', 1)->order('group_id asc, sort asc')->select();
|
||||
if ($rows) {
|
||||
// 梳理属性的可见性
|
||||
foreach ($rows as $key => $field) {
|
||||
@@ -90,13 +91,11 @@ class Model extends Base {
|
||||
} else {
|
||||
$fields = array();
|
||||
}
|
||||
$data = array(
|
||||
$this->data = array(
|
||||
'info' => $info,
|
||||
'field_group' => $field_group,
|
||||
'fields' => $fields,
|
||||
);
|
||||
$this->assign($data);
|
||||
$this->setMeta('编辑模型');
|
||||
return $this->fetch();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user