*/ class OrderUnitePayFrom extends OrderPayFrom implements PayHandler { /** * 支付金额 * * @return float */ public function getTotalFee(): float { $account = Yii::$app->services->memberAccount->findByMemberId($this->order['buyer_id']); // 正常支付 if ($account->user_money >= $this->order['pay_money']) { throw new UnprocessableEntityHttpException('请直接使用余额支付'); } return BcHelper::sub($this->order['pay_money'], $account->user_money); } }