表单功能完善
This commit is contained in:
@@ -115,10 +115,11 @@ class Form extends Base {
|
||||
$list = $this->model->order('id desc')->paginate(25);
|
||||
|
||||
$this->data = array(
|
||||
'grid' => $this->modelInfo['grid_list'],
|
||||
'meta_title' => $this->modelInfo['title'] . '列表',
|
||||
'form_id' => $form_id,
|
||||
'list' => $list,
|
||||
'page' => $list->render()
|
||||
'page' => $list->render(),
|
||||
);
|
||||
return $this->fetch();
|
||||
}
|
||||
@@ -192,7 +193,7 @@ class Form extends Base {
|
||||
$data = $this->request->post();
|
||||
$result = FormAttr::create($data);
|
||||
if (false !== $result) {
|
||||
return $this->success('添加成功!', url('admin/form/attr?form_id='.$form_id));
|
||||
return $this->success('添加成功!', url('/admin/form/attr', ['form_id'=>$form_id]));
|
||||
}else{
|
||||
return $this->error($this->Fattr->getError());
|
||||
}
|
||||
@@ -218,9 +219,9 @@ class Form extends Base {
|
||||
}
|
||||
if ($this->request->isPost()) {
|
||||
$data = $request->post();
|
||||
$result = $this->Fattr->save($data, array('id'=>$data['id']));
|
||||
$result = FormAttr::update($data, array('id'=>$data['id']));
|
||||
if (false !== $result) {
|
||||
return $this->success('修改成功!', url('admin/form/attr?form_id='.$form_id));
|
||||
return $this->success('修改成功!', url('/admin/form/attr', ['form_id'=>$form_id]));
|
||||
}else{
|
||||
return $this->error($this->Fattr->getError());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user