Commit 211149c2 authored by 章建武's avatar 章建武

dep

parent f725297a
...@@ -58,11 +58,6 @@ class ManagerController extends Controller ...@@ -58,11 +58,6 @@ class ManagerController extends Controller
{ {
if ($request->isPost()) { if ($request->isPost()) {
$param = $request->param(); $param = $request->param();
if($param['language_type'] == '英语'){
$param['language_type'] = 1;
}else{
$param['language_type'] = 0;
}
$param['url'] = 'http://'.$_SERVER['SERVER_NAME']; $param['url'] = 'http://'.$_SERVER['SERVER_NAME'];
$param['created_at'] = time(); $param['created_at'] = time();
$validate_result = $validate->scene('add')->check($param); $validate_result = $validate->scene('add')->check($param);
...@@ -78,7 +73,6 @@ class ManagerController extends Controller ...@@ -78,7 +73,6 @@ class ManagerController extends Controller
return error($attachment_avatar->getError()); return error($attachment_avatar->getError());
} }
$result = $model::create($param); $result = $model::create($param);
$url = URL_BACK; $url = URL_BACK;
...@@ -93,22 +87,15 @@ class ManagerController extends Controller ...@@ -93,22 +87,15 @@ class ManagerController extends Controller
'language_type' => $model->language_type 'language_type' => $model->language_type
]); ]);
return $this->fetch(); return $this->fetch();
} }
//修改 //修改
public function edit($id, Request $request, ManagerList $model, ManagerListValidate $validate) public function edit($id, Request $request, ManagerList $model, ManagerListValidate $validate)
{ {
$data = $model::get($id); $data = $model::get($id);
if ($request->isPost()) { if ($request->isPost()) {
$param = $request->param(); $param = $request->param();
if($param['language_type'] == '英语'){
$param['language_type'] = 1;
}else{
$param['language_type'] = 0;
}
$validate_result = $validate->scene('edit')->check($param); $validate_result = $validate->scene('edit')->check($param);
if (!$validate_result) { if (!$validate_result) {
return error($validate->getError()); return error($validate->getError());
...@@ -122,7 +109,6 @@ class ManagerController extends Controller ...@@ -122,7 +109,6 @@ class ManagerController extends Controller
} }
} }
$result = $data->save($param); $result = $data->save($param);
return $result ? success() : error(); return $result ? success() : error();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment