|
|
@@ -113,7 +113,7 @@ class AcceptorService extends BaseService
|
|
|
|
|
|
foreach ($datas['data'] as &$item) {
|
|
|
$item['avatar'] = $item['avatar'] ? get_image_url($item['avatar']) : '';
|
|
|
- $item['usdt_quota'] = moneyFormat($item['quota']/$xdPrice, 2);
|
|
|
+ $item['currency_quota'] = $this->getRealPrice($item['quota'], $currency, 3);
|
|
|
$item['usdt_price'] = moneyFormat(1 / $xdPrice, 2);
|
|
|
$item['price'] = $cnyPrice;
|
|
|
}
|
|
|
@@ -134,10 +134,9 @@ class AcceptorService extends BaseService
|
|
|
* @param int $tradeType
|
|
|
* @return string
|
|
|
*/
|
|
|
- public function getRealPrice($currency, $tradeType=1)
|
|
|
+ public function getRealPrice($money,$currency='CNY', $tradeType=1)
|
|
|
{
|
|
|
-
|
|
|
- $xdPrice = ConfigService::make()->getConfigByCode('xd_price', 100);
|
|
|
+ $xdPrice = $money? $money : ConfigService::make()->getConfigByCode('xd_price', 100);
|
|
|
$usdtPrice = RedisService::get("caches:wallets:usdt_rate");
|
|
|
if($usdtPrice<=0){
|
|
|
$usdtCnyPrice = ConfigService::make()->getConfigByCode('usdt_cny_price', 7.2);
|
|
|
@@ -155,7 +154,7 @@ class AcceptorService extends BaseService
|
|
|
$buyPrice = moneyFormat($xdPrice + ($xdPrice * $xdBuyPriceRate / 100), 2);
|
|
|
$cnyBuyPrice = moneyFormat($buyPrice / $usdtPrice , 2);
|
|
|
return moneyFormat($cnyBuyPrice * $currencyPrice, 2);
|
|
|
- }else{
|
|
|
+ }else if($tradeType == 2){
|
|
|
$xdSellPriceRate = ConfigService::make()->getConfigByCode('trade_sell_price_rate', 0);
|
|
|
$xdSellPriceRate = $xdSellPriceRate>0 && $xdSellPriceRate<100? $xdSellPriceRate : 0;
|
|
|
|
|
|
@@ -163,6 +162,9 @@ class AcceptorService extends BaseService
|
|
|
$cnySellPrice = moneyFormat($sellPrice / $usdtPrice , 2);
|
|
|
return moneyFormat($cnySellPrice * $currencyPrice, 2);
|
|
|
}
|
|
|
+
|
|
|
+ $cnyPrice = moneyFormat($xdPrice / $usdtPrice , 2);
|
|
|
+ return moneyFormat($cnyPrice * $currencyPrice, 2);
|
|
|
}
|
|
|
|
|
|
/**
|