request->post(); $CaseForm=new CaseForm(); $CaseForm->attributes=$post; return $CaseForm->save(); } /** * 修改病历 */ public function actionEditCase() { $post=\Yii::$app->request->post(); $CaseForm=new CaseForm(); $CaseForm->attributes=$post; return $CaseForm->update(); } /** * @doc-name 查看病历 * @doc-param int user_patient_id 患者id * @doc-param int register_id 挂号id * @doc-return mixed @UserPatientCase{*,@UserPatient{*}} 病历 */ public function actionCaseInfo() { $post=\Yii::$app->request->post(); $CaseForm=new CaseForm(); $CaseForm->attributes=$post; return $CaseForm->info(); } /** * @doc-name 病历列表 * @doc-param string main_suit 主诉 / optional * @doc-return mixed @UserPatientCase{*} 病历 * @doc-return mixed @Pagination{total-int-总数据,totalPage-int-总页数,pageSize-int-每页数据} 分页信息 */ public function actionCaseList() { $post=\Yii::$app->request->post(); $UserPatientCase = UserPatientCase::find()->where([ 'service_user_id' => \Yii::$app->user->id, 'store_id' => \Yii::$app->store, 'is_delete' => 0, ])->with(['userPatient'])->asArray()->all(); if (!$UserPatientCase) throw new Exception('暂无病历'); $query= UserPatientCase::find()->where([ 'service_user_id' => \Yii::$app->user->id, 'store_id' => \Yii::$app->store, 'is_delete' => 0, ])->with(['userPatient'])->orderBy(['id'=>SORT_DESC]); if (!empty($post['main_suit'])){ $query->andWhere(['main_suit'=>$post['main_suit']]); } return $this->create($query,$post); } }