diff --git a/FlyCube/Api/Controller/PayController.class.php b/FlyCube/Api/Controller/PayController.class.php index befe4a8..18de8b8 100644 --- a/FlyCube/Api/Controller/PayController.class.php +++ b/FlyCube/Api/Controller/PayController.class.php @@ -61,7 +61,7 @@ class PayController extends PublicController //设置获取签名的订单参数 $orderParameter = [ 'out_trade_no' => $order['order_sn'], - 'description' => $order['shop_id'], //商品名称 + 'description' => $order['shop_id'], //这个字段用 商铺id 方便分类查询腾讯的支付订单,还有在回调时候发送“订单更新主题”的子主题区分 'amount' => [ 'total' => $order['total_price'] * 100, //单位:分 'currency' => 'CNY', @@ -85,7 +85,7 @@ class PayController extends PublicController { // 实例化 Yansongda Pay $result = Pay::wechat($this->config)->callback(); - // 地面终端 和 小程序端的提示刷新信息 + $this->publish('refreshQuestList/2dc23dcfecc05fb1', 1); try { // 验证成功,处理业务逻辑 @@ -97,6 +97,9 @@ class PayController extends PublicController // 更新订单 $orderDb->where($where)->data($data)->save(); } + // 构建发布主题 并向地面终端提示刷新信息 + $topic = 'refreshQuestList/' . $result['resource']['ciphertext']['description']; + $this->publish($topic, 1); } catch (\Exception $e) { // 捕获并记录可能的异常 error_log('支付回调处理错误:' . $e->getMessage());