作者 何书鹏

测试通知

... ... @@ -7,6 +7,7 @@ namespace app\api\controller;
use addons\epay\library\Service;
use app\common\controller\Api;
use Exception;
use GuzzleHttp\Client;
use think\Db;
/**
... ... @@ -92,6 +93,17 @@ class Notify extends Api
];
}
$buymodel->isUpdate(false)->saveAll($data);
// 给后台发送新订单提醒
$client = new Client();
$domain = config('socketio.domain');
$port = config('socketio.port');
$response = $client->request('POST', $domain.":{$port}/", [
'form_params' => [
'type' => 'publish',
'content' => '这个是推送的测试数据',
'to' => '',
]
]);
} catch (Exception $e) {
}
return $pay->success()->send();
... ...
<?php
return [
/**
* 域名
*/
'domain' => 'http://temporaryfood.n.broing.cn',
/**
* 端口
*/
'port' => 2021,
];
\ No newline at end of file
... ...