255], ]; } public function GoPutRecord() { if (!$this->validate()){ throw new Exception($this->getErrorMsg()); } $is_record=UserPatientRecord::find()->where(['up_id'=>$this->up_id])->one(); if ($is_record){ throw new Exception('您已建过档'); } $UserPatientRecord=new UserPatientRecord(); $UserPatientRecord->attributes=$this->attributes; $UserPatientRecord->saveOrFail(); return ['建档成功,病案号为'.$UserPatientRecord->id]; } public function attributeLabels() { return [ 'up_id'=>'就诊人id', 'height' => 'Height', 'weight' => 'Weight', 'region' => 'Region', 'address' => 'Address', ]; } }