<?php
namespace app\index\controller;
use think\facade\View;
use think\facade\Session;
use think\facade\Cache;
use app\common\controller\Pay as PayController;
use app\common\controller\Orders as OrdersController;
use app\common\model\PushTask as PushTaskModel;
use GatewayClient\Gateway;
class Pay extends Base
{
    public function generateOrderInfo()
    {
        if (request()->isPost()) {
            $D=request()->post();
            $D['uid']=Session::get('User.id');
            $D['company_id']=Session::get('User.company_id');
            $D['resume_id']=Session::get('User.resume_id');
            $D['role_type']=Session::get('User.role_type');
            $D['channel_type']=request()->ApiInfo['app_id'];
            $D['app']='pc';
            return PayController::generateOrderInfo($D);
        }
    }
    public function getOrderInfoByOtrade()
    {
        if (request()->isPost()) {
            $D=request()->post();
            $D['uid']=Session::get('User.id');
            $D['company_id']=Session::get('User.company_id');
            $D['resume_id']=Session::get('User.resume_id');
            $D['channel_type']=request()->ApiInfo['app_id'];
            $D['app']='pc';
            return PayController::getOrderInfoByOtrade($D);
        }
    }
    public function cancelOrder()
    {
        if (request()->isPost()) {
            $D=request()->post();
            $D['uid']=Session::get('User.id');
            Session::set('updateUser',true);
            return OrdersController::cancelOrder($D,false,false);
        }
    }
    public function delOrder()
    {
        if (request()->isPost()) {
            $D=request()->post();
            $D['uid']=Session::get('User.id');
            Session::set('updateUser',true);
            return OrdersController::cancelOrder($D,true,false);
        }
    }
}
