<?php

namespace App\Models;

class SportTeam extends BaseModel
{
    protected $table = 'sport_team';
    protected $fillable = ['team_id', 'team_name_en', 'team_name', 'logo', 'status'];
    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 getTeamName($team_id, $type = 1){
        return self::where(['team_id' => $team_id, 'type' => $type])->value('team_name');
    }
}
