<?php
/**
 * @copyright   2008-2020 伯乐发卡 <http://www.lailiyun.com>
 * @creatdate   2020-9-10 Mr wang <634273662@qq.com>
 * @version   伯乐发卡V3（个人自动发卡系统）
 */

namespace BL\app\controller;

use BL\app\libs\Controller;

class pay extends Controller
{
    /**
     * 支付方法
     */
    public function index()
    {
        $id = $this->req->get('id');
        $type = $this->req->get('type');
        $paycode = $this->req->get('paycode');
        //查询订单是否存在
        $order = $this->model()->select()->from('orders')->where(array('fields' => 'orderid=?', 'values' => array($id)))->fetchRow();
        if(!$order)exit('非法请求，已记录ip');		
        $url = $this->urlbase . $this->req->server('HTTP_HOST') . '/pay/' . $paycode. '/send.php';
        $url .= '?orderid=' . $id . '&paycode=' . $type;
        $this->res->redirect($url);
    }



}