32 lines
1.3 KiB
PHP
32 lines
1.3 KiB
PHP
<?php
|
|
namespace addon\cardservice\event;
|
|
use addon\aliapp\model\CloudPay;
|
|
class AliVerifyCardInfo
|
|
{
|
|
public function handle($param = [])
|
|
{
|
|
if (isset($param['verify_code']) && is_numeric($param['verify_code'])) {
|
|
$CloudPay = new CloudPay();
|
|
$response = $CloudPay->orderQuery('', '', $param['verify_code'])['response']['data'];
|
|
if ($response) {
|
|
$subscriptionNo = $response[0]['subscriptionNo'];
|
|
$join = [
|
|
['member_goods_card_item item', 'a.card_id=item.card_id', 'inner'],
|
|
['verify v', 'item.member_verify_id=v.id', 'inner'],
|
|
];
|
|
$res = model('member_goods_card')->getInfo([['a.site_id', '=', $param['site_id']],['a.trade_no', '=', $subscriptionNo]], 'v.*,a.is_cloud_zmxx', 'a', $join);
|
|
if (!empty($res)) {
|
|
if ($res['is_verify'] == 2) {
|
|
return error([], "订单已退款!");
|
|
}
|
|
$json_array = json_decode($res["verify_content_json"], true); //格式化存储数据
|
|
$res["data"] = $json_array;
|
|
return success(0, '', $res);
|
|
} else {
|
|
return error([], "找不到核销码信息!");
|
|
}
|
|
}
|
|
}
|
|
return null;
|
|
}
|
|
} |