<commit_before><?php
defined('BASEPATH') OR exit('No direct script access allowed');

$appDir=realpath(dirname(__FILE__).'/../');
$imageDir=realpath(dirname(__FILE__).'/../image');

class CLeague extends CI_Controller {

	/**
	 * Index Page for this controller.
	 *
	 * Maps to the following URL
	 * 		http://example.com/index.php/welcome
	 *	- or -
	 * 		http://example.com/index.php/welcome/index
	 *	- or -
	 * Since this controller is set as the default controller in
	 * config/routes.php, it's displayed at http://example.com/
	 *
	 * So any other public methods not prefixed with an underscore will
	 * map to /index.php/welcome/<method_name>
	 * @see https://codeigniter.com/user_guide/general/urls.html
	 */

	const SAIKUANG = 'saikuang';
	const BEST = 'best';
	const PLAYERSTATISTIC = 'playerstatistic';
	const TEAMSTATISTIC = 'teamStatistic';
	const NO = 'No'; //球员号码
	const PLAYERNAME = 'playername'; //球员名字
		
	const TTL = 24 * 3600;

	public function __construct() {
		parent::__construct();
		$this->load->model('MMatch');
		$this->load->model('MLeague');
		$this->load->model('MUser');
		$this->load->model("MTeam");
		$this->load->model("MRedis");
		$this->load->model("MMTeam");
		$this->redis = $this->MRedis->_getInstance();

		$this->aTeamStatisticItem = array('SCORE', 'BLACKBOARD', 'ASSIST', 'STEAL', 'BLOCK', 'THREEPOINTSCORE', 'PENALTYPOINTSCORE', 'MISTAKE', 'FOULS');	
		$this->aUserStatisticItem = array('SCORE', 'ASSIST', 'BLACKBOARD', 'OKSHOOTCNT', 'ALLSHOOTCNT', 'OKTHIRDCNT', 'ALLTHIRDCNT', 'OKPENALTYCNT', 'ALLPENALTYCNT', 'STEAL',  'BLOCK', 'MISTAKE', 'FOULS');
	}	

	
	public function index()
	{
		#$this->load->view('welcome_message');
		echo "hello umvp!";
	}
	
	
	/*
	beego.Router("/league/inschool/cells?schoolid=xxx&num=xxx&ticket=xxx", &controllers.LeagueController{}, "get:ReqinSchoolLeagueCells")
i	*/
	public function ReqinSchoolLeagueCells(){
		$schoolid = $_GET['schoolid'];
        $num = $_GET["num"];
        $ticket = $_GET["ticket"];
		$type = $this->config->item('MY_LEAGUE_INSCHOOL'); 	
		
		$rcells = array();
		$rcell = array();	
        	$cells = $this->MLeague->GetLeagueInfo($schoolid, $num, $ticket, $type);
		foreach($cells as $cell){
			$rcell["league_id"] = $cell['leagueid'];
			#rcell["league_logo_address"] = $imageDir + "/leagueLogoDir/$logoid.jpg";
			#rcell["league_poster_address"] = $imageDir + "/leaguePosterDir/$posterid.jpg"；
			$leagueid = $cell['leagueid'];
			$matchnum = $this->MMatch->GetMatchCntByLeagueid($leagueid);
			$finishmatchnum = $this->MMatch->GetOverMatchCntByLeagueid($leagueid);
			$rcell["league_match_finish_num"] = $finishmatchnum;
			$rcell["league_match_num"] = $matchnum;
			$rcell["league_name"] = $cell['name'];
			$rcell["league_team_num"] = $cell['team_num'];
			#$rcell["league_fans_num"] = $cell['team_fans'];
			$typeFlag = 'MY_LEAGUE_TYPE_' . $cell['league_type'];
			$rcell["league_type"] = $this->config->item($typeFlag);
			$rcell["league_start_date"] = strtotime($cell['start_time']);
			$rcell["league_end_date"] = strtotime($cell['end_time']);
			#$rcell["league_introduction"] = $cell['introduction'];
			$rcell["ticket"] = $cell['id'];
			$rcells[] = $rcell;
		}
		if(empty($rcells)) {
			$code = $this->config->item('MY_ECHO_FAIL');	
		} else {
			$code = $this->config->item('MY_ECHO_OK');
		}
		MessageEcho($code, "", $rcells);
	}
	/*
	 *  beego.Router("/league/inschool/cell", &controllers.LeagueController{}, "get:ReqinSchoolLeagueCell")
	 */
	public function ReqinSchoolLeagueCell() {
		$leagueid = $_GET['leagueid'];
		$userid = $_GET['userid'];<commit_msg>modify league info<commit_after><?php
defined('BASEPATH') OR exit('No direct script access allowed');

$appDir=realpath(dirname(__FILE__).'/../');
$imageDir=realpath(dirname(__FILE__).'/../image');

class CLeague extends CI_Controller {

	/**
	 * Index Page for this controller.
	 *
	 * Maps to the following URL
	 * 		http://example.com/index.php/welcome
	 *	- or -
	 * 		http://example.com/index.php/welcome/index
	 *	- or -
	 * Since this controller is set as the default controller in
	 * config/routes.php, it's displayed at http://example.com/
	 *
	 * So any other public methods not prefixed with an underscore will
	 * map to /index.php/welcome/<method_name>
	 * @see https://codeigniter.com/user_guide/general/urls.html
	 */

	const SAIKUANG = 'saikuang';
	const BEST = 'best';
	const PLAYERSTATISTIC = 'playerstatistic';
	const TEAMSTATISTIC = 'teamStatistic';
	const NO = 'No'; //球员号码
	const PLAYERNAME = 'playername'; //球员名字
		
	const TTL = 24 * 3600;

	public function __construct() {
		parent::__construct();
		$this->load->model('MMatch');
		$this->load->model('MLeague');
		$this->load->model('MUser');
		$this->load->model("MTeam");
		$this->load->model("MRedis");
		$this->load->model("MMTeam");
		$this->redis = $this->MRedis->_getInstance();

		$this->aTeamStatisticItem = array('SCORE', 'BLACKBOARD', 'ASSIST', 'STEAL', 'BLOCK', 'THREEPOINTSCORE', 'PENALTYPOINTSCORE', 'MISTAKE', 'FOULS');	
		$this->aUserStatisticItem = array('SCORE', 'ASSIST', 'BLACKBOARD', 'OKSHOOTCNT', 'ALLSHOOTCNT', 'OKTHIRDCNT', 'ALLTHIRDCNT', 'OKPENALTYCNT', 'ALLPENALTYCNT', 'STEAL',  'BLOCK', 'MISTAKE', 'FOULS');
	}	

	
	public function index()
	{
		#$this->load->view('welcome_message');
		echo "hello umvp!";
	}
	
	
	/*
	beego.Router("/league/inschool/cells?schoolid=xxx&num=xxx&ticket=xxx", &controllers.LeagueController{}, "get:ReqinSchoolLeagueCells")
i	*/
	public function ReqinSchoolLeagueCells(){
		$schoolid = $_GET['schoolid'];
        $num = $_GET["num"];
        $ticket = $_GET["ticket"];
		$type = $this->config->item('MY_LEAGUE_INSCHOOL'); 	
		
		$rcells = array();
		$rcell = array();	
        	$cells = $this->MLeague->GetLeagueInfo($schoolid, $num, $ticket, $type);
		foreach($cells as $cell){
			$rcell["league_id"] = $cell['leagueid'];
			#rcell["league_logo_address"] = $imageDir + "/leagueLogoDir/$logoid.jpg";
			#rcell["league_poster_address"] = $imageDir + "/leaguePosterDir/$posterid.jpg"；
			$leagueid = $cell['leagueid'];
			$matchnum = $this->MMatch->GetMatchCntByLeagueid($leagueid);
			$finishmatchnum = $this->MMatch->GetOverMatchCntByLeagueid($leagueid);
			$rcell["league_match_finish_num"] = $finishmatchnum;
			$rcell["league_match_num"] = $matchnum;
			$rcell["league_name"] = $cell['name'];
			$rcell["league_team_num"] = $cell['team_num'];
			#$rcell["league_fans_num"] = $cell['team_fans'];
			#$typeFlag = 'MY_LEAGUE_TYPE_' . $cell['league_type'];
			#$rcell["league_type"] = $this->config->item($typeFlag);
			#$rcell["league_rule"] = $cell['league_rule'];;
			$rcell["league_type"] = 1;
			$rcell["league_start_date"] = strtotime($cell['start_time']);
			$rcell["league_end_date"] = strtotime($cell['end_time']);
			#$rcell["league_introduction"] = $cell['introduction'];
			$rcell["ticket"] = $cell['id'];
			$rcells[] = $rcell;
		}
		if(empty($rcells)) {
			$code = $this->config->item('MY_ECHO_FAIL');	
		} else {
			$code = $this->config->item('MY_ECHO_OK');
		}
		MessageEcho($code, "", $rcells);
	}
	/*
	 *  beego.Router("/league/inschool/cell", &controllers.LeagueController{}, "get:ReqinSchoolLeagueCell")
	 */
	public function ReqinSchoolLeagueCell() {
		$leagueid = $_GET['leagueid'];
		$userid = $_GET['userid'];
{'fraction_non_alphanumeric': 0.1984258492129246, 'fraction_numerical': 0.0017950842308754487, 'mean_word_length': 4.874290348742903, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 71, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7372681', 'n_tokens_mistral': 2981, 'n_tokens_neox': 2652, 'n_words': 425}