// 交易成功
if ($postdata['result_code'] == 'SUCCESS') {
// 获取log_id
$out_trade_no = explode('O', $postdata['out_trade_no']);
$order_sn = $out_trade_no[1]; // 订单号log_id
// 改变订单状态
model('Payment')->order_paid($order_sn, 2);
// 修改订单信息(openid,tranid)
model('Base')->model->table('pay_log')
->data('openid = "' . $postdata['openid'] . '", transid = "' . $postdata['transaction_id'] . '"')
->where('log_id = ' . $order_sn)
->update();