request->post(); $syncPatientForm = new SyncPatientForm(); $syncPatientForm->attributes = $post; return $syncPatientForm->save(); } /** * @doc-name 就诊人信息删除同步 * @doc-return mixed 同步结果 */ public function actionPatientDelete() { $post = \Yii::$app->request->post(); $userPatient = UserPatient::findOne(['user_id'=>$post['user_id'],'id_card'=>$post['id_card'],'is_delete' => 0]); if(!$userPatient){ throw new Exception('就诊人信息错误,无法进行该操作'); } try { UserPatient::updateAll(['is_delete' => 1],['id' => $userPatient->id]); } catch (\Throwable $th) { throw new Exception('删除失败'); } catch (\Exception $e) { throw new Exception('删除失败'); } return ['删除同步成功']; } }