wesmiler 2 роки тому
батько
коміт
f5e9378458
1 змінених файлів з 4 додано та 3 видалено
  1. 4 3
      app/Services/WalletService.php

+ 4 - 3
app/Services/WalletService.php

@@ -812,11 +812,12 @@ class WalletService extends BaseService
         }
         }
 
 
         $headers = ["Content-Type: application/json; charset=utf-8"];
         $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'] : [];
         $datas = isset($result['data']) ? $result['data'] : [];
         $data = isset($datas[0]) ? $datas[0] : [];
         $data = isset($datas[0]) ? $datas[0] : [];
         $price = isset($data['referencePrice']) ? moneyFormat($data['referencePrice'],2) : 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){
         if($price){
             RedisService::set($cacheKey, $price, rand(3600,7200));
             RedisService::set($cacheKey, $price, rand(3600,7200));
         }else{
         }else{
@@ -825,7 +826,7 @@ class WalletService extends BaseService
             $data = isset($result['data'])? $result['data'] : [];
             $data = isset($result['data'])? $result['data'] : [];
             $data = isset($data['bian'])? $data['bian']: [];
             $data = isset($data['bian'])? $data['bian']: [];
             $price = isset($data['buy'])? $data['buy'] : 0;
             $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){
             if($price<=0){
                 $price = ConfigService::make()->getConfigByCode('usdt_cny_price',7.2);
                 $price = ConfigService::make()->getConfigByCode('usdt_cny_price',7.2);
             }
             }