<?php
namespace App\Sports\Model;

use \System\Model;

/**
 * Class St_country
 * @package App\Sports\Model
 * 国家
 */
class St_country extends Model
{

    protected $table = 'st_country';

    //根据国家id 获取国家名称
    public static function getName($countryId = ''){
        $where = [];
        //拼装查询条件
        if(!empty($countryId)){
            $where = [
                ['country_id','=',$countryId]
            ];
        }
        $name = self::select('country_id','name_chinese')
            ->where($where)
            ->get()
            ->toArray();

        return $name;
    }
}