|
@@ -37,13 +37,7 @@ class Fan extends CatchController
|
|
|
public function save(Request $request) : \think\Response
|
|
|
{
|
|
|
$data = $request->post();
|
|
|
-
|
|
|
- if($data['production_date']){
|
|
|
- $data['production_date'] = date('Y-m-d',$data['production_date']);
|
|
|
- }
|
|
|
- if($data['install_date']){
|
|
|
- $data['install_date'] = date('Y-m-d',$data['install_date']);
|
|
|
- }
|
|
|
+
|
|
|
return CatchResponse::success($this->fanModel->storeBy($data));
|
|
|
}
|
|
|
|
|
@@ -66,14 +60,7 @@ class Fan extends CatchController
|
|
|
public function update(Request $request, $id) : \think\Response
|
|
|
{ $data = $request->post();
|
|
|
|
|
|
- if(!strstr($data['production_date'],'-'))
|
|
|
- {
|
|
|
- $data['production_date'] = date('Y-m-d',$data['production_date']);
|
|
|
- }
|
|
|
- if(!strstr($data['install_date'],'-'))
|
|
|
- {
|
|
|
- $data['install_date'] = date('Y-m-d',$data['install_date']);
|
|
|
- }
|
|
|
+
|
|
|
return CatchResponse::success($this->fanModel->updateBy($id, $data));
|
|
|
}
|
|
|
|