<?php
/**
 * 支付玩家数据相关
 */
defined('BASEPATH') OR exit('No direct script access allowed');

class Payingplayers extends MY_Controller{

    public $postData = array('frombg' => 1, 'mod' => '', 'act' => '', 'lid' => 1, 'sid' => 1);

    public function __construct()
    {
        parent::__construct();
        $this->load->helper('url');
        $this->load->helper('cookie');
        $this->load->library('curl');
        $this->load->library('pagination');

        $this->env = get_cookie($this->_wenenv);
        if($this->env == 1){
            $this->_url = $this->config->item('officialUrl');
        }else{
            $this->_url = $this->config->item('localUrl');
            $this->postData['demo'] = 1;
        }
    }

    public function index(){
        $data = array();
        $postdata = array_merge($this->postData);
        $postdata['mod'] = 'Payingplayers';
        $postdata['act'] = 'index';
        $retData = $this->curl->req($this->_url, $postdata);
        if ($retData){
            $data = json_decode($retData, 1);
            ksort($data['firstpayday']);
        }

        $this->load->view('payingplayers/index', $data);
    }
}