<?php

namespace App\Models;

class SportLeague extends BaseModel
{
    protected $table = 'sport_league';
    protected $fillable = ['league_id', 'league_en', 'league', 'logo', 'status','country','season','round','standings'];
    public $timestamps = true;
    protected $dateFormat = 'U'; // U 代表 UNIX 时间戳（int）

    // 2. 修改创建时间字段名为 create_time
    const CREATED_AT = 'create_time';
    const UPDATED_AT = 'update_time';

    public static function getLeagueName($league_id, $type = 1){
        return self::where(['league_id' => $league_id, 'type' => $type])->value('league');
    }
}
