src/Query/Wx/WxChargeQuery.php
protected function createBackData(array $data)
    {
        // 将金额处理为元
        $totalFee = bcdiv($data['total_fee'], 100, 2);

        $retData = [
            'is_success'    => 'T',
            'response'  => [
                'amount'   => $totalFee,
                'channel'   => Config::WX_CHARGE,// 支付查询
                'order_no'   => $data['out_trade_no'],
                'buyer_id'   => $data['openid'],
                'trade_state'   => strtolower($data['trade_state']),
                'transaction_id'   => $data['transaction_id'],
                'time_end'   => date('Y-m-d H:i:s', strtotime($data['time_end'])),
                'return_param'    => $data['attach'],
                'terminal_id' => $data['device_info'],
                'trade_type' => $data['trade_type'],
                'bank_type' => $data['bank_type'],
                'trade_state_desc' => isset($data['trade_state_desc']) ? $data['trade_state_desc'] : '交易成功',
            ],
        ];

        return ArrayUtil::paraFilter($retData);
    }
protected function createBackData(array $data)
    {
        // 将金额处理为元
        $totalFee = bcdiv($data['total_fee'], 100, 2);

        $retData = [
            'is_success'    => 'T',
            'response'  => [
                'amount'   => $totalFee,
                'channel'   => Config::WX_CHARGE,// 支付查询
                'order_no'   => $data['out_trade_no'],
                'buyer_id'   => $data['openid'],
                'trade_state'   => strtolower($data['trade_state']),
                'transaction_id'   => $data['transaction_id'],
                'time_end'   => date('Y-m-d H:i:s', strtotime($data['time_end'])),
                'return_param'    => $data['attach'],
                'terminal_id' => $data['device_info'],
                'trade_type' => $data['trade_type'],
                'bank_type' => $data['bank_type'],
                'trade_state_desc' => isset($data['trade_state_desc']) ? $data['trade_state_desc'] : '交易成功',
            ],
        ];

        return ArrayUtil::paraFilter($retData);
    }
protected function createBackData ( array $ data ) { // 将金额处理为元 $ totalFee = bcdiv ( $ data [ 'total_fee' ] , 100 , 2 ) ; $ retData = [ 'is_success' => 'T' , 'response' => [ 'amount' => $ totalFee , 'channel' => Config :: WX_CHARGE , // 支付查询 'order_no' => $ data [ 'out_trade_no' ] , 'buyer_id' => $ data [ 'openid' ] , 'trade_state' => strtolower ( $ data [ 'trade_state' ] ) , 'transaction_id' => $ data [ 'transaction_id' ] , 'time_end' => date ( 'Y-m-d H:i:s' , strtotime ( $ data [ 'time_end' ] ) ) , 'return_param' => $ data [ 'attach' ] , 'terminal_id' => $ data [ 'device_info' ] , 'trade_type' => $ data [ 'trade_type' ] , 'bank_type' => $ data [ 'bank_type' ] , 'trade_state_desc' => isset ( $ data [ 'trade_state_desc' ] ) ? $ data [ 'trade_state_desc' ] : '交易成功', ] , ] ; return ArrayUtil :: paraFilter ( $ retData ) ; }
返回数据给客户端
@param array $data
@return array
@author helei
返回数据给客户端