| xqd
@@ -85,11 +85,14 @@ class WorkPointController extends BaseController
|
|
|
return back()->withErrors($validator)->withInput();
|
|
|
}
|
|
|
$data = $request->input('data');
|
|
|
+ if (empty($data['status']))
|
|
|
+ {
|
|
|
+ return back()->withErrors(['sg_error_info' => '状态值为空']);
|
|
|
+ }
|
|
|
$res = $this->model->create($data);
|
|
|
if(empty($res)) return back()->withErrors(['sg_error_info' => '保存失败']);
|
|
|
return redirect($this->pre_uri . 'create')->with(['sg_success_info' => '创建成功']);
|
|
|
}
|
|
|
-
|
|
|
public function edit(Request $request)
|
|
|
{
|
|
|
if(empty($request->input('id')) || empty($item = $this->model->find($request->input('id')))) return back()->withErrors(['sg_error_info' => '找不到要编辑的数据']);
|