public function validateFee() { $userProfile = Yii::createObject(userProfile::className())->findOne(['user_id' => Yii::$app->user->id]); if ($this->withdrawal_fee > $userProfile->money) { $this->addError('withdrawal_fee', '提现金额大于余额!'); } }