|
|
@@ -812,11 +812,12 @@ class WalletService extends BaseService
|
|
|
}
|
|
|
|
|
|
$headers = ["Content-Type: application/json; charset=utf-8"];
|
|
|
- $result = httpRequest($this->bianUrl, json_encode(['fromUserRole'=>'USER','assets'=>['USDT'],'fiatCurrency'=>'CNY','tradeType'=>'BUY']), 'post', '',20,$headers);
|
|
|
+ $url = $this->bianUrl;
|
|
|
+ $result = httpRequest($url, json_encode(['fromUserRole'=>'USER','assets'=>['USDT'],'fiatCurrency'=>'CNY','tradeType'=>'BUY']), 'post', '',20,$headers);
|
|
|
$datas = isset($result['data']) ? $result['data'] : [];
|
|
|
$data = isset($datas[0]) ? $datas[0] : [];
|
|
|
$price = isset($data['referencePrice']) ? moneyFormat($data['referencePrice'],2) : 0;
|
|
|
- RedisService::set("caches:wallets:usdt_buy_result", ['url'=> $this->bianUrl,'result' => $result,'rates'=>$price,'data'=>$data], 7200);
|
|
|
+ RedisService::set("caches:wallets:usdt_buy_result", ['url'=> $url,'result' => $result,'rates'=>$price,'data'=>$data], 7200);
|
|
|
if($price){
|
|
|
RedisService::set($cacheKey, $price, rand(3600,7200));
|
|
|
}else{
|
|
|
@@ -825,7 +826,7 @@ class WalletService extends BaseService
|
|
|
$data = isset($result['data'])? $result['data'] : [];
|
|
|
$data = isset($data['bian'])? $data['bian']: [];
|
|
|
$price = isset($data['buy'])? $data['buy'] : 0;
|
|
|
- RedisService::set("caches:wallets:usdt_buy_result1", ['url'=> $this->bianUrl,'result' => $result,'rates'=>$price,'data'=>$data], 7200);
|
|
|
+ RedisService::set("caches:wallets:usdt_buy_result1", ['url'=> $url,'result' => $result,'rates'=>$price,'data'=>$data], 7200);
|
|
|
if($price<=0){
|
|
|
$price = ConfigService::make()->getConfigByCode('usdt_cny_price',7.2);
|
|
|
}
|