diff --git a/FlyCube/Api/Controller/PayController.class.php b/FlyCube/Api/Controller/PayController.class.php index cbbb0c0..5e450a7 100644 --- a/FlyCube/Api/Controller/PayController.class.php +++ b/FlyCube/Api/Controller/PayController.class.php @@ -59,10 +59,9 @@ class PayController extends PublicController $orderDb = D('order'); $order = $orderDb->where($where)->find(); //设置获取签名的订单参数 - $token = $this->makeToken(array('shop_id' => $order['shop_id'], 'exp' => strtotime('+100 years'))); $orderParameter = [ 'out_trade_no' => $order['order_sn'], - 'description' => $token, //用jwt加密 shop_id商铺id 存放 + 'description' => $order['shop_id'], //用jwt加密 shop_id商铺id 存放 'amount' => [ 'total' => $order['total_price'] * 100, //单位:分 'currency' => 'CNY', @@ -87,13 +86,13 @@ class PayController extends PublicController // 实例化 Yansongda Pay $result = Pay::wechat($this->config)->callback(); - $this->publish('refreshQuestList/2dc23dcfecc05fb1', 1); try { // 验证成功,处理业务逻辑 if ($result['resource']['ciphertext']['trade_state'] == 'SUCCESS') { $where['order_sn'] = $result['resource']['ciphertext']['out_trade_no']; // 获取订单号 $orderDb = D('order'); // 实例化订单模型 - $data['status'] = 'pending'; // 更新订单状态为已支付 + $data['status'] = '已付款'; // 更新订单状态为已支付 + $data['paid_time'] = time(); //标记付款时间 $data['pay_sn'] = $result['resource']['ciphertext']['transaction_id']; // 支付订单号 // 更新订单 $orderDb->where($where)->data($data)->save();