51 lines
1.5 KiB
PHP
51 lines
1.5 KiB
PHP
<?php
|
|
|
|
namespace addon\hyctransfer\api\controller;
|
|
|
|
use addon\hyctransfer\model\ExternalApi;
|
|
use app\api\controller\BaseApi;
|
|
use think\facade\Log;
|
|
class Notify extends BaseApi
|
|
{
|
|
public function access()
|
|
{
|
|
file_put_contents('access.txt', json_encode(input(), JSON_UNESCAPED_UNICODE));
|
|
$mer_id = input('mer_id');
|
|
$transSeqId = input('transSeqId');
|
|
$info = input();
|
|
if ($mer_id) {
|
|
$staff = model('member_bank_account')->getInfo(['member_id' => $mer_id, 'trans_seq_id' => $transSeqId]);
|
|
if ($staff) {
|
|
model('member_bank_account')->update([
|
|
'status' => $info['status'],
|
|
], ['id' => $staff['id']]);
|
|
echo 'RECV_ORD_ID_' . $staff['trans_seq_id'];
|
|
}
|
|
} else {
|
|
echo 'fail';
|
|
}
|
|
}
|
|
|
|
|
|
/***
|
|
* 代发异步通知
|
|
* @return void
|
|
*/
|
|
public function notify()
|
|
{
|
|
try {
|
|
// 参数获取并且处理
|
|
$info = input();
|
|
$site_id = input('site_id');
|
|
$mer_id = input('mer_id', 0);
|
|
$ExternalApi = new ExternalApi($site_id, $mer_id);
|
|
// 为了保证数据的一致性 这里需要调用查询接口进行处理
|
|
$ExternalApi->salaryOutOrderResult($info['attachId']);
|
|
echo 'RECV_ORD_ID_' . $info['orderId'];
|
|
} catch (\Exception $e) {
|
|
Log::debug('------- [异步通知]费用代发 - 申请代发 - 错误 -----' . $e->getMessage());
|
|
echo 'fail';
|
|
}
|
|
}
|
|
}
|