29 lines
675 B
PHP
Raw Normal View History

2024-09-29 15:43:18 +08:00
<?php
namespace app\robot\controller\api;
use app\gateway\service\CurlService;
use dever\Log;
use think\admin\Controller;
class Core extends Controller
{
protected function curl($method, $url, $param = array(), $json = false, $header = false)
{
if ($param) {
$log['type'] = 'request';
$log['url'] = $url;
$log['param'] = $param;
$this->log($log);
}
$curl = CurlService::getInstance($url, $param, $method, $json, $header);
$curl->setTimeOut(3600);
return $curl->result();
}
protected function log($data)
{
Log::write('gateway', 'merchant', $data);
}
}