config service for show liman price
This commit is contained in:
@@ -9,6 +9,7 @@ use App\Models\Cnt;
|
||||
use App\Models\Setting;
|
||||
use App\Models\ConfigStatic;
|
||||
use App\Models\Customer;
|
||||
use App\Services\LimanService;
|
||||
use App\Models\Price;
|
||||
use App\Models\PriceCandle;
|
||||
use App\Models\PriceTrigger;
|
||||
@@ -211,16 +212,15 @@ class ReportController extends Controller
|
||||
CURLOPT_TCP_FASTOPEN => 1,
|
||||
]
|
||||
])
|
||||
->withToken(Cnt::where('key', 'liman')->value('value'))
|
||||
->withToken(Setting::where('key', 'liman_token')->value('value'))
|
||||
->get('http://212.23.201.173/server/customer/product/list')
|
||||
->json();
|
||||
|
||||
if ((isset($liman['message']) && $liman['message'] == 'no authorised') || $liman == null) {
|
||||
$cnt = new Cnt();
|
||||
$cnt->liman_login();
|
||||
$newToken = app(LimanService::class)->liman_login();
|
||||
|
||||
$liman = Http::timeout(2)
|
||||
->withToken(Cnt::where('key', 'liman')->value('value'))
|
||||
$liman = Http::timeout(7)
|
||||
->withToken($newToken)
|
||||
->get('http://212.23.201.173/server/customer/product/list')
|
||||
->json();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user