|
|
@@ -226,16 +226,16 @@ class FundService
|
|
|
public function trade(int $toUserId, float $amount, $transfer_type, $transfer_id, string $remark)
|
|
|
{
|
|
|
# 验证金额精度
|
|
|
- $currency = CurrencyService::getCurrencyByFundId($this->fundId);
|
|
|
+ $currency = CurrencyService::getCurrency2ByFundId($this->fundId);
|
|
|
if (!$currency) {
|
|
|
return '无法获取币种信息';
|
|
|
}
|
|
|
|
|
|
# 验证并格式化金额精度
|
|
|
- if (!CurrencyService::validateAmountPrecision($amount, $currency->currencyId)) {
|
|
|
+ if (!CurrencyService::validateAmountPrecision($amount, $currency->value)) {
|
|
|
return '金额精度超出币种支持范围';
|
|
|
}
|
|
|
- $formattedAmount = CurrencyService::formatAmountToPrecision($amount, $currency->currencyId);
|
|
|
+ $formattedAmount = CurrencyService::formatAmountToPrecision($amount, $currency->value);
|
|
|
|
|
|
# 检查事务开启
|
|
|
Helper::check_tr();
|