29 lines
675 B
PHP
29 lines
675 B
PHP
![]() |
<?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);
|
||
|
}
|
||
|
}
|